A dynamic-leverage mechanism for synthetic perpetuals.

We propose a mechanism for running a synthetic leveraged market in which the counterparty can never be owed more than it holds. Instead of a payout queue, a margin engine, or a funding rate, leverage is a function of the book. As traders take a larger share of the pool’s backing, their leverage falls, and the liquidity side’s leverage rises by exactly the same amount.

That gives leveraged markets a few emergent properties: no per-trader positions or liquidations, redemption at any time, no IOUs, a mark price that depends only on the oracle and the book, and a market that goes dormant instead of breaking when the underlying collapses.

Who takes the other side?

Leveraged exposure without owning the underlying has existed onchain in several forms. Each answers the same question differently.

  1. BitMEX perpetual swapsFundingIntroduced in 2016. The swap removed expiry and kept the price near spot with a periodic funding payment between longs and shorts, which became the standard way to pay a counterparty to take the other side.
  2. Synthetix pooled debtPooled debtUsers mint synthetic assets against staked collateral. Stakers share one debt pool, so they collectively take the other side of every trader.
  3. GMX and GLPShared poolTraders are routed against a shared liquidity pool. Liquidity providers earn fees and are exposed to trader profit and loss.
  4. Index-style leveraged tokensRebalancingHolders get a fixed multiple of the daily move through periodic rebalancing, with no positions to manage.
  5. Papertrade martingaler queuePayout queueSynthetic swaps run against a pool that starts at zero. Winners the pool cannot pay immediately enter a first-in-first-out payout queue, paid from later losses.

Despite that progress, several limitations persist.

Need for a counterparty

Someone has to take the short side. Funding rates attract hedgers who already hold the underlying, but bring complexity and a persistent cost to the trader.

Insolvency exposure

A pool that lets winners claim more than it holds is insolvent. Systems that allow this need a queue, an insurance fund, or socialized losses.

Position machinery

Per-trader margin, maintenance levels and liquidations need keepers. They fail in fast markets.

Oracle gaps

A mark advanced one oracle update at a time can be stepped past its own safety checks. If the gap between two updates is large, the step can overshoot.

Make leverage a function of the book.

Leverage is not stored. It is computed from the book whenever it is needed. Market creators specify a maximum leverage Lmax, an oracle and its freshness rules, a dormancy floor P_min, and swap, mint and redeem fees. They do not have to deal with funding rates, per-trader positions, margin calls or liquidations, a payout queue, or insurance funds and socialized losses.

The book

The market has two sides. Traders hold a fungible token, the synth. Liquidity providers deposit quote-currency backing and receive shares. Tokens held by the pool itself are inventory and are not claims, so by construction T + LPE = Y.

Y   = backing        (quote currency held for the market)
X   = trader tokens  (synth held by traders, not by the pool)
P   = mark price of one synth
T   = X * P          (trader claim)
LPE = Y - T          (liquidity-provider equity)
s   = T / Y          (trader share of the book)

The leverage budget

The leverage of each side is a share of one fixed budget. At s = 0 the traders are tiny relative to backing and get the full Lmax. At parity each side has half. As s approaches 1, long leverage approaches 0.

L_long  = Lmax * (1 - s)
L_short = Lmax * s
L_long + L_short = Lmax
L_long + L_short = Lmax
Liquidity providers 75% Traders 25%
Long leverage, Lmax × (1 − s)3.75×
Short (LP) leverage, Lmax × s1.25×

The side holding the larger share of the book has the lower leverage. A 99/1 book can never owe a gain it does not hold.

s (trader share of backing)Long leverageShort (LP) leverage
0.005.000.00
0.104.500.50
0.253.751.25
0.502.502.50
0.751.253.75
0.900.504.50
1.000.005.00

The mark price

Between trades the book is fixed. Trader claim moves as dT = L_long × T × d ln S, where S is the oracle price. Integrating gives the closed form below. (S0, P0, X0, Y0) is an anchor, written only when the book changes (a buy, a sell, or a backing deposit or withdrawal) and optionally by a permissionless call. The mark is evaluated in log space, so there is no precision cliff and no floor value that cannot be left.

T / (Y - T)  =  (T0 / LPE0) * (S / S0)^Lmax

P(S) = P0 * Y * R / (LPE0 + T0 * R),     R = (S / S0)^Lmax

with no traders:  P(S) = P0 * R
  • T < Y for any finite oracle price, so liquidity-provider equity does not reach zero from a rally.
  • The mark is path independent in the oracle. Down 10% then back up restores the mark while the book is unchanged.
  • An unsynced gap in the oracle gives the same mark as the fine-grained path.
  • If Y = 0 the mark is frozen. If X = 0 and Y > 0, leverage is Lmax.
Starts on example 3.1
Closed form, the paper’s mark Linear step, the counterfactual
Mark, closed form$564.71
Mark, linear step$866.67
Trader claim$14,11894.1% of backing
LP equity$882Long leverage now 0.29×

T stays below Y for any finite oracle price, so LP equity does not reach zero from a rally. The mark depends only on the live oracle and the anchor, so down 10% then back up restores it while the book is unchanged. Illustrative.

The solvency invariant

The invariant is not a ratio to tune. It is structural. Traders can sell at any time and are paid X_sold × P from backing. No queue is needed because the claim is capped below backing by the leverage budget. A trader’s upside is bounded, and the cost of that bound is that long leverage falls when longs are crowded.

T < Y      for every finite oracle price

Dormancy

If the underlying collapses, the mark falls geometrically (about S^Lmax for a small book) but never reaches zero. The market stops accepting new buys when the mark falls below a floor. Sells and liquidity withdrawals are never gated. When the oracle recovers, the market wakes on its own. If liquidity providers left while traders stayed, the book is thinner and wakes at a lower mark than the start. With no change to the book it returns to the start mark exactly.

P_min = max(1, startMark / 1_000_000)

Reaching P_min at 5× needs a drop of about 94% in the underlying. Reaching a 1 wei mark needs about 99.975%.

Tracked backing

Y is tracked by the contract and not read from its token balance. A plain token transfer into the contract cannot be reverted, so it is treated as excess, not backing, and cannot move the mark or leverage. The owner can sweep the excess. X is read from the anchor, not from live balances, because balances move while a swap is in flight.

Liquidity-provider incentives

There are no token emissions and no funding rate. Liquidity providers earn swap, mint and redeem fees, and carry the opposite side of the trader’s exposure. Their expected return is positive if traders lose more than they win, net of fees. Solvency does not depend on that. Only LP returns do.

Four simulations, all at Lmax = 5.

3.1 A rally on a thin book

LPs deposit 10,000. A trader buys 5,000 of the synth at a mark of 200, receiving 25 tokens. The underlying doubles.

T / (Y - T) = (5,000 / 10,000) * 2^5 = 16
Y = 15,000   =>   T = 15,000 * 16 / 17 = 14,117.65
mark = 14,117.65 / 25 = 564.71
LP equity = 882.35
long leverage = 5 * (1 - 0.9412) = 0.29

A linear step would have paid the trader the whole 15,000 backing and left no equity. The budget model caps the claim below backing, keeps LP equity positive, and lowers the trader’s leverage along the way. Buys, sells and withdrawals all stay open.

3.2 Halving and doubling a balanced book

LPs and traders each hold half the backing (T0 = LPE0).

Underlying halves:   T / (Y - T) = 0.5^5 = 0.03125   =>   T = 0.0303 Y
Underlying doubles:  T / (Y - T) = 2^5   = 32        =>   T = 0.9697 Y

The trader can lose almost all of their claim, but the pool never owes more than Y, and in the doubling case the trader’s claim approaches Y without reaching it.

3.3 The unsynced crash

A market has a mark of 1.0 and about 15% of backing held by traders, so leverage is about 4.23×. The oracle falls 36% between two updates with nobody updating the mark.

Linear step:  1 + 4.23 * (-0.36) = -0.52      (a negative price)
Closed form:  mark = 0.0615

A linear step projects a negative price. A floor then rounds it to 1 wei, and a $2 buy mints about 1.994 × 10^18 tokens. The closed form gives a mark of 0.0615, so the same $2 buy mints about 32 tokens.

3.4 Simulation

We simulated the closed-form mark over 2,000 independent paths of 1,000 steps each. Each step the oracle moves by a normal return with a 3% standard deviation, plus a 1% chance of an additional jump with a 20% standard deviation. On about half of the steps a trade occurs: a buy of up to 5% of backing (55%), or a sell of up to half of the trader tokens. Backing starts at 100,000.

ResultValue
Steps with a trader claim above backing0
Highest trader claim / backing at any step0.996
Paths that touched the dormancy floor25 of 2,000
Median lowest mark across paths0.016 (start 1.0)
Steps where a linear update would give a price at or below zero4,051 (1,308 paths)
Steps where a linear update would put the claim above backing172 (75 paths)

The linear-update rows are a counterfactual on the same book and the same oracle gap. This is a Python model of the closed form, not the contract. The contract is covered separately by unit, fuzz and invariant tests.

Dynamic leverage versus a payout queue.

A strong motivation for this mechanism is to remove the cost of insolvency from the trader. A payout queue lets traders win more than the pool holds and delays payment until later losses refill it. That removes the need for seed capital. The cost is that a winner’s payout depends on other users losing, and that winners tend to win at the same time in a market that moves in one direction.

Dynamic leverage makes the opposite choice. It keeps the pool solvent by lowering the leverage of the side that is crowding the book, so winners are paid in full and at once. The cost is that liquidity providers must deposit backing before the market opens, and that a trader’s gain is bounded by the leverage budget.

We do not claim one is better for every market. A queue suits a market where seed capital is the binding constraint. Dynamic leverage suits a market where immediate redemption and a bounded counterparty are the product. Short-side liquidity is attracted by giving it short exposure to the market, with the added upside of earning fees from long orders.

What it does not do.

  • Capital required. The market needs backing before it opens. It does not bootstrap from zero.
  • Convexity. Lmax is a cap, not a constant. The mark compounds continuously, so for a small book a 10% rise at 5× gives about 1.61×, not 1.5×.
  • Oracle dependence. The mark is only as good as the oracle. Stale or paused oracles stop swaps and liquidity operations, and lenses fall back to the anchored mark.
  • Thin-book recovery. If liquidity providers withdraw while traders stay, the market wakes below its start mark.
  • Counterparty returns. Liquidity-provider profit depends on traders losing more than they win, net of fees.