> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aultblockchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Market Data

Live pricing, depth, and trade history.

## Get 24h Ticker

```http theme={null}
GET /api/v1/ticker/{symbol}
```

| Parameter | Type | Required | Description |
| - | - | - | - |
| `symbol` | path, string | yes | URL-encoded pair, for example `AULT%2FUSDC` |

```bash theme={null}
curl https://am-api.cloud.aultblockchain.xyz/api/v1/ticker/AULT%2FUSDC
```

```json theme={null}
{
  "symbol": "AULT/USDC",
  "high": "0.005114",
  "low": "0.005114",
  "bid": "0.005103",
  "bidVolume": "5000",
  "ask": "0.005125",
  "askVolume": "5000",
  "vwap": "0.005114",
  "open": "0.005114",
  "close": "0.005114",
  "last": "0.005114",
  "previousClose": "0.005237",
  "change": "0",
  "percentage": "0",
  "average": "0.005114",
  "baseVolume": "2000",
  "quoteVolume": "10.228",
  "timestamp": 1787548712000,
  "datetime": "2026-08-24T05:18:32Z",
  "info": {}
}
```

### Get All Tickers

```http theme={null}
GET /api/v1/tickers
```

Returns a dictionary of ticker objects keyed by symbol, for every market at once.

### Field Notes

The rolling window cutoff is the snapshot time minus 24 hours.

| Field | Meaning |
| - | - |
| `last`, `close` | Current trade price |
| `bid`, `ask`, `bidVolume`, `askVolume` | Current best bid and ask from the order book, not a 24-hour value |
| `open` | First observed price after the cutoff |
| `previousClose` | Last observed price before the cutoff |
| `change` | `last` minus `open` |

A gap between `previousClose` and `open` is expected when no trade lands exactly at the cutoff.

> [!WARNING]
>
> Fields that cannot be computed yet are `null`, not zero, including `high`, `low`, `bid`, `ask`,
> `vwap`, `open`, `change`, `percentage`, and `average`. Treat `null` as no data. Reading it as zero
> corrupts any change derived from it.

A `503` with `24h ticker window not yet available` is retryable. See
[Errors](https://docs.aultblockchain.com/dex-api/getting-started/errors.md).

## Get Orderbook

```http theme={null}
GET /api/v1/orderbook/{symbol}
```

| Parameter | Type | Required | Description |
| - | - | - | - |
| `symbol` | path, string | yes | URL-encoded pair, for example `WETH%2FUSDC` |
| `limit` | query, integer | no | Levels per side. Default 20, maximum 20 |

```bash theme={null}
curl "https://am-api.cloud.aultblockchain.xyz/api/v1/orderbook/WETH%2FUSDC?limit=5"
```

```json theme={null}
{
  "symbol": "WETH/USDC",
  "market_id": "0165726332303a30783230383666373535413664393235...",
  "bids": [
    ["2462.631", "20000000000000000"],
    ["2461.398", "20000000000000000"]
  ],
  "asks": [
    ["2469.241", "20000000000000000"],
    ["2470.474", "20000000000000000"]
  ],
  "timestamp": 1787555803000,
  "datetime": "2026-08-24T07:16:43Z",
  "nonce": 21028581
}
```

| Field | Description |
| - | - |
| `bids` | `[price, quantity]` tuples, descending by price. Quantity is raw base units. Index 0 is the best bid |
| `asks` | `[price, quantity]` tuples, ascending by price. Index 0 is the best ask |
| `market_id` | Hex-encoded chain market identifier, no `0x` prefix |
| `nonce` | Chain block height of the snapshot |

Levels use the same ordering as the WebSocket `l2Book` channel, so code that switches between REST
snapshots and streaming frames does not need to re-sort.

`market_id` lets a client call chain query endpoints that key on the binary market identifier without
resolving the symbol map again. Its length varies by market, so treat it as an opaque string. See
[Chain Queries](https://docs.aultblockchain.com/dex-api/advanced/chain-queries.md).

### Maintaining a Local Book

1. Subscribe to `l2Book` on [Subscriptions](https://docs.aultblockchain.com/dex-api/websocket/subscriptions.md) and wait for its initial
   snapshot.
2. Replace both local book sides with each subsequent `l2Book` frame. Frames contain the published
   book state, not incremental level deltas; remove levels absent from the replacement.
3. Treat a REST snapshot as a separate read or fallback. REST `nonce` is a block height, while
   `l2Book` exposes no matching height or sequence. Do not merge buffered frames into REST by
   comparing `nonce` with WebSocket `time`.
4. After a disconnect or suspected gap, discard the old stream state, resubscribe, and obtain a new
   baseline. Neither replay nor lossless recovery of intermediate changes is promised.

The common ordering rule is price ordering within a book: bids descending and asks ascending.
It is not a cross-interface sequencing guarantee. Initial WebSocket snapshot time is server time;
live book frames use block time. Do not use timestamps to line up REST and WebSocket data exactly.

## Get Recent Trades

```http theme={null}
GET /api/v1/trades/{symbol}
```

| Parameter | Type | Required | Description |
| - | - | - | - |
| `symbol` | path, string | yes | URL-encoded pair |
| `limit` | query, integer | no | Default 100, maximum 500 |
| `since` | query, int64 | no | Unix millisecond timestamp |
| `cursor` | query, string | no | Opaque continuation from `X-Next-Cursor` |
| `before_height` | query, int64 | no | Cursor upper half, pass with `before_index` |
| `before_index` | query, int64 | no | Cursor lower half |

> [!NOTE]
>
> Each match writes both a maker leg and a taker leg. This endpoint returns the maker leg only, so a
> market's trades are not double-counted. For one account's own fills, which can be either leg, use
> [User Fills](https://docs.aultblockchain.com/dex-api/rest/user-fills.md).

```bash theme={null}
curl "https://am-api.cloud.aultblockchain.xyz/api/v1/trades/AULT%2FUSDC?limit=3"
```

```json theme={null}
[
  {
    "id": "21014477-00010000000001409be8000000010000-3000000000000000000000",
    "order": null,
    "timestamp": 1787548712000,
    "datetime": "2026-08-24T05:18:32Z",
    "symbol": "AULT/USDC",
    "type": "limit",
    "cloid": null,
    "side": "buy",
    "takerOrMaker": "maker",
    "price": "0.005114",
    "amount": "2000",
    "cost": "10.228",
    "fee": { "cost": "0.3", "currency": "AULT", "rate": "0.00015" },
    "info": {
      "address": "ault1...",
      "paid": "10228000000000000000.000000000000000000erc20:0x5b58...",
      "received": "1999700000000000000000aault",
      "block_height": "21014477",
      "event_index": 12
    }
  }
]
```

| Field | Description |
| - | - |
| `id` | Composite trade id, `blockHeight-orderIdHex-openQuantity` |
| `cost` | `price` multiplied by `amount` |
| `takerOrMaker` | Always `maker` on this endpoint |
| `side` | Direction of this indexed maker leg, not the aggressing taker |
| `fee.currency` | Currency of the indexed realized fee, which can be base or quote; legacy estimates use quote |
| `info.paid`, `info.received` | Raw amounts with denomination, for the leg in this row |
| `info.block_height`, `info.event_index` | Cursor values for the next page |

> [!WARNING]
>
> Every row is the maker leg, and `side` follows that row's indexed buy/sell direction. A row with
> `side: "buy"` represents the resting buyer, not an aggressing buyer. Do not infer taker direction
> without inverting this side. The realized fee currency follows the asset the maker received. Legacy rows without an indexed
> realized fee can instead contain a quote-currency estimate; see
> [fee reconciliation](https://docs.aultblockchain.com/dex-api/rest/user-fills.md#reconciling-an-order).

`type` is `null` when the originating order cannot be resolved, and `unknown` when the chain reports
a type the API does not recognize. On this endpoint `order` and `cloid` are always `null`.

### Cursor Pagination

Use `X-Next-Cursor` and pass it as `cursor`, keeping filters unchanged. The older paired
`before_height` and `before_index` form is also supported. See [Pagination](https://docs.aultblockchain.com/dex-api/getting-started/pagination.md).

## Get One Trade

```http theme={null}
GET /api/v1/trade/{id}
```

Takes a trade `id` verbatim from `/api/v1/trades/{symbol}` or `/api/v1/mytrades` and resolves either
leg of the match. The response has the same shape as the feed above, with `order` and `cloid` null.

Use the returned ID verbatim. Its height and open-quantity components use canonical decimal
format, and its full order-ID component uses lowercase hex, including any required leading zeros.
A malformed id returns `400`, and an id matching no fill returns `404`.

> [!WARNING]
>
> The WebSocket `tid` is a hashed numeric id and is not valid input here. Only a REST `id` works.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.