Rival

Every swap is an auction. Sign once, solvers race, and Sepolia proves you beat TWAP.

Rival

Created At

ETHGlobal Mumbai

Project Description

Rival turns every swap into a public auction. You sign one gas-free intent — sell this much tWETH, and take no less than this much tUSDC — and competing solvers race to fill it on Ethereum Sepolia. The order book is Arkiv: wallet-signed, expiring, SQL-queryable entities any solver can read. Solver identity is ENSv2 (rival.eth is live; atlas is registered). Settlement only pays if the fill clears a decaying price curve pegged to a Uniswap v4 TWAP, plus a hard floor the contract always enforces. Permit2 pulls your tokens, the winning solver sources liquidity from the v4 PoolManager, and the fill emits a receipt: amount out, fair-value reference, and improvement in basis points. A live absolute fill is already on Sepolia (0xeadff32d9c91c28bab2c9dc8136c7d1a2ef2c0091085f1a0e2d891645e9500ec). Open the demo, spin up an in-browser wallet, sign an intent, and watch the curve fall.

How it's Made

Solidity and Foundry on Sepolia. RivalOracleHook is a Uniswap v4 hook (permissions afterInitialize and beforeSwap only, flag mask 0x1080). beforeSwap records at most one TWAP observation per block inside try/catch and never reverts the swap; consult and quote expose the mean tick. RivalSettlement prices the intent, then Permit2 permitWitnessTransferFrom pulls the input with the intent hash as the witness. UniswapSolver is the fill callback: the solver account delegates to it, unlocks PoolManager, swaps, settles the input, and takes the output. Solver names sit on an ENSv2 PermissionedRegistry we deployed (non-transferable, 30-day expiry, 100 tUSDC bond); SolverRegistry.isListed reads ownerOf and fails closed. The public book is Arkiv Rabdi via @arkiv-network/sdk 1.0.1: intents (rival.intent.v1) and solver presence (rival.solver.v1). The app is Next.js 15, React 19, Tailwind, and viem, with a decay chart in Recharts. A Hono runner on Fly publishes intents, proxies Arkiv reads (browser CORS), and heartbeats solvers. The notable trick is EIP-7702 delegation: atlas stays an EOA and still runs the solver contract inside the settlement callback.

The production site is still the previous build, and the faucet is empty, so redeploy before judges open that link.

background image mobile

Join the mailing list

Get the latest news and updates