Cleverly Using Money

Anonymous shared liquidity on 1inch Aqua: private LP notes, real yield, sandwich-resistant curves

Cleverly Using Money

Created At

ETHGlobal Mumbai

Project Description

Cleverly Using Money lets LPs earn on their liquidity without revealing which position is theirs. Money in a privacy pool normally sits idle, and using it in DeFi means withdrawing and giving up anonymity.

LPs deposit into a zero-knowledge vault and receive a private note. Every note is exactly one share of the vault, so all notes are identical and stay in one anonymity set as the share price moves. Withdrawing pays one share of every token the vault holds, to a new address with no ETH, while a relayer pays the gas for a 0.5% fee. No price oracle is needed: swap fees stay in the vault and raise what each note is worth.

The vault is the Aqua maker, so one balance backs two SwapVM strategies at once: a concentrated WETH/USDC pair and a pegged USDC/USDT pair. Anonymous LPs can't watch a position and react to an attack, so the volatile pair uses SwapVM's decay instruction. In our fork demo, the same $1,000 sandwich makes the attacker $39.59 on the curve without decay and loses them $70.20 with it.

How it's Made

The contracts are Solidity, built with Foundry, and run against 1inch's deployed Aqua and SwapVM router on a Base fork with real WETH, USDC and USDT. Strategies are SwapVM programs composing concentrated liquidity, decay, a flat fee and PeggedSwap. The withdrawal circuit is Noir, proved with UltraHonk, using a generated Solidity verifier. The Merkle tree stores only its frontier onchain, and the client rebuilds paths from deposit events, so the RPC never learns which note is yours. The frontend is Next.js and viem, with noir_js and bb.js generating proofs on the user's device.

1inch's stack made the core design possible. Because Aqua strategies hold virtual balances, withdrawals never have to unwind a position, and one balance can earn in several strategies.

The notable hacks:

  • Mid-swap guard: vault balances are wrong between Aqua's pull and push, so a trader could buy a discounted share from inside a swap callback. We block deposits and withdrawals during a swap using SwapVM maker hooks with a transient counter, and the vault rejects any strategy that doesn't wire up the hooks.
  • Contract size: Poseidon exceeded the 24KB limit under via_ir, so it's compiled separately and called through an interface. The generated verifier also has to compile outside via_ir.
  • Sandwich demo: it runs real transactions inside Anvil snapshots and then rewinds, so both curves face the same attack from the same state.
background image mobile

Join the mailing list

Get the latest news and updates

Cleverly Using Money | ETHGlobal