Closing half a portfolio's gross notional does not necessarily halve its risk. In this synthetic two-leg study, three allocations close the same $450,000 and pay the same assumed $450 fee, yet leave margin requirements of $39,500, $139,500 and $114,500. The difference comes from the positions left behind. Source code, exact inputs, verification checks and complete results are available below.
One question, with close size and fees held equal
When an account contains a partial hedge, how does the choice of leg to close change the remaining portfolio's scenario margin? We built a small deterministic model to isolate that question. It compares three allocations at the same executed notional, with identical marks, fees and risk parameters.
This is a position-reduction and closeout-allocation study. The starting account is healthy under the model: $100,000 of marked equity against a $79,000 requirement. It is not a simulation of an account already undergoing forced liquidation, a market backtest or a benchmark of an FT production engine.
The underlying issue is established: Deribit's margin explanation notes that removing a position that hedges another can increase margin usage. Our experiment makes that relationship inspectable under a fully specified, deliberately simplified set of assumptions.
The synthetic account and its stress grid
The account holds a long position of 10 units in one linear market and a short position of 8 units in another. Both markets have a fixed current mark of $50,000 per unit. Starting gross notional is $900,000; net directional notional is $100,000.
Each remaining portfolio is evaluated against 15 combinations: common market returns of −25%, −10%, 0%, +10% and +25%, crossed with per-leg basis offsets of −5%, 0% and +5%. The long market receives the common return plus the offset; the short market receives the common return minus the offset. A 5% offset therefore creates a 10-percentage-point difference between the two market returns.
The model adds a reserve equal to 1% of remaining gross notional and deducts an assumed fee of 10 basis points of closed notional from equity. The reserve is a synthetic margin add-on; the fee is a separate assumed execution charge. Neither parameter is calibrated to market observations or copied from a venue.
Revalue the positions that remain
Let L and S be nonnegative magnitudes of the remaining long and short positions, P the fixed mark, c the common return and b the per-leg basis offset. A short position profits when its market falls, so the scenario calculation is:
scenario P&L = P × [L × (c + b) − S × (c − b)]
stress loss = max(0, largest loss across the 15 scenarios)
margin requirement = stress loss + 1% × P × (L + S)
marked equity after closing = $100,000 − 0.1% × closed notional
margin headroom = marked equity − margin requirementClosing positions at unchanged current marks produces no additional price P&L in this experiment. Fees reduce equity. This accounting isolates allocation from execution-price effects.
An independent simplification provides a useful check. For this symmetric grid and linear portfolio, stress loss equals P × [0.25 × |L − S| + 0.05 × (L + S)]. The outer scenarios determine the maximum; the 15 rows are not 15 independent risk factors. Deribit's portfolio-margin documentation also distinguishes the worst tested scenario from a bound on every possible loss. Our formula is a toy model, not a reproduction of its margin system.
At a 50% close budget, allocation changes the result
Each method closes $450,000, pays the same $450 assumed fee and leaves $450,000 of gross notional. Marked equity is $99,550 in all three outcomes. Proportional reduction preserves the original 10:8 ratio. Short-first exhausts the short position before reducing the long; long-first does the reverse.
| Allocation | Long / short units remaining | Stress loss | Margin requirement | Margin headroom |
|---|---|---|---|---|
| Proportional | 5 / 4 | $35,000 | $39,500 | $60,050 |
| Short-first | 9 / 0 | $135,000 | $139,500 | −$39,950 |
| Long-first | 1 / 8 | $110,000 | $114,500 | −$14,950 |
The residual reserve is $4,500 for every row, so it cannot explain the difference. Removing the smaller short leg leaves nine unhedged long units. Removing nine long units leaves the account predominantly short. Both outcomes require more margin than the initial $79,000 despite halving gross notional.
Negative headroom means the remaining equity does not cover this model's requirement. It is not a measured loss, a realized bad-debt amount or proof that a live account would become insolvent.
Proportional reduction is not always the best of the three
The starting portfolio is already net long. A small long-first reduction can remove that imbalance more effectively than preserving the original ratio. At a 10% budget, every method closes $90,000 and pays $90.
| Allocation | Long / short units remaining | Margin requirement |
|---|---|---|
| Proportional | 9 / 7.2 | $71,100 |
| Short-first | 10 / 6.2 | $96,100 |
| Long-first | 8.2 / 8 | $51,100 |
This counterexample matters: preserving useful offsets is not the same as mechanically preserving every position ratio. The experiment compares three simple allocation rules; it does not search all possible allocations or establish an optimal liquidation policy.
Publish the full grid, including the endpoints
The experiment evaluates close budgets of 0%, 10%, 25%, 50%, 75% and 100% under all three methods. That produces 18 allocation outcomes, each evaluated against the same 15 scenarios: 270 deterministic scenario evaluations, not 270 market samples.
At 0%, the methods share the same $79,000 requirement and $21,000 headroom. At 100%, every position is closed, the modeled requirement is zero and equity is $99,100 after $900 of assumed fees. Intermediate requirements need not decline monotonically along a one-leg-first path.
The complete CSV and JSON report remaining quantities, closed and remaining notional, fees, equity, stress loss, reserve, requirement and headroom. JSON also retains the individual scenario outcomes and binding scenario identifiers. These records let a reader inspect why a number changed rather than rely on a selected chart.
Run and inspect the evidence
Download the model, verification checks and methodology and instructions. Reference outputs are available as CSV and JSON, with a file-hash manifest. Place all six files together and use Node.js 22 or newer:
node model.mjs
node --test verify.mjsThe first command prints the result grid as CSV. The second runs the supplied checks. With the complete bundle in one directory, node model.mjs --write regenerates the result files and manifest.
The implementation uses exact integer arithmetic for the published grid. Review both the equations and the checks: matching a file hash establishes file identity, while reproducing a result establishes consistency with the supplied model. Neither validates its economic assumptions.
Use the result as an accounting and risk invariant
The supported conclusion is narrow: equal reductions in gross notional can leave materially different scenario requirements because the remaining exposures differ. A closeout engine should therefore evaluate the post-trade portfolio, including charges, rather than infer risk reduction from the quantity closed.
The model assumes every prescribed fill is feasible at the unchanged mark. It omits market depth, slippage, solver availability, funding, price evolution, gas costs, custody restrictions and delays between legs. It also omits options and other nonlinear exposures. A live policy needs those constraints; this study cannot rank execution routes or quantify their expected loss.
A useful integration check is to submit an allowed reduction, reconstruct its remaining positions and recompute the same versioned risk model before accepting the transition. See the portfolio-margin guide for account-state validation and the liquidation guide for execution and recovery. This study supplies reproducible examples of the allocation effect, not production risk parameters.
Common engineering questions
Are these results based on historical market data?
No. They are deterministic outputs from a synthetic account, fixed marks and a stated scenario grid. The model is designed to isolate the effect of close allocation, not estimate how frequently a market event occurs.
Does the study show that proportional liquidation is optimal?
No. Long-first produces a lower requirement at the 10% close budget because it removes the initial net-long imbalance. The model compares three rules and does not optimize across all allocations or execution constraints.
Is negative margin headroom the same as realized bad debt?
No. It is the difference between marked equity and this model's requirement. It signals insufficient coverage of the modeled requirement, not an observed cash loss or a completed insolvency calculation.