Documentation · 03 / 11
Phases
Bit i of a plugin's phaseMask subscribes it to Phase(i). The ordering is part of the ABI and never changes.
| Bit | Phase | Code | What the plugin sees |
|---|---|---|---|
| 0 | Pre-initialize | PRE·INIT | Runs before Slot0 exists. No price, tick or liquidity yet — only the pool key in Envelopes.Genesis. |
| 1 | Post-initialize | POST·INIT | The pool has a price. The hypervisor seeds the pool's starting fee here. |
| 2 | Pre-add liquidity | PRE·ADD | Position parameters in Envelopes.Liquidity; amounts are zero. |
| 3 | Post-add liquidity | POST·ADD | Same envelope, with the settled amount0 / amount1 deltas. |
| 4 | Pre-remove liquidity | PRE·RMV | Withdrawal intent; amounts are zero. |
| 5 | Post-remove liquidity | POST·RMV | Withdrawal with the settled deltas. |
| 6 | Pre-swap | PRE·SWAP | The only phase whose return matters: the last FEE_BID in rank order sets this swap's fee. |
| 7 | Post-swap | POST·SWAP | Settled swap deltas. Ready JobQueue jobs are drained after this phase, inside a bounded budget. |