The hook layer
How Uniswap v4 hooks could put part of your policy inside the pool itself. Planned, not built.
Status
In development. This page describes the design this product is being built to. Nothing here is live yet, and details may change before launch.
Why a hook
Today every limit is enforced by Xelqor code, after the model answers and before anything reaches your wallet. That works, but it sits off-chain. A hook moves part of the policy to the pool, where it applies to every caller and does not depend on our servers being up.
What a Uniswap v4 hook is
A hook is a smart contract attached to a v4 pool when the pool is created. The pool calls it at defined points: before and after initialising, before and after adding or removing liquidity, and before and after a swap. The hook can run its own checks, and it can reject the action. A hook can also set the swap fee dynamically.
Because the hook is chosen at creation, it only applies to pools created with it. It cannot be attached to an existing pool, and it does not touch v2, v3 or other venues.
What we are exploring
These are directions, not commitments, and the final design may differ.
| Idea | What it would do |
|---|---|
| Size caps | Reject liquidity changes that would push a managed position past the cap in its policy. |
| Pool-level pause | Hold the guard state at the pool, so a pause or kill also stops new liquidity changes there. |
| Volatility-aware fees | Raise the swap fee when volatility spikes, so liquidity providers are paid for the added risk. |
| Readable events | Emit structured events so Lumen can show what happened in a pool. |
What it does not change
- Custody. A hook does not hold your funds and cannot sign for you. Your wallet still approves every action.
- The model. The agent still only proposes. Policy and your signature still decide.
- Coverage. Only pools created with the hook are covered.
Risks of adding a hook
A hook is extra contract code that runs on every swap or liquidity change in its pool. A bug could block activity or misprice fees. Any hook we ship would need an independent audit first, and a clear way to be paused. Nothing is deployed or audited today.
Where it fits
The hook would sit beside the off-chain checks, not replace them. See Policy, limits & approval for the model, and Tide and Keel for the products it is meant to support.