Integrating with Angstrom L2
Angstrom L2 uses a hub-and-spoke architecture model, with new AngstromL2 hooks deployed via the AngstromL2Factory. See here for more on hook deployment.
On every interaction, the Angstrom L2 hook charges a MEV tax that is proportional to the transaction’s priority fee. The arbitrage auction page provides more details on these taxes. Arbitrageurs, routers, and liquidity frontends all interact with the pool through the standard Uniswap v4 manager; the only additional requirement is accounting for the tax before final settlement.
Swapping
- Set a tax bid: Each swap must fund a tax equal to
priorityFee * SWAP_TAXED_GAS * SWAP_MEV_TAX_FACTOR. Choose your max priority fee so that this amount matches the value you are willing to rebate to the pool. - Quote-aware routing: Use
AngstromL2.getSwapTaxAmount(priorityFee)or replicate the formula off-chain when deciding whether an arbitrage is profitable. - Swap flow: Submit swaps exactly as you would against another v4 pool. The hook escrows the tax in
currency0duringbeforeSwapand settles it alongside the normal swap deltas inafterSwap.
Liquidity Modification
- Each liquidity modification must fund a tax equal to
priorityFee * SWAP_TAXED_GAS * JIT_MEV_TAX_FACTORin native tokens. UseAngstromL2.getJitTaxAmount(priorityFee)to query this amount beforehand or replicate the formula off-chain. - This tax is intended to recapture MEV from Just-In-Time liquidity provision and is ~1.5x larger than the swap tax. Normal LPs should have a zero or near-zero priority fee, resulting in a zero or near-negligible liquidity modification tax.
Pool Deployment
- Pools must specify the native currency as their
currency0so that the hook can appropriately charge priority-fee-based taxes.
Indexing of On-Chain Events
Overviews of hook events and factory events are provided in the Contracts section of the documentation.
For guidance on how to achieve specific goals by indexing these events, see the indexing page.