Every term,sourced
The formulas Lydit computes, where each term comes from, and how a scenario link carries every input.
Read Binance's FAQTwo formulas
MM = Position × Mark × MMR − cumB
LP =WB − TMM1 + UPNL1 + cumB − Side × Position × EPPosition × MMR − Side × Position
Both from Binance's FAQ. Hedge-mode terms are zero in one-way mode, so they are left out. Lydit shows “No liquidation price” when the denominator is zero or the result is zero or below.
Binance's ETH example, worked by this build
- WB
- 1,535,443.01
- TMM1
- 71,200.81
- UPNL1
- -56,354.57
- cumB
- 135,365
- Side
- 1
- Position
- 3,683.979
- EP
- 1,456.84
- MMR
- 0.1
- Numerator
- -3,823,715.34
- Denominator
- -3,315.58
- Liquidation price
- 1,153.26
Every variable
- WB
- Wallet balance. In cross margin, the cross wallet balance; in isolated, the margin allocated to the position.
- Your account
- TMM1
- Maintenance margin of all other contracts in the cross wallet. Zero in isolated margin.
- Summed from your other positions
- UPNL1
- Unrealized profit and loss of all other contracts. Zero in isolated margin.
- Summed from your other positions
- cumB
- Maintenance amount for the position's tier.
- Binance's margin tiers
- Side
- 1 for a long, −1 for a short.
- Your position
- Position
- Absolute position size, in coins.
- Your position
- EP
- Entry price.
- Your position
- MMR
- Maintenance margin rate for the position's tier, as a fraction: 10% is 0.1.
- Binance's margin tiers
Scenario links
Every input is a query parameter. Opening the link restores the inputs and computes right away.
A missing parameter leaves its field empty and shows no result. A malformed value shows that field's error. Rates travel as fractions; the form shows them as percentages. Up to five other positions travel as o1 to o5, or as totals in tmm and upnl.
- ETH long, crossExample 2, ETHUSDT, with the account's BTC position as the other cross position.
- BTC long, crossExample 2, BTCUSDT, with the account's ETH position as the other cross position.
- Maintenance margin onlyExample 1, BTCUSDT: size, mark price, rate and maintenance amount.
| Parameter | What it sets | Value |
|---|---|---|
| venue | Venue, always binance | binance |
| mode | Margin mode | cross |
| side | Side of this position | long |
| size | Size, in coins | 3683.979 |
| ep | Entry price | 1456.84 |
| mp | Mark price | 1335.18 |
| wb | Wallet balance | 1535443.01 |
| mmr | Maintenance margin rate, as a fraction | 0.1 |
| cum | Maintenance amount | 135365 |
| o1side | Other position 1: side | long |
| o1size | Other position 1: size | 109.488 |
| o1ep | Other position 1: entry price | 32481.98 |
| o1mp | Other position 1: mark price | 31967.27 |
| o1mmr | Other position 1: rate, as a fraction | 0.025 |
| o1cum | Other position 1: maintenance amount | 16300 |
Not covered
Hyperliquid publishes its formulas but no worked numbers, so there is nothing yet to hold a release to. Lydit adds a venue only when that venue publishes answers it can be checked against.
- Hedge mode
- Portfolio margin
- Fees and funding
- Other venues