Skip to main content

MarketModule

@liquidium/client


@liquidium/client / MarketModule

Class: MarketModule

Defined in: packages/client/src/modules/market/market.ts:39

Pool metadata, prices, and current rate helpers.

Constructors

Constructor

new MarketModule(canisterContext): MarketModule

Defined in: packages/client/src/modules/market/market.ts:40

Parameters

canisterContext

CanisterContext

Returns

MarketModule

Methods

findPool()

findPool(query): Promise<Pool>

Defined in: packages/client/src/modules/market/market.ts:128

Resolves a single backing pool for the given Chain + Asset identifier.

Native and chain-key identifiers share a pool. For example, both ETH/USDT and ICP/USDT resolve to the USDT lending pool.

Parameters

query

AssetIdentifier

The market asset and chain pair to match.

Returns

Promise<Pool>

The single pool that matches the requested asset and chain.


getAssetPrices()

getAssetPrices(): Promise<AssetPrices>

Defined in: packages/client/src/modules/market/market.ts:82

Returns the current cached asset prices reported by the protocol.

Returns

Promise<AssetPrices>

The current protocol price map keyed by market asset symbol.


getAssetPriceSnapshot()

getAssetPriceSnapshot(): Promise<AssetPriceSnapshot>

Defined in: packages/client/src/modules/market/market.ts:95

Returns protocol prices with the time at which the SDK completed the fetch.

fetchedAt is an SDK retrieval time, not an oracle observation timestamp. The current lending canister price response does not expose the underlying oracle timestamp.

Returns

Promise<AssetPriceSnapshot>

Protocol prices and their SDK fetch timestamp.


getPoolRate()

getPoolRate(poolId): Promise<PoolRate>

Defined in: packages/client/src/modules/market/market.ts:181

Returns the current borrow, lend, and utilization rates for a pool.

Parameters

poolId

string

The pool principal text.

Returns

Promise<PoolRate>

The borrow, lend, and utilization rates for the requested pool.


getReserveData()

getReserveData(query): Promise<Pool>

Defined in: packages/client/src/modules/market/market.ts:171

Returns the full pool record for the given asset and chain pair.

Convenience wrapper over MarketModule.findPool. listPools() already enriches each pool with its current rate data, so no extra canister call is made.

Parameters

query

AssetIdentifier

The market asset and chain pair to match.

Returns

Promise<Pool>

The matching pool enriched with current rate data.


listPools()

listPools(): Promise<Pool[]>

Defined in: packages/client/src/modules/market/market.ts:49

Lists SDK-supported pools with their current rates.

Unsupported asset or chain variants returned by the canister are omitted.

Returns

Promise<Pool[]>

Supported lending pools enriched with their current rate data.