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.
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.
| File | What it is | SHA-256 |
|---|---|---|
| headroom_venue_formulas_test_vectors_v1_3.json | Test vectors: 48 cases, inputs and expected outputs with tolerances; venue constants illustrative | 763b9d81c75e4d2c48e392b465d74c438a4d0d4d3bb80a99dfd6232bd45b540a |
| headroom_venue_formulas_reference_v1_3.py | Reference implementation: Python, standard library only, no network | 9f6c93be453d4db9b0e50a5cdd701af382309be3f338d407ce39a39aa612c868 |
| calc.js | The arithmetic this site runs in your browser (JavaScript port of the reference) | 654d5a554091349837a2b0690ea46340038c7db2b545c6246eb63ccc6acfb717 |
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.
| Source | Example | Published result |
|---|---|---|
| Binance support FAQ, USDⓈ-M liquidation price | BTCUSDT, cross margin, two open positions | 26,316.89 |
| Binance support FAQ, USDⓈ-M liquidation price | ETHUSDT, same account | 1,153.26 |
| Bybit help centre, isolated mode (Unified Trading Account), updated 2026-05-28 | long 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 objectives | 2-Step daily floors on three days; static maximum floor | 95,000 / 97,000 / 96,000; 90,000 |
| FTMO trading objectives | 1-Step maximum floor trailing the end-of-day balance | 90,000 → 94,000 → 94,000 |
| FTMO trading objectives | 1-Step daily floors on days 2 and 3 | 99,000 / 98,000 |
| FundedNext help centre | Stellar 2-Step, 1-Step and Lite maximum-loss floors | 90,000 / 94,000 / 92,000 |
| Delta Exchange user guide, liquidation | 1% initial, 0.5% maintenance at 10,000 (shape check) | 9,950; bankruptcy about 9,901 |
1. Liquidation price
Binance USDⓈ-M, one-way mode
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
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
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
3. Position size
A stop is a trigger, not a fill price: slippage and gaps can make the real loss larger.
4. Prop-firm drawdown
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.