ApexYieldHookV4
BaseRegisteredOracle-based swap hook that prices trades using Pyth and Chainlink feeds and executes them against an external vault (IApexVault) by returning a BeforeSwapDelta in beforeSwap. Applies zone-based dynamic fees, enforces vault liquidity checks, and includes an owner-triggered circuit breaker that halts swaps when oracle prices move too rapidly.
What it can do
Its code executes inside each trade in pools that use it.
It can take or add tokens during a swap. Fees, burns and custom curves work this way, and so do scams.
Pools using it let the hook choose the swap fee instead of a fixed tier.
It runs before liquidity is removed, so it can delay or refuse LP exits.
It can change what LPs get back when they remove liquidity.
It checks every deposit before it goes in.
It runs when a pool is created, often to lock in that pool’s settings.
It runs when someone donates tokens to the pool’s LPs.