API overview

Base URL, authentication, limits and errors for the Aqua0 REST API.

The Aqua0 REST API quotes and builds swaps, builds liquidity transactions and opens markets. It takes and returns JSON over HTTPS. You sign and send every transaction yourself, so Aqua0 never holds your keys or funds.

Base URL

https://api.aqua0.xyz

Every path is relative to it, for example /api/swap/quote. These docs and their "Try it" panels use the API they were built from.

Authentication

Send your API key in the X-API-Key header on every request. Create one on the API keys page.

curl "https://api.aqua0.xyz/api/vaults/chains" \  -H "X-API-Key: $AQUA0_API_KEY"

A missing or wrong key returns 401 with the code UNAUTHORIZED. The shared key a "Try it" panel starts with can only read and quote. Preparing or authorizing a swap, opening a market and requesting an asset need a key issued to your integration.

Integration pattern

  1. Quote with POST /api/swap/quote. It lists every route on the pair, on any chain and venue.
  2. Build the chosen route with POST /api/swap/prepare.
  3. Sign and send the transaction from the trader's wallet. On Solana, send the signed transaction to POST /api/solana/swaps/transactions/{requestId}/submit.
  4. Track it with GET /api/swap/status/{chainId}/{txHash}.

Every route takes and returns a numeric chainId, 1151111081099710 on Solana, and names venues by a short venue id with venueInfo. See Swap and Track a swap.

Limits

WhatLimitCode when exceeded
Requests per key from the API keys page300 a minuteAPI_KEY_RATE_LIMITED
Requests per account, across its keys from the API keys page600 a minuteAPI_KEY_RATE_LIMITED
Open Uniswap V4 authorizations per key10 in any 45 secondsAUTHORIZE_OPEN_LIMIT
Uniswap V4 authorizations per key60 a minuteAUTHORIZE_RATE_LIMITED
Markets opened per key20 an hourMARKET_OPEN_LIMITED
Markets opened by keys from the API keys page10 an hour together, 30 an hour across everyoneMARKET_OPEN_LIMITED

Each one returns 429 with a Retry-After header. Keys from the API keys page also share one cap on open authorizations, which returns AUTHORIZE_OPEN_LIMIT. Ask the team if you need higher limits.

Errors

Every error has the same JSON shape.

{
  "error": "VALIDATION_ERROR",
  "code": "VALIDATION_ERROR",
  "message": "Invalid request data",
  "details": { "issues": [{ "path": "amountIn", "message": "Invalid amount" }] }
}
  • Branch on code, for example VALIDATION_ERROR, UNAUTHORIZED, NOT_FOUND, RATE_LIMITED, SERVICE_UNAVAILABLE, SIMULATION_REVERTED, PRICE_IMPACT, PRICE_IMPACT_ABOVE_MAX, PRICE_MOVED, FILL_TOO_LARGE or MIN_TRADE_SIZE. error holds the same value.
  • message is for people and logs. Its wording can change.
  • details carries figures for some codes. VALIDATION_ERROR lists each bad field in details.issues. FILL_TOO_LARGE gives the most that fills now in details.maxAmountIn.
StatusMeaningRetry
400Invalid request, or the trade was refused. code says why.No. Fix the request or quote again.
401Missing or wrong keyNo
402Opening a market has a network fee to pay firstYes, after the transfer in details
403The caller's wallet does not match the wallet in the requestNo
404Not foundNo
409Conflicts with an earlier request, such as a reused request idNo. Send a new request.
422Valid, but the transaction would revert or a position breaks a ruleNo. message and details say why.
429Too many requestsYes, after Retry-After
500Server errorYes, with backoff
503A dependency is briefly downYes, after details.retryAfterSeconds

On this page