DEX
Read-only data from on-chain decentralized exchange smart contracts — liquidity pools, swap history, OHLCV candles, and pool analytics.
List Pools
/v1/dex?request=poolsPaginated list of all indexed liquidity pools with market data.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| request | string | REQUIRED | — | Must be `pools` |
| limit | int | optional | 20 | Results (1–100) |
| offset | int | optional | 0 | Offset (max 10000) |
| token | string | optional | — | Filter pools containing this token |
| search | string | optional | — | Fuzzy text search |
| sort | string | optional | volume | Sort: volume, tvl, fees, apr, fee, reserves, swaps, created, updated |
| order | string | optional | desc | Sort direction |
🪙 Usage & Credits
Response
{
"found": "integer",
"pools": [
{
"poolId": "string",
"contractName": "string *",
"token1": {
"symbol": "string",
"name": "string *",
"icon": "string *"
},
"token2": {
"symbol": "string",
"name": "string *",
"icon": "string *"
},
"feePercent": "float",
"lpTokenId": "string",
"reserves": {
"token1": "string",
"token2": "string"
},
"tvl": "float *",
"volume24hNice": "float *",
"apr": "float *"
}
]
}Pool Details
/v1/dex?request=poolDetailed state for a specific liquidity pool.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| request | string | REQUIRED | — | Must be `pool` |
| poolId | string | REQUIRED | — | Pool identifier |
🪙 Usage & Credits
Response
{
"poolId": "string",
"contractName": "string *",
"token1": {
"symbol": "string",
"name": "string *",
"icon": "string *"
},
"token2": {
"symbol": "string",
"name": "string *",
"icon": "string *"
},
"feePercent": "float",
"lpTokenId": "string",
"reserves": {
"token1": "string",
"token2": "string"
},
"lpTokens *": {
"locked": "string",
"unlocked": "string",
"burned": "string"
},
"ratio1To2": "string *",
"ratio2To1": "string *",
"rate": "float *",
"niceRateToken1": "float *",
"niceRateToken2": "float *",
"tvl": "float *",
"totalVolume *": {
"token1": "string",
"token2": "string"
},
"volume24h *": {
"token1": "string",
"token2": "string"
},
"volume24hNice": "float *",
"fees24h": "float *",
"apr": "float *",
"rateChange24h": "float *",
"txCounts *": {
"swaps": "integer",
"adds": "integer",
"removes": "integer"
},
"totalFees *": {
"treasury": "string",
"rewards": "string"
},
"createdAt": "integer",
"lastUpdated": "integer",
"creationTxHash": "string *"
}Errors
| Status | Condition |
|---|---|
| 400 | Missing poolId parameter |
| 404 | Pool not found |
DEX Transactions
/v1/dex?request=transactionsHistorical ledger of DEX activity: creates, adds, removes, swaps, unlocks.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| request | string | REQUIRED | — | Must be `transactions` |
| limit | int | optional | 50 | Results (1–100) |
| offset | int | optional | 0 | Offset (max 10000) |
| poolId | string | optional | — | Filter by pool ID |
| type | string | optional | — | Filter: create, add, remove, swap, unlock |
| startTime | int | optional | — | Unix timestamp lower bound |
| endTime | int | optional | — | Unix timestamp upper bound |
🪙 Usage & Credits
Response
{
"found": "integer",
"transactions": [
{
"hash": "string",
"poolId": "string",
"type": "string",
"from": "string *",
"token1": "string",
"token2": "string",
"amountToken1": "string *",
"amountToken2": "string *",
"lpTokens": "string *",
"treasuryFee": "string *",
"rewardFee": "string *",
"ratio1To2": "string *",
"ratio2To1": "string *",
"niceRateToken1": "float *",
"niceRateToken2": "float *",
"token1IsInput": "boolean *",
"timestamp": "integer",
"blockHeight": "integer"
}
]
}DEX Stats
/v1/dex?request=statsGlobal or filtered aggregate DEX statistics (TVL, volume, counts).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| request | string | REQUIRED | — | Must be `stats` |
| poolId | string | optional | — | Stats for a specific pool |
| token | string | optional | — | Aggregated stats for pools with this token |
| search | string | optional | — | Stats for matching pools |
🪙 Usage & Credits
Response
{
"totalPools": "integer",
"totalTransactions": "integer",
"totalSwaps": "integer",
"totalAdds": "integer",
"totalRemoves": "integer",
"totalVolume24hNice": "float *",
"totalTvl": "float *"
}Candlestick Data (OHLCV)
/v1/dex?request=candlesCandlestick chart data with bidirectional OHLCV rates.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| request | string | REQUIRED | — | Must be `candles` |
| poolId | string | REQUIRED | — | Pool identifier |
| interval | string | REQUIRED | — | 1m, 5m, 15m, 1h, 4h, 12h, 1d, 1w, 1M |
| limit | int | optional | 500 | Max candles (1–2000) |
| startTime | int | optional | — | Unix timestamp lower bound |
| endTime | int | optional | — | Unix timestamp upper bound |
🪙 Usage & Credits
Response
{
"found": "integer",
"candles": [
{
"poolId": "string",
"interval": "string",
"time": "integer",
"open1": "float",
"high1": "float",
"low1": "float",
"close1": "float",
"open2": "float",
"high2": "float",
"low2": "float",
"close2": "float",
"volume": "float"
}
]
}Swap
/v1/dex?request=swapQuote a swap via on-chain DEX smart contracts. Returns detailed pricing, fee breakdowns, and optional unsigned execution data that must be self-signed and self-initiated by the client. Costs 50 credits if includeTransaction is false, and 100 credits if includeTransaction is true or stages are provided.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| request | string | REQUIRED | — | Must be `swap` |
| tokenIn | string | REQUIRED | — | Input token contract ID |
| tokenOut | string | REQUIRED | — | Output token contract ID |
| amountIn | string | REQUIRED | — | Amount to swap (human-readable) |
| feeContractID | string | optional | $ZRA+0000 | Contract ID for base fee payment. Must be ACE-authorized. |
| platformFeeBps | integer | optional | 0 | Platform fee in basis points (0–10000). |
| platformFeeAddress | string | optional | — | Recipient address for platform fee. Required when platformFeeBps > 0. |
| feeAmount | string | optional | — | Fee override in human-readable units (skips on-chain fee estimation). |
| includeTransaction | string | optional | — | Set to 'true' to build an unsigned transaction alongside the quote. |
| publicKey | string | optional | — | Signer public key. Required when includeTransaction=true or stages provided. Private key remains on device and must self sign and broadcast to network locally. |
| minAmountOut | string | optional | — | Minimum acceptable output. Required when includeTransaction=true or stages provided. |
| stages | string | optional | — | Custom stages as JSON. When provided, skips graph traversal and builds unsigned transaction based on provided data. |
🪙 Usage & Credits
Notes
- The DEX Swap API strictly provides mathematical data and expected outputs.
- This infrastructure maintains ZERO custody or control of any user assets at any point in any transaction lifecycle.
- There is no interaction with any regulated platform (e.g. CEX).
- Any transactions are exclusively non-custodial with decentralized protocols (e.g. DEX) and must be self-initiated, signed, and executed directly by the client against on-chain smart contracts. There is no custody or counterparty risk at any time.
Response
{
"tokenIn": "string",
"tokenOut": "string",
"amountIn": "float",
"amountOut": "float",
"netAmountOut": "float",
"startRate": "float",
"avgRate": "float",
"endRate": "float",
"slippage": "float",
"rateImpact": "float",
"poolFeePercent": "float",
"platformFee": "float",
"platformFeeBps": "integer",
"feeContractId": "string",
"feeEstimate": "float *",
"stages": [
{
"legs": [
{
"tokenIn": "string",
"tokenOut": "string",
"poolFeeBps": "integer",
"amountIn": "string"
}
]
}
],
"hopDetails": [
{
"poolId": "string",
"tokenIn": "string",
"tokenOut": "string",
"amountIn": "float",
"amountOut": "float",
"feeRate": "float",
"feeAmount": "float",
"startRate": "float",
"execRate": "float",
"endRate": "float",
"rateImpact": "float",
"reserveIn": "float",
"reserveOut": "float"
}
],
"transaction *": "object",
"minAmountOut": "float *",
"firstTimeTransfers": "integer *"
}Pool Graph Snapshot
/v1/dex?request=graphCompact in-memory snapshot of the entire pool graph. Sub-millisecond response, no DB query.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| request | string | REQUIRED | — | Must be `graph` |
🪙 Usage & Credits
Response
{
"poolCount": "integer",
"tokenCount": "integer",
"pools": [
{
"poolId": "string",
"token1": "string",
"token2": "string",
"reserve1": "float",
"reserve2": "float",
"feeBps": "integer"
}
]
}