02 · The hooks
Milestone unlock
Sells turn on after the first volume target. The fee drops twice.
Milestone unlock opens the market in three stages, driven by how much quote token people have spent buying.
The stages
Stage 0 is the start. Sells revert. The fee is the launch fee. Stage 1 begins when quote volume reaches the first target. Sells work, and the fee becomes the open fee. Stage 2 begins at the second target, and the fee becomes the mature fee. A sell does not add to the volume. A buy adds the quote token it spent, then the stage is checked.
First target 1 quote token, second target 3. Fees 10%, then 1%, then 0.30%. Before any buy, a sell fails. After 1 token of quote has been spent on buys, sells work and the fee is 1%. After 3, the fee is 0.30%.
What you set
- The two volume targets. The second has to be higher than the first.
- The three fees.
The pool must use a dynamic fee. The hook writes the new fee when the stage changes, and it also overrides the fee on each swap so a trade cannot sneak in on the old one.
NextTwap guardA trade fails if the price ends too far from a slow anchor.