Twinpool
Open a pool
How it works

Fees

gap 0%band 1.5%3%fee: base 0.5% inside the band, +1× the gap beyond it, cap 1% (MONTRA/USDC)

Every Twinpool pool uses a dynamic fee set by the hook in beforeSwap, with OVERRIDE_FEE_FLAG.

Seat mode

When a Seat holder exists, a swap routed through TwinRouter by the holder pays no LP fee. The router passes its own caller as hook data, and the hook trusts only that router to name the trader. Every other swap pays the base fee. There is no gap fee in Seat mode.

Open mode

With no Seat, the fee is:

gap  = |pool − reference| / reference
fee  = base                              if gap ≤ band, or the swap moves away from the reference, or the reference is stale
fee  = min(base + k × (gap − band), cap) if the swap closes the gap (k = 1 on every pool)

Selling token0 lowers the price, so it closes the gap when the pool sits above the reference.

Who gets what

  • Base fees: 100% to LPs.
  • The gap surcharge (the part above the base fee): 80% to LPs, 20% protocol share. The protocol part is taken from the input of exact-input swaps as a hook delta, held as PoolManager claims. On exact-output swaps LPs keep the whole surcharge.
  • Seat rent: 85% to LPs, 15% protocol share.

These shares are constants in the hook (PROTO_GAP_BPS = 2000, PROTO_RENT_BPS = 1500). Where the protocol share goes is on the $TWIN page.

Invariants (tested)

  • The fee never exceeds the cap (1% on every pool; the hook refuses a cap above 1%).
  • The Seat holder never pays LP fee through the router, and nobody else ever swaps fee-free.
  • Rent donated plus rent held for LPs plus the protocol share equals the rent collected.
  • The protocol share never reaches LP principal or rent held for LPs.