Creating a pool
A v4 Marketplace pool is a new v4 pool created with the hook stack as its hook and up to five v4 hooks in it. It takes one transaction.
The pool key
| Field | Value |
|---|---|
| currency0, currency1 | The pair, sorted by address |
| fee | 0x800000, the dynamic fee flag: the hook stack sets the fee on every swap |
| tickSpacing | 60 in the app, any value in the SDK |
| hooks | The hook stack |
// the hook stack contract is named Dam on chain dam.createDam(key, sqrtPriceX96, baseFeePips, hookIds, configs)
Stack rules
- Up to five v4 hooks, no duplicates, every one active.
- Stack royalty at most 30 bps; each hook keeps the royalty it had when it was stacked.
- Stack gas at most 400,000: each hook's limit, plus 40,000 for a hook that also runs after the swap. Routers can read it from
pools(id).gas.
How hooks compose
If a caller sends too little gas for a hook to run with its full limit, the hook stack refuses the swap rather than record a failed run, so nobody can make an honest hook fail by starving it.
Changing a stack
The pool owner proposes a new stack; it can be applied by anyone 48 hours later. LPs see it on Live swaps and in the hook stack's StackProposed event, and can leave first.