A hook that
prices the risk
A stock token can gap. A liquidity provider who quotes the same fee in a calm market and a violent one is underpaid in the violent one. The Curbstone hook fixes that inside the pool: it reads how far the price moved since the previous swap and charges accordingly.
Two jobs, every swap
Quote the fee
The hook reads the pool tick, compares it with the tick at the previous swap and returns a fee for this swap only. After a quiet spell the memory resets and the pool is back to its base fee. Pools must be created with the dynamic fee flag for this to apply.
Take the protocol fee
On exact input swaps the hook skims a small share of the output and sends it to the Curbstone treasury in the same transaction. Stakers claim their part from there. The hook never holds pool funds and cannot block a swap.
Permissions live in the address
Uniswap v4 reads a hook's permissions from the last bits of its address, so a hook has to be deployed to an address that spells out what it is allowed to do. Curbstone mines a salt until the address carries exactly four permissions: after initialize, before swap, after swap, and the right to take a fee from the swap.