02 · The hooks
Stabilizer rebate
A repeated direction pays into a pot. The opposite trade can claim it back.
The stabilizer notices when trades keep pushing the same way. The second push, inside a short window, pays extra. A trade the other way can take from that pot.
What a trader sees
The first trade in a direction, or the first trade after the window has gone quiet, pays nothing extra. Another trade the same way before the window closes pays a surcharge on the tokens it receives. That surcharge sits in a pot for that direction. A trade the other way accrues a rebate in the token it is spending, up to the rebate rate on that input, and never more than the pot. The trader claims the rebate in a separate call. The claim pays the token that was spent, not an extra bag of the output.
The window is 5 blocks and the surcharge is 10%. Two sells close together: the first is free, the second pays 10% of its output into the pot. A buy inside that window can then accrue a rebate from the pot, up to the rebate rate you set and never more than the pot.
What you set
- The surcharge rate and the rebate rate.
- How many blocks count as "still the same burst."
Good to know
The rebate is not paid inside the swap. It is written to the trader and claimed later. The tokens sit on this contract, including when the pool's hook is the hub.
NextFloor graduationSells cannot cross a price line until people have bought enough.