Skip to main content

Portfolio Margin

BULK runs a portfolio margin system. Instead of computing margin for each position independently and summing them up, BULK evaluates the risk of your entire portfolio as a single unit, accounting for correlations between assets and the hedging benefits of opposing positions. This is the same philosophy behind CME SPAN, the gold standard for institutional derivatives margining. SPAN evaluates portfolio risk across scenarios. BULK takes the concept further: instead of a fixed set of 16 scenarios run in batch, BULK uses continuous lambda surfaces that adapt in real time to leverage, position size, market regime, and cross-asset correlations. The result is up to 70% margin efficiency on hedged portfolios. A long BTC / short ETH position requires far less margin than the sum of the two individual margins, because the system understands these assets are correlated and the short hedges the long.

How It Works

Step 1: Effective Portfolio Notional

For each position ii in your portfolio, the system computes a signed notional: sNi=sign(Qi)⋅∣Qi∣⋅PisN_i = \text{sign}(Q_i) \cdot |Q_i| \cdot P_i Where QiQ_i is the signed position size (positive for long, negative for short) and PiP_i is the mark price. The effective portfolio notional accounts for correlations between all position pairs: Neff2=∑isNi2+2∑i<jsNi⋅sNj⋅ρijN_{\text{eff}}^2 = \sum_i sN_i^2 + 2 \sum_{i \lt j} sN_i \cdot sN_j \cdot \rho_{ij} Where ρij\rho_{ij} is the real-time correlation coefficient between assets ii and jj, ranging from −1-1 (perfect negative correlation) to +1+1 (perfect positive correlation). Then: Neff=max⁡(0,  Neff2)N_{\text{eff}} = \sqrt{\max(0,\; N_{\text{eff}}^2)} When positions hedge each other (correlated assets, opposing directions), the cross terms become negative and NeffN_{\text{eff}} shrinks well below the sum of individual notionals.

Step 2: Portfolio Leverage

Lportfolio=NeffCL_{\text{portfolio}} = \frac{N_{\text{eff}}}{C} Where CC is your total collateral (USDC). This portfolio-level leverage, not per-position leverage, drives the lambda lookup.

Step 3: Per-Position Lambda from Risk Surfaces

Each asset has a lambda surface, a continuous 3D function: λi=f(leverage,  impact,  regime)\lambda_i = f(\text{leverage},\; \text{impact},\; \text{regime})
  • Leverage - the portfolio leverage LportfolioL_{\text{portfolio}}
  • Impact - estimated market impact of liquidating this position, in basis points, derived from order book depth
  • Regime - the current market regime (see below)
The surface is interpolated bilinearly across grid knot points, producing a smooth maintenance margin rate with no discrete jumps at tier boundaries.

Cascade Adjustment

The executor builds size-indexed impact curves from current book depth and nearby liquidation levels. Each position queries the curve for its closing side and size, and the system iterates up to two rounds when recalibrating lambda. This prevents a position from appearing well-margined when closing it could move the book far enough to trigger additional liquidations. Closeout PnL uses both current sweep cost and a configured fraction of any larger cascade estimate: 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) If the current sweep observation is unavailable, the full cascade-impact estimate is used.

Step 4: Portfolio Maintenance Margin

For each position, the signed margin component is: Mi=sign(Qi)⋅λi⋅NiM_i = \text{sign}(Q_i) \cdot \lambda_i \cdot N_i Where Ni=∣Qi∣⋅PiN_i = |Q_i| \cdot P_i is the unsigned notional. The correlation component of portfolio maintenance margin is: Mcorrelated=max⁡(0,  ∑iMi2+2∑i<jMi⋅Mj⋅ρij)M_{\text{correlated}} = \sqrt{\max\left(0,\; \sum_i M_i^2 + 2\sum_{i \lt j} M_i \cdot M_j \cdot \rho_{ij}\right)} This captures the combined portfolio risk rather than summing independent position margins.

Step 5: Liquidation Reserve

Each market has a minimum reserve floor RiR_i and impact reserve factor rir_i. This reserve calculation uses the full cascade-impact estimate: Iall-in,i=max⁡(Icascade,i⋅(1+ri),  Ri)I_{\text{all-in},i} = \max\left(I_{\text{cascade},i} \cdot (1 + r_i),\; R_i\right) Only the part not already represented by impact 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} The reserve rises with position size and closeout impact. It is part of deterministic risk pricing, not a separate liquidation fee.

Step 6: Marginal Contributions

For each position, the system computes partial derivatives: ∂Mp∂Mi∝∑jMj⋅ρijMp\frac{\partial M_p}{\partial M_i} \propto \frac{\sum_j M_j \cdot \rho_{ij}}{M_p} This tells the liquidation optimizer how much each position contributes to overall portfolio risk. Candidate reductions also include the change in liquidation reserve, so selection accounts for both correlation benefit and closeout cost.

Regime Detection

BULK classifies the current market environment into one of 9 regimes using a Hidden Markov Model. Each regime encodes direction and volatility: When the regime shifts, for example from neutral-low-vol (0) to bearish-high-vol (-12), lambda values increase across the surface, raising margin requirements in real time before losses materialize.

Time Decay Between Regimes

Margin requirements don’t jump instantaneously on a regime change. They follow a decay curve: λ(t)=λorigin⋅pt+λend⋅(1−pt)\lambda(t) = \lambda_{\text{origin}} \cdot p^t + \lambda_{\text{end}} \cdot (1 - p^t) Where λorigin\lambda_{\text{origin}} is the rate at time of transition, λend\lambda_{\text{end}} is the new regime’s target, pp is the decay factor, and tt is time elapsed. This smooths transitions and prevents unnecessary liquidation cascades from brief regime flickers.

Collateral and Equity

All collateral is denominated in USDC. Mark equity is: Emark=C+PnLmarkE_{\text{mark}} = C + \text{PnL}_{\text{mark}} Liquidation uses impact-adjusted closeout equity: Eclose=C+PnLimpactedE_{\text{close}} = C + \text{PnL}_{\text{impacted}} PnLimpacted\text{PnL}_{\text{impacted}} applies the estimated adverse cost of closing each position. This prevents the risk engine from assuming that a large position can exit entirely at the mark.

Order Validation

Before any order is accepted, a pre-flight check verifies:
  1. Available margin: Your available equity (equity minus maintenance margin in use) must support the new order’s notional
  2. Max leverage: The implied leverage of the order (and cumulative leverage including open orders) must not exceed the per-instrument maximum
  3. Reducing trades: Orders that reduce or close an existing position always pass, regardless of margin state
This is not a simple “initial margin” formula. The validation uses the same portfolio margin model, checking whether the new exposure would remain within risk limits given your current portfolio state.

Isolated Risk via Sub-Accounts

BULK uses cross margin by default, where all collateral is shared across positions in your account. If you want to isolate risk for a specific trade, create a sub-account. Each sub-account has its own collateral pool and positions, completely independent from your main account. A liquidation in a sub-account does not affect your main account or other sub-accounts. Sub-account volume rolls up to your main account for fee tier calculation.

Liquidation Trigger

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 See Liquidations for closeout pricing, selective reduction, and protected execution.