Olive Docs
Perpetual Futures

Liquidation

Liquidation Condition

Once this condition is triggered, the position is ready to be liquidated.

For liquidation formulas, max_lev refers to liquidation leverage, not the opening leverage cap.

TermValue
Liquidation leverage500x
Maintenance / liquidation margin20 bps
Liquidation close fee0.0012 * Size
Liquidation    {collateral_size+PNLlongborrow_feeclose_fee    sizemax_lev,perp long,collateral_size+PNLshortborrow_feeclose_fee    sizemax_lev,perp short.\text{Liquidation} \iff \begin{cases} \text{collateral\_size}+\text{PNL}_{\text{long}}-\text{borrow\_fee}-\text{close\_fee}\;\le\;\dfrac{\text{size}}{\text{max\_lev}}, & \text{perp long},\\ \text{collateral\_size}+\text{PNL}_{\text{short}}-\text{borrow\_fee}-\text{close\_fee}\;\le\;\dfrac{\text{size}}{\text{max\_lev}}, & \text{perp short}. \end{cases}

Where:

PNL={sizeS0(S1S0),perp long,sizeS0(S0S1),perp short.\mathrm{PNL}= \begin{cases} \dfrac{\text{size}}{S_0}\left(S_1-S_0\right), & \text{perp long},\\ \dfrac{\text{size}}{S_0}\left(S_0-S_1\right), & \text{perp short}. \end{cases}

Borrow fees accrue through the relevant custody's cumulative borrow-rate index. They are realized lazily whenever the position is updated, closed, liquidated, has collateral changed, or has TP/SL managed or executed.

Δborrow_fee={entry_notional(ITOKEN-currentIposition snapshot)365 days10,000,perp long,entry_notional(IUSDC-currentIposition snapshot)365 days10,000,perp short.\Delta\text{borrow\_fee}= \begin{cases} \dfrac{\text{entry\_notional}\cdot\left(I_{\text{TOKEN-current}}-I_{\text{position snapshot}}\right)} {365\text{ days}\cdot10{,}000}, & \text{perp long},\\ \dfrac{\text{entry\_notional}\cdot\left(I_{\text{USDC-current}}-I_{\text{position snapshot}}\right)} {365\text{ days}\cdot10{,}000}, & \text{perp short}. \end{cases}

I is the custody cumulative borrow-rate index. A long perp uses the underlying custody index. A short perp uses the USDC custody index. The position stores its last index snapshot, and every accrual charges only the delta since that snapshot.

Liquidation Price

Pliq={price(collateral_sizeclose_feeborrow_feesizemax_lev)  pricesize,perp long,price+(collateral_sizeclose_feeborrow_feesizemax_lev)  pricesize,perp short.P_{\text{liq}}= \begin{cases} \text{price}-\dfrac{\left(\text{collateral\_size}-\text{close\_fee}-\text{borrow\_fee}-\dfrac{\text{size}}{\text{max\_lev}}\right)\;\text{price}}{\text{size}}, & \text{perp long},\\ \text{price}+\dfrac{\left(\text{collateral\_size}-\text{close\_fee}-\text{borrow\_fee}-\dfrac{\text{size}}{\text{max\_lev}}\right)\;\text{price}}{\text{size}}, & \text{perp short}. \end{cases}

In this case price is the oracle price of the token.

On this page