Class: ChromaticLens
A class representing Chromatic Lens, which provides access to liquidity-related functions.
Constructors
constructor
• new ChromaticLens(_client)
Creates a new instance of ChromaticLens.
Parameters
| Name | Type | Description |
|---|---|---|
_client | Client | The Chromatic Client instance. |
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:100
Methods
claimableLiquidities
▸ claimableLiquidities(marketAddress, params): Promise<{ [tradingFeeRate: string | number]: { [oracleVersion: string | number]: ClaimableLiquidityResult; }; }>
Retrieves the claimable liquidities for a given market and parameters.
Parameters
| Name | Type | Description |
|---|---|---|
marketAddress | `0x${string}` | The address of the Chromatic Market contract. |
params | { oracleVersion: bigint ; tradingFeeRate: number }[] | An array of objects containing tradingFeeRate and oracleVersion. |
Returns
Promise<{ [tradingFeeRate: string | number]: { [oracleVersion: string | number]: ClaimableLiquidityResult; }; }>
A promise that resolves to an object with mappings between tradingFee and oracleVersion.
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:287
contracts
▸ contracts(): Object
Retrieves the ChromaticLens contract.
Returns
Object
The ChromaticLens contract.
| Name | Type |
|---|---|
lens | ContractChromaticLens |
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:118
findFromCLBTotalSupplies
▸ findFromCLBTotalSupplies(clbTokenSupplies): (tokenId: bigint) => bigint
Parameters
| Name | Type |
|---|---|
clbTokenSupplies | Record<string, Partial<ClbTokenTotalSupply>[]> |
Returns
fn
▸ (tokenId): bigint
Parameters
| Name | Type |
|---|---|
tokenId | bigint |
Returns
bigint
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:123
getCLBTokenTotalSupplies
▸ getCLBTokenTotalSupplies(clbTokenAddress): Promise<Record<string, ClbTokenTotalSupply[]>>
Parameters
| Name | Type |
|---|---|
clbTokenAddress | string |
Returns
Promise<Record<string, ClbTokenTotalSupply[]>>
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:171
liquidityBins
▸ liquidityBins(marketAddress): Promise<{ clbTokenTotalSupply: bigint = clbTotalSupply; clbValue: bigint ; freeLiquidity: bigint ; liquidity: bigint ; tradingFeeRate: number = binStatus.tradingFeeRate }[]>
Retrieves the liquidity bins for a given market.
Parameters
| Name | Type | Description |
|---|---|---|
marketAddress | `0x${string}` | The address of the Chromatic Market contract. |
Returns
Promise<{ clbTokenTotalSupply: bigint = clbTotalSupply; clbValue: bigint ; freeLiquidity: bigint ; liquidity: bigint ; tradingFeeRate: number = binStatus.tradingFeeRate }[]>
A promise that resolves to an array of LiquidityBinResult.
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:139
lpReceipts
▸ lpReceipts(marketAddress, owner?): Promise<readonly { action: number ; amount: bigint ; id: bigint ; oracleVersion: bigint ; recipient: `0x${string}` ; tradingFeeRate: number }[]>
Retrieves the LP receipts for a given market and owner.
Parameters
| Name | Type | Description |
|---|---|---|
marketAddress | `0x${string}` | The address of the Chromatic Market contract. |
owner? | `0x${string}` | The address of the LP owner. |
Returns
Promise<readonly { action: number ; amount: bigint ; id: bigint ; oracleVersion: bigint ; recipient: `0x${string}` ; tradingFeeRate: number }[]>
A promise that resolves to the LP receipts.
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:363
ownedLiquidityBins
▸ ownedLiquidityBins(marketAddress, ownerAddress?): Promise<{ binValue: bigint ; clbBalance: bigint = ownedLiquidity.balance; clbTotalSupply: bigint ; clbValue: bigint ; freeLiquidity: bigint ; liquidity: bigint ; tradingFeeRate: number = tradingFeeRate }[]>
Retrieves the owned liquidity bins for a given market and owner.
Parameters
| Name | Type | Description |
|---|---|---|
marketAddress | `0x${string}` | The address of the Chromatic Market contract. |
ownerAddress? | `0x${string}` | The address of the liquidity owner. |
Returns
Promise<{ binValue: bigint ; clbBalance: bigint = ownedLiquidity.balance; clbTotalSupply: bigint ; clbValue: bigint ; freeLiquidity: bigint ; liquidity: bigint ; tradingFeeRate: number = tradingFeeRate }[]>
A promise that resolves to an array of OwnedLiquidityBinResult.
Defined in
packages/sdk-viem/src/entities/ChromaticLens.ts:231
pendingLiquidityBatch
▸ pendingLiquidityBatch(marketAddress, tradingFeeRates): Promise<PendingLiquidityResult[]>
Retrieves the pending liquidities for a given market and trading fee rates.
Parameters
| Name | Type | Description |
|---|---|---|
marketAddress | `0x${string}` | The address of the Chromatic Market contract. |
tradingFeeRates | number[] | An array of tradingFeeRate. |
Returns
Promise<PendingLiquidityResult[]>
A promise that resolves to an array of PendingLiquidity.