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 in your portfolio, the system computes a signed notional: Where is the signed position size (positive for long, negative for short) and is the mark price. The effective portfolio notional accounts for correlations between all position pairs: Where is the real-time correlation coefficient between assets and , ranging from (perfect negative correlation) to (perfect positive correlation). Then: When positions hedge each other (correlated assets, opposing directions), the cross terms become negative and shrinks well below the sum of individual notionals.Step 2: Portfolio Leverage
Where 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:- Leverage - the portfolio leverage
- Impact - estimated market impact of liquidating this position, in basis points, derived from order book depth
- Regime - the current market regime (see below)
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: 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: Where is the unsigned notional. The correlation component of portfolio maintenance margin is: This captures the combined portfolio risk rather than summing independent position margins.Step 5: Liquidation Reserve
Each market has a minimum reserve floor and impact reserve factor . This reserve calculation uses the full cascade-impact estimate: Only the part not already represented by impact is added to maintenance margin: 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: 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: Where is the rate at time of transition, is the new regime’s target, is the decay factor, and 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: Liquidation uses impact-adjusted closeout equity: 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:- Available margin: Your available equity (equity minus maintenance margin in use) must support the new order’s notional
- Max leverage: The implied leverage of the order (and cumulative leverage including open orders) must not exceed the per-instrument maximum
- Reducing trades: Orders that reduce or close an existing position always pass, regardless of margin state