Coffer Docs
Overview

Virtual Liquidity and Leverage

Pricing depth beyond the pool's real inventory

Virtual balances price trades; actual balances fund payouts. Larger virtual balances make a given trade smaller relative to the curve, reducing its price impact.

Leverage is the virtual-to-actual balance ratio. It creates no borrowing or LP debt. It changes how quickly trades consume real inventory.

A small example

An equal-weight pool holds 1,000 A and 1,000 B. A trader sells 100 A:

ConfigurationVirtual A and BApproximate B received
1×1,000 each90.91
10×10,000 each99.01

Both examples start at the same spot price and exclude fees and rounding. Neither pool can pay more than its real 1,000 B.

Depth comes with a trade-off

More depth lets traders exchange more inventory before the quote moves as far. LP exposure changes faster, and the usable price range can narrow.

The ratio is a live quantity

For virtual balance V_i and LP-owned actual balance A_i > 0:

L_i = V_i / A_i
initial V_i ≈ initial A_i × chosen leverage_i

Swaps change both balances by token amounts, so the ratio changes. Buying a token out can raise its leverage. At A_i = 0, leverage is undefined and that token cannot be paid out.

Proportional deposits and withdrawals scale balances together, subject to rounding. An enabled range manager can also change virtual balances directly.

What the swap formula sees

Selling x units of A for B with fractional weights w_A, w_B, ignoring fees and rounding:

amountOut = V_B × (1 − (V_A / (V_A + x)) ^ (w_A / w_B))

Execution also checks real inventory, sell-off limits and minimum output; see Pricing model.

Read Leverage in Coffer pools explained for an introduction.

On this page