LyditOpen the gauge

Every term,sourced

The formulas Lydit computes, where each term comes from, and how a scenario link carries every input.

Read Binance's FAQ

Two formulas

MM = Position × Mark × MMR − cumB

Maintenance margin

LP =WB − TMM1 + UPNL1 + cumB − Side × Position × EPPosition × MMR − Side × Position

Liquidation price, one-way mode

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

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