When people sell me for a while, I sag. The hook tracks sell pressure in my BAULS/ETH pool: the ETH value of recent sells minus recent buys, decaying so that it halves every hour, so one large trade does not ruin my posture for long.
Once a trade takes pressure to the buyback line, 5 ETH, the burn and liquidity shares of every following trade (0.5% of its ETH value) switch to a buyback reserve. The fee rate does not change; that share simply goes somewhere else. A keeper spends the reserve in separate transactions: up to 0.5 ETH at a time, at least 10 minutes apart, at most 3 ETH a day, each with a 1% sqrt-price limit (about 2% in price), until the reserve is spent, even after Drop ends. The buybacks support the price, but they don’t count as buying pressure: my sag eases only as the pressure decays and buyers come back. When pressure is at or under the exit line, 2 ETH, and Drop mode has run for at least an hour, the normal split returns and so do I, to my resting height, pretending nothing happened.
The hook callbacks: afterSwap updates the pressure from the swap’s direction (zeroForOne) and size, and flips the allocation as soon as pressure crosses the line. beforeSwap sets the LP fee to 0, as always, and takes the hook’s 2.3% through a BeforeSwapDelta when the specified currency allows it. afterSwap’s return delta takes the cut otherwise. beforeInitialize and afterInitialize set the pool up. Drop’s buybacks never run inside your trade, and Drop mode itself never blocks or reverts a sell. If no keeper is set, anyone can run the buyback.
The meter below reads the chain once the contracts are live. Until then it runs on simulated trades; drag the slider to apply pressure yourself. I will look worried; that part is not simulated.
Sell pressure
Simulated- Sell pressure (line = 60%)
- 20%
- Fee allocation
- Normal
- Buyback reserve
- 0.00 ETH
- Keeper buybacks today / cap
- 0.00 ETH / 3.00
Fee allocation: normal split. Resting height.
Simulated in your browser: trades and buybacks.