pub struct PerpInfo {Show 15 fields
pub perp_market_index: PerpMarketIndex,
pub maint_base_asset_weight: I80F48,
pub init_base_asset_weight: I80F48,
pub maint_base_liab_weight: I80F48,
pub init_base_liab_weight: I80F48,
pub maint_overall_asset_weight: I80F48,
pub init_overall_asset_weight: I80F48,
pub base_lot_size: i64,
pub base_lots: i64,
pub bids_base_lots: i64,
pub asks_base_lots: i64,
pub quote: I80F48,
pub prices: Prices,
pub has_open_orders: bool,
pub has_open_fills: bool,
}
Fields
perp_market_index: PerpMarketIndex
maint_base_asset_weight: I80F48
init_base_asset_weight: I80F48
maint_base_liab_weight: I80F48
init_base_liab_weight: I80F48
maint_overall_asset_weight: I80F48
init_overall_asset_weight: I80F48
base_lot_size: i64
base_lots: i64
bids_base_lots: i64
asks_base_lots: i64
quote: I80F48
prices: Prices
has_open_orders: bool
has_open_fills: bool
Implementations
sourceimpl PerpInfo
impl PerpInfo
sourcepub fn health_contribution(&self, health_type: HealthType) -> I80F48
pub fn health_contribution(&self, health_type: HealthType) -> I80F48
Total health contribution from perp balances
For fully isolated perp markets, users may never borrow against unsettled positive perp pnl, there pnl_asset_weight == 0 and there can’t be positive health contributions from these perp market. We sometimes call these markets “untrusted markets”.
Users need to settle their perp pnl with other perp market participants in order to realize their gains if they want to use them as collateral.
This is because we don’t trust the perp’s base price to not suddenly jump to zero (if users could borrow against their perp balances they might now be bankrupt) or suddenly increase a lot (if users could borrow against perp balances they could now borrow other assets).
Other markets may be liquid enough that we have enough confidence to allow users to borrow against unsettled positive pnl to some extend. In these cases, the pnl asset weights would be >0.