HeadroomDESK

Venue formula reference

Every formula behind Headroom's four calculators, with the page it comes from and the date that page was read, the venues' own worked examples the code reproduces, and the test files used before every release. Nothing here depends on market data: it is arithmetic on stated inputs, published so anyone can check it.

Headroom Research · formulas version 1.2, public test files version 1.3 · first published (UTC)

Files

The test file fixes every input. From version 1.3 its venue parameters (maintenance rates, tier tables, fee rates) are illustrative values chosen by Headroom, not any venue's table: the cases test the formulas and the tier choice. For a real position, use the venue's own current table. The reference regenerates the test file byte for byte; the site's code must reproduce every case within its stated tolerance before a release. The same files are on GitHub at headroomdesk/venue-formulas.

Files and their SHA-256 fingerprints.
FileWhat it isSHA-256
headroom_venue_formulas_test_vectors_v1_3.jsonTest vectors: 48 cases, inputs and expected outputs with tolerances; venue constants illustrative763b9d81c75e4d2c48e392b465d74c438a4d0d4d3bb80a99dfd6232bd45b540a
headroom_venue_formulas_reference_v1_3.pyReference implementation: Python, standard library only, no network9f6c93be453d4db9b0e50a5cdd701af382309be3f338d407ce39a39aa612c868
calc.jsThe arithmetic this site runs in your browser (JavaScript port of the reference)654d5a554091349837a2b0690ea46340038c7db2b545c6246eb63ccc6acfb717
python3 headroom_venue_formulas_reference_v1_3.py # runs its checks, then writes the test vectors # file: the same bytes as the download

Published examples the code reproduces

Where a venue or firm publishes its own worked example, the site's code must reproduce it before anything else is tested. The public test file checks the firms' examples; the venues' examples are checked here, against the venues' own pages.

Venue and firm examples, reproduced by the site's code
SourceExamplePublished result
Binance support FAQ, USDⓈ-M liquidation priceBTCUSDT, cross margin, two open positions26,316.89
Binance support FAQ, USDⓈ-M liquidation priceETHUSDT, same account1,153.26
Bybit help centre, isolated mode (Unified Trading Account), updated 2026-05-28long 1 BTC at 40,000, 50×, 3,000 added, MMR 0.5%, taker 0.055%36,380.25 (fee to close 21.56)
FTMO trading objectives2-Step daily floors on three days; static maximum floor95,000 / 97,000 / 96,000; 90,000
FTMO trading objectives1-Step maximum floor trailing the end-of-day balance90,000 → 94,000 → 94,000
FTMO trading objectives1-Step daily floors on days 2 and 399,000 / 98,000
FundedNext help centreStellar 2-Step, 1-Step and Lite maximum-loss floors90,000 / 94,000 / 92,000
Delta Exchange user guide, liquidation1% initial, 0.5% maintenance at 10,000 (shape check)9,950; bankruptcy about 9,901

1. Liquidation price

Binance USDⓈ-M, one-way mode

LP = (WB − TMM₁ + UPNL₁ + cum − s·Q·EP) / (Q·MMR − s·Q)

WB is the position's margin in isolated mode or the cross wallet balance; TMM₁ and UPNL₁ are the maintenance margin and open P/L of the other positions (cross only); cum and MMR come from the bracket that covers the position's value at the liquidation price; s is +1 for a long and −1 for a short. Source: Binance support FAQ, "How to Calculate Liquidation Price of USDⓈ-M Contracts". Bracket table re-read 2026-11-15 from Binance's public leverage and margin page.

Bybit USDT perpetual, isolated, Unified Trading Account

Long: LP = [EP·Q − EP·Q/L − extra/(1 − taker) − deduction] / [Q − Q·MMR] Short: LP = [EP·Q + EP·Q/L + extra/(1 + taker) + deduction] / [Q + Q·MMR]

MMR and the deduction come from the risk-limit tier that covers the position's value at the liquidation price. Source: Bybit help centre, "Liquidation Price Calculation under Isolated Mode (Unified Trading Account)", updated 2026-05-28, read 2026-10-29. Tier table read 2026-11-15 from Bybit's public Margin Parameters page.

Delta Exchange India, USD-settled, isolated

N = contracts · contract_value · EP M = IM%·N + extra MM = MM%·N LP = EP ∓ (M − MM) / (contracts · contract_value) (long −, short +) bankruptcy = EP ∓ M / (contracts · contract_value) rate% = rate_min + slope · max(0, N − threshold)

Source: Delta Exchange user guide ("Liquidation", "Margin Explainer"); the maintenance rate is typed by the user (Delta sets it by position size; read it in Delta's contract details). Two cases were checked in Delta's own calculator on 2026-10-29 and matched.

2. Leverage and margin

notional = size · contract_value · price initial margin = notional / leverage opening fee = notional · fee rate largest size = available / (contract_value · price · (1/leverage + fee rate)), rounded down to the size step leverage on equity = notional / equity Bybit fee to close = size · price · (1 ∓ 1/leverage) · taker rate (long −, short +)

3. Position size

loss per unit = |open − stop| + open·fee_in + stop·fee_out size = equity · risk% / (loss per unit · contract_value), rounded down to the size step loss at stop = size · loss per unit · contract_value

A stop is a trigger, not a fill price: slippage and gaps can make the real loss larger.

4. Prop-firm drawdown

daily floor = today's start-of-day balance − daily% · initial max floor = initial · (1 − max%) (FTMO 1-Step: highest start-of-day balance − max% · initial) binding floor = the higher of the two room = equity now − binding floor

Breach tests differ by firm: FTMO counts a breach only below each floor; FundedNext counts reaching the daily floor as a breach and only going below the maximum floor. Sources: FTMO trading objectives; FundedNext help centre articles 9941519, 8019811 and 8019812; read 2026-10-29.

Limits

  • Venues change tiers, fees and rules without notice. Each parameter carries the date it was read; the venue's current page is the authority.
  • Not covered: Binance hedge mode, Bybit cross and portfolio margin, Delta cross margin, funding, and auto-deleveraging.
  • Errors are fixed in public and logged in the corrections log.

Use and citation

The code is released under the MIT licence and this page's text under CC BY 4.0. To cite: Headroom Research (2026), Venue formula reference, test files version 1.3, https://headroomdesk.com/research/venue-formulas/. The files are archived on Zenodo: doi.org/10.5281/zenodo.24247992.

Found a difference between a venue's own screen and these formulas? Write to desk@headroomdesk.com with the venue, the inputs and both numbers.

Last reviewed (UTC).