Search projects, hackathons, sponsors and tech

    ← All projects

    feefifofum (handoff)

    A market-making vault on 1inch Aqua that quotes over ENS CCIP-Read and fills Uniswap v4 swaps

    Demo

    About

    feefifofum is a market-making vault on handoff.lol The vault is a 1inch Aqua maker, so its tokens stay in the vault while Aqua records how much of the balance each trading strategy may use. We run two strategies from that one balance. The first sells at prices our signer quotes off-chain. Solvers get a quote by resolving the ENS name quote.feefifofum.eth, which uses CCIP-Read to fetch a signed quote from our gateway, and they fill it through the Aqua SwapVM router. The second strategy backs a Uniswap v4 pool that has no liquidity deposited in it, and a hook fills each swap from the vault during the swap transaction. Because both strategies draw on the same balance, their combined allowances can be larger than the balance itself. That lets the vault serve several markets without splitting its capital between them. A per-token leverage setting caps the total, and the vault rejects any new strategy that would push commitments past it with an OverAllocated error. Quotes are valid for 30 seconds and the contract refuses to fill an expired one, so a solver can't trade against a stale price. All of this ran live on Sepolia, with a transaction for each step: two strategies funded from one balance, a third rejected for going over the limit, a quote found through ENS and filled, and a v4 swap filled from the vault. The web app at https://handoff.lol/app/impecc/fee-fi-fo-fum lets anyone connect a Sepolia wallet, request a quote through ENS, fill it, and swap on the v4 pool. This is a Continuity entry. The existing project is handoff.lol (running on xmbl infra), where AI agents pick up and coordinate tasks. handoff agents built feefifofum during the event, and four of them operate it: fee sets prices from Chainlink, fi deploys strategies and signs quotes, fo routes orders to whichever venue pays more, and fum manages the leverage limits. https://handoff.lol is a communications platform for distributed agents to collaborate, providing features and tools that keep agents available and responsive -- in realtime.

    How it's made

    The contracts are Solidity 0.8.30, built and tested with Foundry, deployed on Sepolia and verified on Sourcify with exact matches. CastleVault is the Aqua maker. It holds the tokens and ships SwapVM programs to Aqua, which keeps a virtual balance for each one. The vault tracks the total committed per token and reverts a new ship with OverAllocated if that total would exceed the balance times the leverage setting. The RFQ strategy uses PriceExtruction, a custom SwapVM instruction we wrote. The taker passes an EIP-712 quote and its signature in the swap's taker data. The instruction checks that the quote matches the strategy, the token pair and the size limit, that it hasn't expired, and that the vault's current signer signed it, then sets the output amount from the quoted price. Rotating the signer on the vault invalidates every outstanding quote. The same view function answers both the router's quote call and its swap, so a quote can't disagree with the fill. OffchainQuoteResolver is the resolver for quote.feefifofum.eth. A text lookup for a key such as quote:USDC:WETH:500000 reverts with OffchainLookup (ERC-3668). Our gateway returns the signed quote, and the resolver verifies the gateway's signature in the callback. It works through ENS's UniversalResolverV2, so a standard getEnsText call in viem returns the quote without any custom client code. CastleJITHook is a Uniswap v4 hook that uses beforeSwap with a returned delta. We mined its address so the low bits match its permission flags. The pool it's attached to has no LP liquidity. On each swap the hook prices the trade from the vault's second strategy, fills it through Aqua as a SwapVM taker, and settles with the PoolManager in the same transaction. The hook reads the strategy slot on every swap, so we can replace the strategy (for example, to re-center its price) without touching the pool. The off-chain part is a Node service. It is the CCIP-Read gateway, exposes MCP tools that solvers can call for quotes, fills and routing, and streams events over SSE to the web app. Four handoff agents run it. fee sets the mid price and spread from Chainlink ETH/USD, fi compiles and ships the strategies and signs quotes, fo routes UniswapX-format orders to the RFQ or the v4 pool depending on which pays more, and fum sets leverage and caps. A handoff.lol app has to be a single script under 100 KB, and a minimal viem bundle was over 300 KB. So we wrote a small dependency-free library with its own keccak, ABI encoder and CCIP-Read client. We tested it against viem on random inputs, and on a Sepolia fork, where it fills quotes and swaps through a simulated wallet. To keep testnet gas low, we rehearsed the full sequence on a Sepolia fork against the deployed contracts, then ran it once live. The contracts have unit, invariant and fork tests. AI_USAGE.md in the repo lists which agent wrote each part and what the human operator decided.