Skip to content

Query Operations

Obligations

get_user_obligation

Get a user's obligation (deposits, collateral, borrows). Works for all obligation types — standard, earn, and pair — via the ObligationKey seed.

rust
fn get_user_obligation(user: ObligationKey) -> Result<Obligation, MCError>

get_all_obligations

Get all obligation keys in the market.

WARNING

Intended for read-only simulations. Both simulations and on-ledger invocations are constrained by resource limits. For production use, read the corresponding storage entry directly.

rust
fn get_all_obligations() -> Vec<ObligationKey>

Pools

get_pool

Get pool state and configuration.

rust
fn get_pool(pool_address: Address) -> Result<Pool, MCError>

get_pool_data

Get pool data with computed APYs, token rates, and oracle price. For simulations only.

rust
fn get_pool_data(pool_address: Address) -> Result<PoolData, MCError>

get_all_pools

Get all pool addresses registered in the market.

rust
fn get_all_pools() -> Vec<Address>

get_pool_asset_oracle_price

Get the current oracle price for a pool's underlying asset.

rust
fn get_pool_asset_oracle_price(pool_address: Address) -> Result<i128, MCError>

get_oracle_price_decimals

Get the number of decimals used by oracle prices (typically 14).

rust
fn get_oracle_price_decimals() -> u32

Market

get_global_state

Get the market's global configuration and status.

rust
fn get_global_state() -> GlobalState

get_market_data

Get comprehensive market data including all pools with computed APYs. For simulations only.

rust
fn get_market_data() -> Result<MarketData, MCError>

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.

rust
fn refresh_pool(pool_address: Address) -> Result<(), MCError>

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.

rust
fn refresh_obligation(user: ObligationKey) -> Result<(), MCError>