02 · The hooks
Decay fee
The buy fee starts high and falls on a clock, whether or not anyone trades.
Decay fee is a launch tax that shrinks with time. Volume does not move it. Price does not move it.
What a trader sees
At initialization the buy fee is the opening fee. It falls in a straight line and reaches the floor after the span you set. After that it stays at the floor. A sell pays the floor the whole time, so leaving is not charged the opening tax.
Opening fee 10%, floor 1%, span 10 blocks. A buy in the first block pays 10%. Halfway through, a buy pays 5.5%. After the span, a buy pays 1%. A sell pays 1% from the start.
What you set
- The opening fee and the floor. The opening fee has to be higher.
- How many blocks the fall takes.
The pool must use a dynamic fee. If another hook in the hub also overrides the fee, the higher number is the one the swap uses.
NextClip sizeOne swap larger than the maximum reverts. It is not shrunk. The next swap can try again.