V1 API Reference

ZERA Indexer API

Access indexed blockchain data from the ZERA network. Transactions, blocks, tokens, wallets, governance, DEX, staking, and more.

ALPHA DOCUMENTATIONThese endpoint schemas are currently in Alpha and may contain inaccuracies or incomplete payload parameters. If you encounter any structural divergence while integrating, please report it to us so we can resolve it swiftly.
https://api.zerascan.io/v1
GET ONLYJSON RESPONSES

DEX

Read-only data from on-chain decentralized exchange smart contracts — liquidity pools, swap history, OHLCV candles, and pool analytics.

List Pools

GET/v1/dex?request=pools

Paginated list of all indexed liquidity pools with market data.

Parameters

ParameterTypeRequiredDescription
requeststringREQUIREDMust be `pools`
limitintoptionalResults (1–100)
offsetintoptionalOffset (max 10000)
tokenstringoptionalFilter pools containing this token
searchstringoptionalFuzzy text search
sortstringoptionalSort: volume, tvl, fees, apr, fee, reserves, swaps, created, updated
orderstringoptionalSort direction

🪙 Usage & Credits

This endpoint consumes 25 credits per request against your active API tier.

Response

json
{
  "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

GET/v1/dex?request=pool

Detailed state for a specific liquidity pool.

Parameters

ParameterTypeRequiredDescription
requeststringREQUIREDMust be `pool`
poolIdstringREQUIREDPool identifier

🪙 Usage & Credits

This endpoint consumes 10 credits per request against your active API tier.

Response

json
{
  "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

StatusCondition
400Missing poolId parameter
404Pool not found

DEX Transactions

GET/v1/dex?request=transactions

Historical ledger of DEX activity: creates, adds, removes, swaps, unlocks.

Parameters

ParameterTypeRequiredDescription
requeststringREQUIREDMust be `transactions`
limitintoptionalResults (1–100)
offsetintoptionalOffset (max 10000)
poolIdstringoptionalFilter by pool ID
typestringoptionalFilter: create, add, remove, swap, unlock
startTimeintoptionalUnix timestamp lower bound
endTimeintoptionalUnix timestamp upper bound

🪙 Usage & Credits

This endpoint consumes 50 credits per request against your active API tier.

Response

json
{
  "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

GET/v1/dex?request=stats

Global or filtered aggregate DEX statistics (TVL, volume, counts).

Parameters

ParameterTypeRequiredDescription
requeststringREQUIREDMust be `stats`
poolIdstringoptionalStats for a specific pool
tokenstringoptionalAggregated stats for pools with this token
searchstringoptionalStats for matching pools

🪙 Usage & Credits

This endpoint consumes 50 credits per request against your active API tier.

Response

json
{
  "totalPools": "integer",
  "totalTransactions": "integer",
  "totalSwaps": "integer",
  "totalAdds": "integer",
  "totalRemoves": "integer",
  "totalVolume24hNice": "float *",
  "totalTvl": "float *"
}

Candlestick Data (OHLCV)

GET/v1/dex?request=candles

Candlestick chart data with bidirectional OHLCV rates.

Parameters

ParameterTypeRequiredDescription
requeststringREQUIREDMust be `candles`
poolIdstringREQUIREDPool identifier
intervalstringREQUIRED1m, 5m, 15m, 1h, 4h, 12h, 1d, 1w, 1M
limitintoptionalMax candles (1–2000)
startTimeintoptionalUnix timestamp lower bound
endTimeintoptionalUnix timestamp upper bound

🪙 Usage & Credits

This endpoint consumes 50 credits per request against your active API tier.

Response

json
{
  "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

GET/v1/dex?request=swap

Quote 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

ParameterTypeRequiredDescription
requeststringREQUIREDMust be `swap`
tokenInstringREQUIREDInput token contract ID
tokenOutstringREQUIREDOutput token contract ID
amountInstringREQUIREDAmount to swap (human-readable)
feeContractIDstringoptionalContract ID for base fee payment. Must be ACE-authorized.
platformFeeBpsintegeroptionalPlatform fee in basis points (0–10000).
platformFeeAddressstringoptionalRecipient address for platform fee. Required when platformFeeBps > 0.
feeAmountstringoptionalFee override in human-readable units (skips on-chain fee estimation).
includeTransactionstringoptionalSet to 'true' to build an unsigned transaction alongside the quote.
publicKeystringoptionalSigner public key. Required when includeTransaction=true or stages provided. Private key remains on device and must self sign and broadcast to network locally.
minAmountOutstringoptionalMinimum acceptable output. Required when includeTransaction=true or stages provided.
stagesstringoptionalCustom stages as JSON. When provided, skips graph traversal and builds unsigned transaction based on provided data.

🪙 Usage & Credits

This endpoint consumes 50 (quote-only) or 100 (unsigned txn included) credits per request against your active API tier.

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

json
{
  "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

GET/v1/dex?request=graph

Compact in-memory snapshot of the entire pool graph. Sub-millisecond response, no DB query.

Parameters

ParameterTypeRequiredDescription
requeststringREQUIREDMust be `graph`

🪙 Usage & Credits

This endpoint consumes 500 credits per request against your active API tier.

Response

json
{
  "poolCount": "integer",
  "tokenCount": "integer",
  "pools": [
    {
      "poolId": "string",
      "token1": "string",
      "token2": "string",
      "reserve1": "float",
      "reserve2": "float",
      "feeBps": "integer"
    }
  ]
}