Query Operations
Obligations
get_user_obligation
Get a user's obligation (deposits, collateral, borrows). Works for all obligation types (standard, earn, looping, etc.) via the ObligationKey seed.
fn get_user_obligation(user: ObligationKey) -> Result<Obligation, MCError>get_user_obligation: (
{user}: {user: string},
options?: MethodOptions
) => Promise<AssembledTransaction<Result<Obligation>>>Pools
get_pool
Get pool state and configuration.
fn get_pool(pool_address: Address) -> Result<Pool, MCError>get_pool: (
{pool_address}: {pool_address: string},
options?: MethodOptions
) => Promise<AssembledTransaction<Result<Pool>>>get_pool_data
Get pool data with computed APYs, token rates, and oracle price.
fn get_pool_data(pool_address: Address) -> Result<PoolData, MCError>get_pool_data: (
{pool_address}: {pool_address: string},
options?: MethodOptions
) => Promise<AssembledTransaction<Result<PoolData>>>get_all_pools
Get all pool addresses registered in the market.
fn get_all_pools() -> Vec<Address>get_all_pools: (
options?: MethodOptions
) => Promise<AssembledTransaction<Array<string>>>get_oracle_price_decimals
Get the number of decimals used by oracle prices (typically 14).
fn get_oracle_price_decimals() -> u32get_oracle_price_decimals: (
options?: MethodOptions
) => Promise<AssembledTransaction<u32>>Market
get_global_state
Get the market's global configuration and status.
fn get_global_state() -> GlobalStateget_global_state: (
options?: MethodOptions
) => Promise<AssembledTransaction<GlobalState>>get_market_data
Get comprehensive market data including all pools with computed APYs. Intended to be used as a simulation call.
fn get_market_data() -> Result<MarketData, MCError>get_market_data: (
options?: MethodOptions
) => Promise<AssembledTransaction<Result<MarketData>>>Returns a MarketData struct containing pools_data, global_state, and oracle_price_decimals.
Refresh (Interest Accrual)
refresh_pool
Manually accrue interest on a pool. Permissionless.
fn refresh_pool(pool_address: Address) -> Result<(), MCError>refresh_pool: (
{pool_address}: {pool_address: string},
options?: MethodOptions
) => Promise<AssembledTransaction<Result<void>>>refresh_obligation
Accrue interest on all pools that a user's obligation has open positions in. Works for all obligation types via the ObligationKey seed. Permissionless.
fn refresh_obligation(user: ObligationKey) -> Result<(), MCError>refresh_obligation: (
{user}: {user: string},
options?: MethodOptions
) => Promise<AssembledTransaction<Result<void>>>