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.xyzEvery 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
- Quote with
POST /api/swap/quote. It lists every route on the pair, on any chain and venue. - Build the chosen route with
POST /api/swap/prepare. - Sign and send the transaction from the trader's wallet. On Solana, send the signed transaction to
POST /api/solana/swaps/transactions/{requestId}/submit. - 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
| What | Limit | Code when exceeded |
|---|---|---|
| Requests per key from the API keys page | 300 a minute | API_KEY_RATE_LIMITED |
| Requests per account, across its keys from the API keys page | 600 a minute | API_KEY_RATE_LIMITED |
| Open Uniswap V4 authorizations per key | 10 in any 45 seconds | AUTHORIZE_OPEN_LIMIT |
| Uniswap V4 authorizations per key | 60 a minute | AUTHORIZE_RATE_LIMITED |
| Markets opened per key | 20 an hour | MARKET_OPEN_LIMITED |
| Markets opened by keys from the API keys page | 10 an hour together, 30 an hour across everyone | MARKET_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 exampleVALIDATION_ERROR,UNAUTHORIZED,NOT_FOUND,RATE_LIMITED,SERVICE_UNAVAILABLE,SIMULATION_REVERTED,PRICE_IMPACT,PRICE_IMPACT_ABOVE_MAX,PRICE_MOVED,FILL_TOO_LARGEorMIN_TRADE_SIZE.errorholds the same value. messageis for people and logs. Its wording can change.detailscarries figures for some codes.VALIDATION_ERRORlists each bad field indetails.issues.FILL_TOO_LARGEgives the most that fills now indetails.maxAmountIn.
| Status | Meaning | Retry |
|---|---|---|
400 | Invalid request, or the trade was refused. code says why. | No. Fix the request or quote again. |
401 | Missing or wrong key | No |
402 | Opening a market has a network fee to pay first | Yes, after the transfer in details |
403 | The caller's wallet does not match the wallet in the request | No |
404 | Not found | No |
409 | Conflicts with an earlier request, such as a reused request id | No. Send a new request. |
422 | Valid, but the transaction would revert or a position breaks a rule | No. message and details say why. |
429 | Too many requests | Yes, after Retry-After |
500 | Server error | Yes, with backoff |
503 | A dependency is briefly down | Yes, after details.retryAfterSeconds |