Risk Based Portfolio Valuation
General
The risk based portfolio valuation provides a conservative estimate of portfolio value under adverse conditions.
Market participants must maintain a positive risk based valuation at all times.
If the valuation becomes negative, the account is subject to liquidation.
The exchange operator defines two risk parameters per token:
Adjusted Token Balance
For each token, define the adjusted balance:
Adjusted Balance(token)=Token Balance−Borrowed Quantity with Interest+Lent Quantity with Haircut where:
Lent Quantity with Haircut=Lend Quantity×0.98 tokenBalance = user’s holdings of the token
borrowedQuantityWithInterest = borrowed amount plus 10 days of interest
lendQuantity = total amount lent to others
📌 For efficiency, lending values are aggregated as the sum of all borrowed positions with the maximum 10-day interest rate.
Margin & Portfolio Valuation
The risk-based valuation of the portfolio is:
Risk Based Valuation=Adjusted Bal(BaseToken)+Non-base tokens∑Token Value Token Value
For each non-base token:
tokenValue=min(tokenValuehigh,tokenValuelow) where:
tokenValuehigh=adjustedBal(token)×adjustedTokenPricehigh+aggregatePerpValuehigh tokenValuelow=adjustedBal(token)×adjustedTokenPricelow+aggregatePerpValuelow Adjusted Token Prices
The adjusted token prices are computed as:
adjustedTokenPricehigh=pricemark×(1+riskPrice−riskSlippage×sign(adjustedBal(token))) adjustedTokenPricelow=pricemark×(1−riskPrice−riskSlippage×sign(adjustedBal(token))) Adjusted Perp Values
For perpetual positions, we compute high and low valuations:
aggregatePerpValuehigh=perp positions∑perpValue(markPrice×(1+riskPrice)) aggregatePerpValuelow=perp positions∑perpValue(markPrice×(1−riskPrice)) Perpetual Position Valuation
The perp value at a given price is:
Perp Value(price)=PNL from price movement + Funding Fees at that price SDKs & Optimization
Risk Based Portfolio Valuation have the above formulas built in, so you can test and simulate margin requirements for different position sets.