The F-pool
Fungible. One floor shared by every share, bases against one quote.
Give every share the same floor. Claims are then homogeneous — every unit interchangeable — and the floor-translation identity does the whole accounting.
We write and for the multi-asset weighted average log-price and log-floor.
For one base these reduce to and . The lens exposes them as compositeX and
logFloor; see Notation.
The floor is the fee accumulator
A fee accrues to all shares at once as , so
It is not stored but derived, , from reserves on every read. Accrual is denomination-blind: a quote fee lands in at fixed ; an in-kind base fee marks the derived index down by its value per unit . Base-for-base charges — both legs were repriced — which makes fees route-invariant.
This removes the fee-growth accumulator, the per-tick snapshots, the per-holder fee slots and the collect-swap-remint cycle; only a harvest's payout is settled per holder. Fees remain invested without a separate compounding transaction.
The floor has one lever
Raising at fixed and leaves untouched and releases in pure
quote — price-neutral, pro rata, no base sold. The pool simply stops bidding below the new floor.
That is harvest, the operator's one lever; nothing puts quote back under a live generation — only
fee income lowers the floor, and a deeper bid is a relaunch (below).
| direction | effect |
|---|---|
| fees accrue, | quote deployed as deeper bid; share value rises |
| harvest, | the deepened bid converted back to extractable quote, pro rata |
So harvest is the exact mirror of accrual, and restoring the floor to pays out precisely — the fees earned, to the wei, with no accumulator ever having been written.
A harvest is a dividend to every share: each holder's part is settled lazily on their next
transfer, mint or burn, and the operator's own is pushed at once. How far it may go is the pool's
policy: on a pad the harvest returns the floor to the reference floor and never
past it, so only income can leave; a POL keeps a quote buffer the protocol sets (keepQuote
of , zero unless set); a private or public pool may take the bid to zero. A harvest
takes no protocol cut. At
the pool holds no quote and has no bid — the state a relaunch starts from (see
Generations).
The mark is not writable
is derived from reserves and moved only by trades, so no balance-sheet operation lowers the ask. Within this design there is no path by which an operator lowers the floor and then buys the book — which is the property that makes a pool safe to hand to a creator at all.
Re-marking upward is not free either. Refilling while the floor sits a gap below the mark costs
quadratic in the gap and independent of refill depth.
Fee income deepens the floor
Because , every swap that touches the pool pushes the floor down by . Volume deepens the bid with no new mechanism and no new capital. The one case the mechanism cannot reach is price sitting at the floor in a falling market — no bid, so no trades, so no fees, so no deepening. That is a floored position that got filled on the way down: the risk the LP chose, not a defect to engineer away.
Four policies, one contract
The basket and the launch are the same contract. What separates the products is the pool's
policy: the contract its key names at birth, which the manager asks every question it does not
decide itself — who may seed, harvest, retire or reshape, whether a taker may swap, the terms of
every harvest. The policy also says what the pool is, through kind(): "public",
"private", "pol" or "pad". There is no kind in the key and none on the manager; the policy
is the kind, and nothing in the mathematics distinguishes the products.
| public | private | POL | pad | |
|---|---|---|---|---|
| what it is | the protocol's own pool | a desk | a treasury's pool | a launch |
| creator | the protocol's fee collector | a desk, market maker or foundation | a treasury or governance | a token creator |
| bases | 1 to 8 | 1 to 8 | one | one |
| gates, lists, operator | — | yes | — | — |
| composition | fixed | editable between generations | fixed | fixed |
| harvest | to an empty bid | to an empty bid | down to the keepQuote buffer | income only |
| the seed's shares | the seeder's | the seeder's | the seeder's | minted to 0xdead |
retire | at an empty bid | at an empty bid | at an empty bid | refused: a pad never retires |
regenerate | refused | the authority carried | the authority carried | the graduation: 0xdead carried |
Private → POL → pad is a ladder of rigidity: a POL is a private pool without the desk and the
gates; a pad is a POL with two locks, the seed burned at birth and a harvest of income only. A
public pool is a POL born to the protocol. A policy must be approved in the protocol's
PolicyRegistry before a pool can be born under it, and the class is fixed for the pool's life.
The basket (, public or private) is inventory as one share: auto-rebalanced to constant value weights (), any leg pullable by base-to-base without quote and without touching the floor, single-sided entry and exit by zap. It is workable lending collateral, since is affine in — so liquidation is a tick on the index. See Basket holder.
The launch (a pad) sells the floor itself: a bid that is structural rather than promised, deepening from fee income, which the creator can harvest only up to the income earned — and that income banks as a pot released only at a graduation: the creator's share, the protocol's, a buyback of the token, and the rest deepening the bid. See Token creator.
A capped pool sets a cap in its key: the pool sells its whole inventory between the floor
and a cap price times the floor, so it works its capital times
harder at the floor ( puts the cap at twice the floor). Every price reads a phantom
reserve per leg; only real tokens move (decision 061, specs/f-pools/capped.md).
Who runs the pool
- The creator is who the pool was born to: the key's
creator, and its first authority. - The authority owns the pool: it seeds each generation, names it, and hands itself over in
two steps (
proposeAuthority/acceptAuthority, on the policy). On a private pool it also works the desk:setGatesturns the mint and swap gates on or off, and two lists say who may mint and swap (setMinters) and who may only swap (setTakers). - The operator runs the pool:
harvest,retire,regenerateand, on a private pool,setLegs. It is the authority unless a private pool appoints one (appointOperator, thenacceptOperator), and a handover of the authority voids it.
Every operator action closes the swap for the rest of its block. A governance contract can sit in any slot; nothing about the surface assumes an EOA.
A harvest is price-neutral and pro rata — it moves no base, changes no price, and pays each holder exactly their share, so there is no value to steal and the flash-loan-to-drain shape does not apply. What an operator can force is a policy, not a transfer: strip the pool's downside bid and leave the next seller facing a thin book. Real, but bounded, and borne pro rata by every share.
Generations
Every share id carries the pool's generation. Two operator entries close one generation and open the next, and neither moves the price or the floor.
retireis the boundary. At an empty bid () it freezes the whole generation into a bundle that every share redeems pro rata, forever. The authority thenseeds the next generation — with a new composition if a private pool's operatorsetLegsin between. A pad refuses it: a pad sold back to its floor stays live, trades, earns and can graduate again.regenerateis the generation step. It harvests the generation's income, then the policy names one holder to carry into the next generation. That holder and0xdeadgo on; every other holder is frozen out pro rata into the old generation's bundle, at the marks, keeping the dividend it earned. On a pad this is the graduation:0xdeadis carried, the pot is released, and the reference floor resets. A POL or a private pool carries its authority. A public pool refuses it, because its outside LPs are the pool.
A holder frozen out redeems in kind (redeem) or rolls its claim into the live generation through
the router (rollIn).
Market identity and surface
struct PoolKeyF {
address quote;
address[] bases; // sorted, unique asset table
uint256 swapFee; // fixed swap fee, WAD
address policy;
address creator;
bytes32 salt;
uint256 mintFee; // fixed mint fee, WAD
}initialize(key) returns the poolId, keccak256(abi.encode(key)); anyone may call it, and the
policy checks the rest of the key (the fee's range and tier, a listed quote, one base on a POL or
a pad, a zero salt on a public pool).
seed is the authority's and opens a generation.
// trade — `taker` is who the caller trades for, checked on a gated pool
swapQuoteIn(poolId, j, amountIn, minOut, taker)
swapBaseIn(poolId, j, amountIn, minOut, taker)
swapBaseForBase(poolId, j, k, amountIn, minOut, taker) // ΔQ = 0, crosses nothing
// enter and exit
mint(poolId, to, dL, maxQuoteIn) burn(poolId, owner, shares, minQuoteOut)
router.zapIn(poolId, dL, maxQuoteIn, minShares, to, deadline)
router.zapOut(poolId, shares, tokenOut, minOut, to, deadline)
claim(poolId, gen, to) // a settled dividend
// the operator: the authority by default, or appointed on a private pool
harvest(poolId, amount, to) regenerate(poolId, to) retire(poolId)
setLegs(poolId, weights[], newBases[]) // private only, between generations
// the authority
seed(poolId, L0, r0[], Q0)
// on the pool's policy
proposeAuthority / acceptAuthority setName
appointOperator / acceptOperator setGates setMinters setTakers // private only
// generations
redeem(poolId, gen, owner, shares)
router.rollIn(poolId, gen, shares, dL, maxQuoteIn, minShares, to, deadline)
// a lien, for lending: the locker locks an owner's shares in place
lock(id, owner, amount) unlock(id, owner, amount, to) // to = owner: release; else seizure
// reads — everything is derived, read through the lens (on chain: PoolStateF over extsload)
lens.pool(poolId) // the pool, logFloor, compositeX, unharvested, every leg with its virtual reserve
lens.bundleOf(poolId, gen) lens.dividendOf(poolId, gen, holder) lens.lienOf(id, owner)unharvested is the generation's income still in the pool, , and
the pool carries , accrued in one slot. Together they are the point of the design: the
fee earned and the model-free edge are computable by anyone, on-chain, without
any fee accounting having existed.
Fee policy
The F-pool ships a fixed with a computable kernel: is constant, but accrues anyway — one slot, one add per touched leg — so the fee the dynamic kernel would quote, and the edge, stay computable by anyone.
Mathematically, it is the degenerate C-pool
One class, one floor. The same specification covers both, and the F-pool introduces no new invariant.
That is why ManagerF is also a singleton: every fungible pool in one contract, with its own
flash-accounting lock.