02 · The hooks
Floor graduation
Sells cannot cross a price line until people have bought enough.
Floor graduation holds a launch on one side of a price line. Buying with the quote token fills a meter. When the meter hits your target, the line lifts.
What a trader sees
While the launch is open, a sell that would move the pool's price through the line reverts. Buys are allowed, and each buy adds the quote token it spent to the meter. The pool fee is the higher launch fee. When the meter reaches the target, the line goes away, the fee drops to the mature fee, and other people can add or remove liquidity. Before that, only the hook's own seed position can provide liquidity.
If the launch token is currency1, sells push the price up, so the line is a ceiling. If the launch token is currency0, sells push the price down, so the line is a floor. You set the line as the pool's sqrt price.
What you set
- The launch fee, the mature fee, and the quote volume that graduates the pool.
- The price line.
- A seed position. The sponsor funds it and can take it back after graduation. Leave the sponsor empty and it is the controller. When TalosLaunch opens the pool, name a wallet, because that launcher cannot call seed after it returns.
This pool has to be created with a dynamic fee. The hook sets the fee itself.
NextRefill budgetEach wallet has a buy budget that fills back up every block.