Skip to main content

Common Data Types

Offered below are some of Neptune’s common data types.

Cw20HookMsg
RUST
pub enum Cw20HookMsg {
    Lend {},
    Redeem {},
    Return { account_index: u8 },
    DepositCollateral { account_index: u8 },
}

PriceInfo
RUST
pub struct PriceInfo {
    pub price: Decimal256,
    pub decimals: u8,
    pub time_last_updated: Timestamp,
    pub confidence: Decimal256,
}

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

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

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

LiquidationOperation
RUST
pub struct LiquidationOperation {
    pub account_addr:  Addr,
    pub account_index: u8,
    pub ask_assets:    AssetMap<LiquidationAmounts>,
    pub offer_assets:  AssetMap<Uint256>,
}

LiquidationAmounts
RUST
pub struct LiquidationAmounts {
    pub amount:       Uint256,
    pub min_discount: Decimal256,
}

State
RUST
pub struct State {
    pub markets: AssetMap<StateMarketInfo>,
    pub collaterals: AssetMap<StateCollateralInfo>,
}

StateMarketInfo
RUST
pub struct StateMarketInfo {
    pub time_last_distributed_interest: Timestamp,
    pub utilization_accumulator:        Decimal256,
    pub lending_principal:              Uint256,
    pub debt_pool:                      Pool,
    pub market_asset_details:           MarketAssetDetails,
}

StateCollateralInfo
RUST
pub struct StateCollateralInfo {
    pub collateral_details: CollateralDetails,
    pub collateral_pool:    Pool,
}

Account
RUST
pub struct Account {
    pub last_tx_height:           u64,
    pub debt_pool_accounts:       AssetMap<PoolAccount>,
    pub collateral_pool_accounts: AssetMap<PoolAccount>,
}

Pool
RUST
pub struct Pool {
    pub balance: Uint256,
    pub shares: Uint256,
}

PoolAccount
RUST
pub struct PoolAccount {
    pub principal: Uint256,
    pub shares: Uint256,
}

MarketAssetDetails
RUST
pub struct MarketAssetDetails {
    pub receipt_addr:            Addr,
    pub borrow_halt_utilization: Decimal256,
    pub interest_fee:            Decimal256,
    pub borrow_cap:              Option<Uint256>,
    pub enabled:                 bool,
}

CollateralDetails
RUST
pub struct CollateralDetails {
    pub collateral_type: AssetType,
    pub liquidation_ltv: Decimal256,
    pub allowable_ltv:   Decimal256,
    pub max_discount:    Decimal256,
    pub min_discount:    Decimal256,
    pub collateral_cap:  Option<Uint256>,
    pub enabled:         bool,
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.