
Tide
A Partially Active AMM that hides most of its inventory from arbitrage bots every block.
Demo
About
Every constant-product pool leaks money to arbitrage: the first trader of each block is a bot that trades the whole pool to the new price, and liquidity providers pay for it. Uniswap LPs lose an estimated several hundred million dollars a year this way, which is why passive liquidity keeps thinning out. Tide is a partially active AMM (PA-AMM) built on the recent "activeness" research. Each block it exposes only a fraction λ of a maker's inventory to the first trade, so the bot reaches a slice instead of the vault. Every later trade in the block is quoted on a curve N times deeper, inside a tight drift band δ, so ordinary traders get better prices than the plain pool while the maker's loss to arbitrage drops by a third at λ = 0.5. A flat fee backs the deep curve; the contracts enforce (N − 1)·δ ≤ 2·fee, so the deep curve can never be farmed. For a deeper dive, please check out the whitepaper at https://tide-amm.vercel.app/WHITEPAPER.pdf For LPs it is a strategy layer: you name it on ENS, choose how much to show per block, ship, and keep custody. A manager agent watches realised volatility and retunes λ, N and δ on its own inside guardrails you set on-chain; anything outside them needs your fresh World ID sign-in and your wallet. Traders get a routing terminal that quotes every live Tide strategy and fills through the best one. Live on Sepolia: two venues sharing one math library, five public strategies, reusable templates, a whitepaper with the proofs, and 54 tests. The business case is simple: less leakage per dollar of liquidity means LPs can quote tighter or earn more, and any protocol launching a pair can plug Tide in as a hook or an Aqua program instead of building its own market maker.
How it's made
One Solidity library, TideMath, holds the active split, the N-scaled quote, the drift guard, the solvency bound and the fee arithmetic. It is checked against a Python reference on 24 vectors and imported by two venues, so a cross-venue test asserts identical fills: 1inch Aqua. Tide is a SwapVM program of three custom opcodes in unallocated slots (ACTIVE_SPLIT, VIRTUAL_XYC, BUFFER_GUARD) on a redeployed router from the hackathon template. Each opcode scans the program and reverts unless the three appear once, in order, so nothing can jump around the guard. The maker's tokens never leave the wallet; Aqua pulls at fill time. A TideTaker contract builds taker traits on-chain so a wallet can quote and fill in one call. SwapVM has no block hook, so the re-split is lazy: it runs inside the first quote of a new block and is persisted by the first fill. Uniswap v4. The same steps inside beforeSwap of a BaseCustomCurve hook returning a BeforeSwapDelta for the whole amount, reserves as ERC-6909 claims, pro-rata shares, and liquidity changes refused in any block that already saw a swap. The hook claims its pool id in TideParams at initialize, so nobody can squat a predictable key. ENS v2 on Sepolia. Each strategy is a subname of tide.eth whose text records are the parameters; nothing is hard-coded. The manager agent has its own name, manager.tide.eth, with a resolver role scoped to exactly the lambda, N and delta records, revocable per record. TideParams mirrors the records on-chain with owner guardrails (λ range, max step, max depth, cooldown) that bind the manager but not the owner. World ID for Agents. Changes outside the guardrails require a fresh authentication (prompt=login, max_age=0); the backend validates the ID token, pins the issuer, and matches the pairwise subject to the one bound to the owner's wallet by a signed message. Denied, expired, replayed and forged responses leave state unchanged, and a harness asserts each path. The app is Next.js with wagmi and RainbowKit, MongoDB for the agent's working memory, Coinbase candles with fills marked on them, an impact curve from live reserves, and a trade terminal that ranks every funded strategy by quote. Hackiest bits: the fee-rebate bound came out of a review where we drained our own deep curve with a zero-fee round trip and had to prove the fix; the manager's clock on Vercel is traffic plus a GitHub Actions schedule because there is no long-lived process; and the World sandbox refuses http callbacks, so local dev runs on mkcert HTTPS. Whitepaper at https://tide-amm.vercel.app/WHITEPAPER.pdf