Borrow interest rates can be queried with GetBorrowRate, GetBorrowRates or GetAllBorrowRates.

Lend interest rates can be queried with GetAllLendingRates.

GetAllAssets can be used to get each asset market state and the param internals for in-depth analysis.

Note: The borrow rate returns a "simple" borrow rate, quantified yearly. From this rate, the borrow annual percentage rate (APR) can be calculated as borrow_apr = e^(borrow_rate + 1) - 1.

Query Messages

GetBorrowRate { .. }
pub enum QueryMsg {
   /// Returns the borrow interest rate
    #[returns(cosmwasm_std::Decimal256)]
    GetBorrowRate { asset: AssetInfo },
}
RUST

GetBorrowRates { .. }
pub enum QueryMsg {
 /// Returns multiple borrow interest rates
    #[returns(neptune_common::asset::AssetMap<cosmwasm_std::Decimal256> )]
    GetBorrowRates { assets: Vec<AssetInfo> },
}
RUST

GetAllBorrowRates { .. }
pub enum QueryMsg {
    /// Returns multiple borrow interest rates
    #[returns(neptune_common::asset::AssetMap<cosmwasm_std::Decimal256> )]
    GetAllBorrowRates { start_after: Option<AssetInfo>, limit: Option<u32> },
}
RUST

GetAllLendingRates { .. }
pub enum QueryMsg {
    /// Returns multiple lending interest rates
    #[returns(neptune_common::asset::AssetMap<cosmwasm_std::Decimal256> )]
    GetAllLendingRates { start_after: Option<AssetInfo>, limit: Option<u32> },
}
RUST

GetAllAssets { .. }
pub enum QueryMsg {
    /// Returns the state for all whitelisted assets
    #[returns(neptune_common::asset::AssetMap<Info> )]
    GetAllAssets { start_after: Option<AssetInfo>, limit: Option<u32> },
}
RUST

Query Response

The return from the query may include an AssetMap using Vec Key-Value pairs where the Keys are AssetInfo as shown below in these Common Structures.

AssetMap
pub type AssetMap<T> = NeptuneMap<AssetInfo, T>;

pub struct NeptuneMap<K, V>(pub Vec<(K, V)>);
RUST

AssetInfo
pub enum AssetInfo {
    Token { contract_addr: Addr },
    NativeToken { denom: String },
}
RUST