Doca Finance

Keep your wallet. Put it to work anyway. Shared liquidity, kept within the line.

Doca Finance

Created At

ETHGlobal Lisbon 2026

Project Description

Doca is an inventory-aware risk controller for 1inch Aqua: it prices inventory depletion on-chain and repairs underfunded strategies off-chain.

Aqua lets one wallet back several strategies at once: promises instead of deposits. By design a promise can exceed what the wallet holds. Under directional flow the wallet drains while every strategy keeps advertising inventory, takers get quotes that revert, and the whitepaper's prescribed fix is docking by hand.

Doca is built on one rule. A promise may exceed your wallet, that part is Aqua. A budget may not, that part is us.

On-chain, an InventorySkewProvider behind SwapVM's stock dynamic-fee opcode prices each budget as it drains: flat while healthy, quadratically more expensive on the draining side, base fee on the side that refills you.

Off-chain, a Harbormaster keeper docks any strategy that crosses its line and re-ships it against what the wallet holds right now. Autonomous in the demo with a local key, signature-gated with a connected wallet.

Measured against a paired control (same wallet, same curve, same flow, one instruction of difference): 29% more inventory retained, 1.99% better realized price on the drained leg. At 4x amplification the unmanaged maker published 43 fills it could not honor. With budgets: zero.

How it's Made

Two small Solidity contracts on 1inch's own stack. InventorySkewProvider (178 lines) implements IProtocolFeeProvider behind SwapVM's stock opcode 30. DocaApp (93 lines) assembles the SwapVM program. Everything that settles value is official 1inch code: the canonical Aqua registry on Base and an unmodified AquaSwapVMRouter.

The app is React and ethers on an anvil fork of Base with the real WETH and USDC contracts, so every demo fill is a real ERC20 transfer. The Harbormaster runs in the page and reads wallet capacity off the pricing path. A read-only MCP server exposes wallet, positions and the two-leg health check to agents, and the app anchors to live Base mainnet pricing through the Uniswap Trading API.

11 Hardhat tests green, including adversarial tests that document one honest limit: the provider prices cumulative depletion, not a single oversized fill. That guard is the next layer, a BudgetGuard SwapVM instruction we specified but did not ship.

Both contracts are deployed on Base mainnet, source verified on Sourcify with an exact match:

InventorySkewProvider 0x768FDce0cD1b6237811CA50D7758698e7EDe54D9

DocaApp 0x8A151aF27a0Ae421A2222ed9b6c58cd8AC179694

background image mobile

Join the mailing list

Get the latest news and updates