Skip to main content
BULK liquidations are portfolio-aware. The system prices the cost of closing the account, cancels its open orders, and reduces the positions that restore margin health most efficiently. It does not automatically flatten the largest position or submit the entire portfolio as one unrestricted market order.

Trigger Condition

Liquidation is triggered when both conditions are met: Eclose<MpandPnLmark<0E_{\text{close}} \lt M_p \quad \text{and} \quad \text{PnL}_{\text{mark}} \lt 0 Where MpM_p is reserve-adjusted portfolio maintenance margin and closeout equity is: Eclose=C+PnLimpactedE_{\text{close}} = C + \text{PnL}_{\text{impacted}} CC is collateral. PnLimpacted\text{PnL}_{\text{impacted}} values each position at an adverse estimated closeout price rather than assuming the full position can exit at the mark.

Closeout Impact

For each position, BULK measures the current cost of sweeping its closing side of the book and the additional impact of nearby liquidation cascades: Iclose=Isweep+c⋅max⁡(Icascade−Isweep,  0)I_{\text{close}} = I_{\text{sweep}} + c \cdot \max\left(I_{\text{cascade}} - I_{\text{sweep}},\; 0\right) cc is the configured cascade factor. If a current sweep observation is unavailable, the full cascade-impact estimate is used. Thin books, larger positions, and concentrated liquidation levels therefore reduce closeout equity before an account reaches bad debt.

Reserve-Adjusted Maintenance Margin

Maintenance margin also reserves for liquidation cost not already represented by impacted PnL. This calculation uses the full cascade-impact estimate: Iall-in=max⁡(Icascade⋅(1+r),  R)I_{\text{all-in}} = \max\left(I_{\text{cascade}} \cdot (1 + r),\; R\right) Where RR is the market-specific reserve floor and rr is its impact reserve factor. Only the residual Iall-in−IcascadeI_{\text{all-in}} - I_{\text{cascade}} is added to maintenance margin: Mp=Mcorrelated+∑iNi⋅(Iall-in,i−Icascade,i)⋅10−4M_p = M_{\text{correlated}} + \sum_i N_i \cdot \left(I_{\text{all-in},i} - I_{\text{cascade},i}\right) \cdot 10^{-4} This is a deterministic risk reserve, not a separate liquidation fee.

Liquidation Lifecycle

Step 1: Cancel Open Orders

All resting orders belonging to the account are cancelled before its positions are changed. This prevents open orders from increasing exposure during liquidation.

Step 2: Compute the Recovery Target

The optimizer computes how much maintenance margin must be removed: target=max⁡(0,  Eclose⋅(1−buffer))\text{target} = \max\left(0,\; E_{\text{close}} \cdot (1 - \text{buffer})\right) gap=Mp−target\text{gap} = M_p - \text{target} The buffer leaves the account below its available closeout equity after the planned reduction.

Step 3: Size Candidate Reductions

The optimizer tests incremental reductions for every non-zero position. The step size increases with the severity of the margin gap: Each reduction is capped by the position’s remaining size.

Step 4: Measure Portfolio Change

For every candidate, BULK recomputes:
  • The position’s lambda at its hypothetical smaller size
  • The change in correlation-adjusted portfolio margin
  • The change in its size-dependent liquidation reserve
  • The expected cost of executing the reduction through current depth
Hedging and correlation benefit are evaluated as part of the whole portfolio rather than treating each leg independently.

Step 5: Rank by Efficiency

Candidates are ranked by signed maintenance-margin change per dollar of expected execution cost: Impact Ratioi=−ΔMp,iExpected Execution Costi\text{Impact Ratio}_i = \frac{-\Delta M_{p,i}}{\text{Expected Execution Cost}_i} Greater estimated margin relief ranks first. The optimizer applies the highest-ranked reduction, recomputes the account, and repeats. Near-zero margin changes are skipped.

Step 6: Stop When Margin Is Restored

The optimizer runs for up to 100 iterations. If selective reductions cannot restore the target within that limit, it falls back to closing all remaining positions.

Protected Execution

The account’s selected position reduction is applied during the liquidation tick at a reserve-adjusted price. Protected market execution begins after that state change; it does not delay or condition the account’s liquidation. From the next executor tick, BULK may use available opposing liquidity within deterministic price limits. More aggressive execution is allowed only after an execution window has completed with a remaining shortfall, and only up to the largest quantity supported by calibrated depth. Every aggressive order has a limit independently anchored to both fair price and oracle price. If depth or either reference is unavailable or outside the configured limits, execution is postponed rather than crossing an unbounded price. Protected execution applies to quantity already accepted by the protocol. Price or depth constraints postpone that execution; they do not create a new ADL underfill.

Shortfall and ADL

ADL is evaluated for two distinct conditions:
  1. Shortfall: liquidation losses exceed the account’s collateral.
  2. Underfill: part of the planned reduction cannot be accepted within protocol capacity.
The protocol risk vault covers its configured share of shortfall and any residual that ADL cannot allocate. Underfill ADL reduces eligible opposing positions; any remaining quantity returns to protected execution. See Auto-Deleveraging for ranking and allocation.

Full Lifecycle