Aqua0
Developers

Developer quickstart

The fastest way to integrate Aqua0.

Aqua0's protocol architecture is the vault and adapter model described in Concepts.

What you can do

  • Request quotes and authorize trades on both venues, 1inch Aqua and Uniswap V4
  • Execute swaps through AquaSwapVMRouter or via a Uniswap V4 pool
  • Manage LP liquidity locks and withdrawals through prepared calldata endpoints
  • Track swap and withdraw lifecycle through poll endpoints

All endpoints require the X-API-Key header.

Both venues share one namespace, /api/swap/*, with a venue field in the request body selecting the fill path.

Single-chain 1inch Aqua trader

POST /api/swap/quote     { "venue": "aqua", ... }
POST /api/swap/prepare   { "venue": "aqua", ... }

/quote sizes the trade. /prepare returns calldata for AquaSwapVMRouter.swap(order, tokenIn, tokenOut, amountIn, takerData). Submit the prepared transaction yourself.

The router emits Swapped(orderHash, maker, taker, tokenIn, tokenOut, amountIn, amountOut) on success. The backend indexes this event and credits LP attribution, so no further client action is required.

Uniswap V4 trader (single-chain or cross-chain)

POST /api/swap/quote      { "venue": "v4", ... }
POST /api/swap/authorize  { "venue": "v4", ... }

/quote prices a just-in-time (JIT) liquidity fill against Aqua0's own vault capital. /authorize returns an EIP-712-signed authorization bound to that exact swap. Submit a Uniswap V4 swap with the authorization as hookData. The pool's hook validates it and injects a temporary liquidity range, then settles and emits a settlement event when the swap completes.

For cross-chain trades, the authorization references chain-A LP capital backing a chain-B swap, and no client action is required after the swap lands, see Concepts for how that settles.

Liquidity provider lock and withdraw

POST /api/vaults/:chainId/:asset/prepare-deposit
POST /api/vaults/:chainId/:asset/prepare-withdraw

Both return calldata for you to sign yourself. prepare-deposit includes an approval call first when one is needed (requiresApproval on the response tells you). prepare-withdraw covers your idle principal (freePrincipal on the response) and withdraws instantly, while principal currently backing a strategy withdraws through the async request/claim path instead, see Async redeem semantics for the timing guarantee.

Full route surface

See the API Reference for the full request/response surface. This page documents the endpoints integrators reach for first.

Next steps

  • Read Concepts for the vault, class, and attribution model.
  • Read Integration for recommended UX patterns.
  • Read Status and errors for lifecycle states and retry guidance.

On this page