Links

Portfolio Margin Calculations

The total margin requirement has three main components:

Stress Requirement

Portfolio margin is calculated by market stress approach – for each user, changes in OptiFi position values are calculated under different stress scenarios on the underlying asset. Currently, market stress scenarios are set from -30% to +30%.
For each instrument, the profit or loss can be calculated by multiplying its long (+) or short (-) position with each stress. The most severe stress for the user in terms of loss provides the collateral requirement on a portfolio basis to support open positions.
For example, we check positions separately at first: If you spend $1,489 to long a BTC-38000-1w-Call, the most severe stress is -$1,489 when the BTCUSDC spot price drops 30%. If you receive $198 to short a BTC-43000-1w-Call, the most severe stress is -$6,364 when the BTCUSDC spot price rises 30%.
However, OptiFi considers two positions as a whole strategy. Hence the most severe stress becomes -$1,292 when the BTCUSDC spot price drops 30%. It means:
Stress Requirement = -$1,292

Option Value Add-On

In addition to collateral for stresses, Option Value is added to account for intrinsic and premium values on top of stress requirement to ensure that there are enough funds to settle or close positions. OptiFi sets a minimum of net intrinsic or net premium value for each user:
Option Value Add-On = min ⁡( ∑〖 Position x Option Intrinsic Value〗 , ∑〖Position x Option Premium〗)
Please note, that option value add-on here is a negative number, which corresponds to premiums or intrinsic value owed by an account in short positions.
According to the formula above, if you long a BTC-38000-1w-Call at $1,489 and short a BTC-43000-1w-Call at $198, when the current spot price is $38,000:
Option Value Add-On = min ⁡( ∑〖 $0 + $0 〗, ∑〖 $1,489 - $198 〗) = min ( $0 , $1,292 ) = $0

Liquidity Adjustment

Finally, liquidity adjustment is made to account for settlement of closest maturity contracts to ensure that there are enough funds for settlement of maturating positions. A liquidity add-on is calculated for the closest maturity contracts only:
Liquidity Adjustment = (Time to maturity x 2/365 + 1) ( ∑〖Position x Option Intrinsic Value〗)
Please note that liquidity adjustment is added only in cases where Net Option Intrinsic value is negative.
Per the case above, if you long a BTC-38000-1w-Call at $1,489 and short a BTC-43000-1w-Call at $198, when the current spot price is $38,000:
Liquidity Adjustment = (7*2/365+1)($0) + (7*2/365+1)($0) = $0 + $0 = $0
In summary, if you long a BTC-38000-1w-Call at $1,489 and short a BTC-43000-1w-Call at $198, when the current spot price is $38,000:
Total margin requirement = -$1,292 + $0 + $0 = -$1,292
If you have $5,000 USDC in Account Equity, the Available Balance = $5,000 - $1,292 = $3,708