Keel

Uniswap v4 hook that charges arbitrageurs more on tokenized-stock pools, priced by Chainlink CRE

Keel

Created At

ETHGlobal Mumbai

Project Description

Keel is a Uniswap v4 hook for tokenized-stock / USDC pools. A Chainlink CRE workflow publishes the real stock price on-chain, and the hook compares it to the pool price on every swap. If a swap pushes the pool back toward the real price (an arbitrage trade), the fee rises to half the net deviation, capped at 2%. Every other swap pays the pool's normal base fee, and if the reference price is stale or the market is closed the hook falls back to the base fee, so normal users are never charged extra because data is missing. The idea is to claw back some of the value LPs lose to arbitrageurs when stock prices move while the pool lags. We tested it by replaying 60 days of real swaps from Ondo token pools on Ethereum: about 1.3% of swaps under $1k were surcharged and LP P&L improved by roughly 5.5% ($2,069 on $8.7M of volume). That is a protective rule, not a profit engine. It runs on Arc Testnet with test tokens and a simulated arbitrageur. Nothing in the demo is a real stock.

How it's Made

The hook is a Solidity Uniswap v4 hook (Foundry) that only uses beforeSwap and returns a per-swap dynamic fee override. It reads the pool price from the PoolManager and the reference price from a RefPriceOracle contract that accepts reports only from a Chainlink forwarder, so the hook trusts nothing else. The price comes from a Chainlink CRE workflow: a cron trigger, an HTTP fetch of the stock price run on each node with consensus, and an encoded report written to the oracle. On our testnet deployment the forwarder is a mock one, since we ran the workflow in simulation. The fee rule uses k = 1/2, derived from maximising LP fee revenue, plus a deadband based on the stock's measured volatility times the square root of the reference age. The hook address is mined with CREATE2 to match the hook flags. The dashboard is Vite, React, wagmi and viem, deployed on Vercel, and reads FeeSet events straight from the chain. The backtest is Python and replays real Ondo-token swaps against the rule with Yahoo 5-minute bars as the reference price.

background image mobile

Join the mailing list

Get the latest news and updates