On-chain module
LP Stream
Each buy sets aside a share of the tokens it receives and donates it to the liquidity in range, on top of the swap fee. LPs earn more from demand without a separate farm.
Compose with LP Stream On-chain module · in RuleCraftHook (unaudited)
Callbacks
2
Swap gas
~140k
estimate
Touches
buy · lp
Pools
--
see Pools page
How it behaves
- 1afterSwap takes the stream share from the tokens the buyer receives, using afterSwapReturnDelta.
- 2It donates them to in-range positions through the PoolManager in the same call. Royalty and protocol share come out of this amount first.
- 3Positions out of range earn nothing from the stream, just as with fees.
Parameters
| Parameter | Min | Default | Max | What it does |
|---|---|---|---|---|
| Stream share | 0.1 % | 1 % | 3 % | Share of each buy's token output donated to in-range LPs. |
Bounds are enforced on chain by the registry, the launcher and the hook. Values are frozen when the pool is created.
Permission bits
13BI
12AI
11BA
10AA
9BR
8AR
7BS
6AS
5BD
4AD
3BSΔ
2ASΔ
1AAΔ
0ARΔ
AS afterSwap · ASΔ afterSwapReturnDelta
mask 0x0044bits 000000010001002/14 on can change amounts
- afterSwapSwapRuns after every swap with the final amounts. Reacts to trades: burns, pots, reward accounting.
- afterSwapReturnDeltaDeltaLets afterSwap take a cut of the output. The hook can change what you receive. Taxes and burns live here.