Chapter 06
The vault
Each token has exactly one vault and each vault serves exactly one token. It is the smallest contract in the system and the one that carries the protocol's only real promise: that the fee a token's own trading produces is spent on that token and on nothing else.
What a vault is
An address holding ETH, a reference to its token, and a reference to the Uniswap router. It is deployed by the factory in the same transaction as the token, and its token reference is immutable — a vault cannot be pointed at a different market later.
- Holds
- ETH only. It never holds its own token except mid-transaction.
- Receives from
- The trade router, and anyone who sends ETH to it directly
- Spends on
- The token's own Uniswap V2 pair
- Sends to
- The burn address, in the same transaction
- Owner
- None with a withdrawal path
Vaults are not pooled. Heavy trading in one token does nothing for the holders of another, and there is no treasury that redistributes between them. Anyone can also send ETH to a vault directly, which is the only way one fills when nobody is trading.
Buyback and burn
function buybackAndBurn(uint256 amountIn, uint256 minOut)
external
returns (uint256 burned);The call swaps amountIn of the vault's ETH for the token on its own pair, requires at least minOut tokens back, and transfers everything received to the burn address within the same transaction. The tokens are never held by the vault across blocks and there is no path by which they reach a person.
Who decides when
Anyone. The function is permissionless, and whoever calls it pays the gas and receives nothing for it beyond the effect on a token they may hold. There is no keeper service behind this protocol and no schedule to trust — the interface puts a button on the token's page, and anybody who wants the burn to happen makes it happen. Calling it on a dust balance costs more gas than it removes from supply, so in practice people wait for a vault worth emptying.
- Timing is discretionary. Nothing forces a buyback to happen at any particular price or on any particular day.
- A buyback moves the price it executes at. It is a market buy into a constant-product pool; the ETH spent walks up the curve like anyone else's.
- It is front-runnable. The transaction is public before it lands.
minOutbounds the damage to the vault; it cannot stop somebody trading ahead of it.
What it cannot do
- It cannot pay a holder, a creator, or the protocol.
- It cannot send ETH to an address chosen by the caller.
- It cannot buy a token other than its own.
- It cannot be upgraded, re-pointed, or drained by an admin key, because it has none.
The corollary is worth stating: if a pair has no liquidity, vault ETH has nowhere useful to go, and it sits there. That is a real failure mode, not a hypothetical one, and it is covered in /docs/risks.