> ## 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.

# Orders

> [!NOTE]
>
> Spot reads are available on Mainnet and Testnet. Margin account fields, conditional-order fields, and Perpetual references on this page are **Testnet-Only**.

These endpoints read order state. Submitting orders is covered in
[Trading Orders](https://docs.aultblockchain.com/dex-api/trading/place-or-modify-order.md).

## List Orders

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

| Parameter | Type | Required | Description |
| - | - | - | - |
| `address` | string | yes | Bech32 or EVM hex account address |
| `status` | string | no | `open`, `closed`, or `canceled` |
| `symbol` | string | no | For example `AULT/USDC`. Alternative to `market_id` |
| `market_id` | string | no | Hex market identifier. Takes precedence over `symbol` |
| `cloid` | string | no | Client order id, 16 hex characters |
| `since` | int64 | no | Created-after Unix millisecond timestamp |
| `limit` | integer | no | Default 100, maximum 500 |
| `cursor` | string | no | Opaque continuation from `X-Next-Cursor` |

```bash theme={null}
curl "https://am-api.cloud.aultblockchain.xyz/api/v1/orders?address=ault1...&limit=10"
```

Always returns an array. An address with no matching orders returns `[]`, never a 404.

## Get One Order

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

| Parameter | Type | Required | Description |
| - | - | - | - |
| `id` | path, string | yes | Hex-encoded order id |

An unknown id returns `404 NOT_FOUND`.

## Order Fields

```json theme={null}
{
  "id": "0001000000000140df29000000000000",
  "clientOrderId": "1a13784185c81033",
  "timestamp": 1787555837000,
  "datetime": "2026-08-24T07:17:17Z",
  "lastTradeTimestamp": null,
  "status": "open",
  "symbol": "WETH/USDC",
  "type": "limit",
  "timeInForce": null,
  "side": "sell",
  "price": "2470.312",
  "average": null,
  "amount": "0.02",
  "filled": "0",
  "remaining": "0.02",
  "cost": "0",
  "trades": [],
  "fee": { "cost": "0", "currency": "USDC", "rate": "0.00035" },
  "reduceOnly": false,
  "postOnly": false,
  "stopPrice": null,
  "triggerPrice": null,
  "info": {
    "block_height": "21028649",
    "chain_status": "open",
    "chain_type": "limit",
    "remaining_deposit": "20000000000000000",
    "tx_index": 0
  }
}
```

| Field | Description |
| - | - |
| `id` | Hex-encoded chain order id |
| `clientOrderId` | Client order id, 8 bytes as 16 hex characters, if the order carried one |
| `status` | Collapsed status: `open`, `closed`, or `canceled` |
| `amount` / `filled` / `remaining` | Original, executed, and outstanding quantity |
| `average` | Average fill price, `null` before the first fill |
| `cost` | `filled` multiplied by `average` |
| `fee` | Quote-currency estimate from indexed notional and rate; use fills for realized fees |
| `info.chain_status` | Granular chain status: `open`, `partially_filled`, `filled`, `cancelled`, `expired`, `triggered_pending`, or `unknown` |
| `info.remaining_deposit` | Raw payment-asset escrow for a regular order; computed unspent budget for a TWAP parent |

`status` maps from the chain status like this:

| `info.chain_status` | `status` |
| - | - |
| `open`, `partially_filled` | `open` |
| `filled` | `closed` |
| `cancelled`, `expired` | `canceled` |

Conditional parent states map separately: `pending`/`triggered` to `open`, `activated` to
`closed`, and `cancelled`/`expired`/`closed` to `canceled`.

For a regular executable order, `closed` means filled. An activated conditional parent instead
reports `closed` without filling; its child carries executions. Read `info.chain_status` and
`info.conditional.state` to distinguish these cases. Cancelled and expired orders both report
`canceled`.

`reduceOnly` is always false in Spot responses. Conditional parents populate `stopPrice` and
`triggerPrice`; their `type` is `stop_limit` or `stop_market`, while `info.chain_type` is `conditional`.
A market-buy parent can report `amount: "0"` because its budget is quote sized. This does not mean
it has no executable budget.

## Strategies and derived accounts

| Field | Meaning |
| - | - |
| `timeInForce` | `"ioc"` when IOC was recorded, otherwise null |
| `info.close_reason` | Chain close reason, null while live |
| `info.parent_order_id` | Conditional parent of an activated child, nullable |
| `info.conditional` | Parent state: `trigger_above`, `state`, `child_order_id`, `triggered_at`, `activated_at`, `deposit`, `deposit_asset`, `worst_price`, `price_tolerance`, `awaiting_primary` |
| `info.links` | Active and ended order-group edges |
| `info.twap_id` | Parent TWAP ID for a slice, nullable |
| `info.twap` | Parent schedule: `total_deposit`, `deposit_asset`, `start_time`, `deadline`, `num_slices`, `slice_index`, `price_tolerance`, `worst_price` |
| `marginMode`, `marginOwner`, `autoRepay`, `autoRepayAtCancel` | Optional decorations for a derived Margin account's orders |

Conditional parents do not fill; follow their activated child. `state` can be `pending`, `triggered`,
`activated`, `cancelled`, `expired` or `closed`. A TWAP parent's fills aggregate slices. For a buy,
`amount`/`filled` reflect executed base quantity and `remaining` is zero; read `total_deposit` with
`deposit_asset: "quote"` for the strategy budget. `info.remaining_deposit` on a parent is a computed
unspent budget, not proof that the whole strategy is escrowed. See [Orderbook](https://docs.aultblockchain.com/ault-dex/orderbook.md).

Prices are quote per base, regular quantities and strategy deposits are human units, and
`info.remaining_deposit` is raw base units of the payment asset. Conditional timestamps and TWAP
schedule times are milliseconds. Monetary nullable strategy fields remain null when absent.

The list uses [header cursor pagination](https://docs.aultblockchain.com/dex-api/getting-started/pagination.md), including conditional
and TWAP parents. Query derived Margin accounts by their returned address. Use the separate
[Perp order reference](https://docs.aultblockchain.com/dex-api/rest/perpetual-accounts.md) for Perp owners and account routing.

## Client Order IDs

A `cloid` must decode to exactly 8 bytes, that is 16 hex characters. Anything else returns
`400 BAD_REQUEST`. An absent or empty value applies no filter.

> [!WARNING]
>
> `cloid` uniqueness is enforced only among currently resting orders. A closed order that used the
> same `cloid` still matches the filter, so one `cloid` can return more than one order.

## Order links

Spot `info.links` uses **snake\_case**. Perp `links` describes the same relationships with
**camelCase** keys. Preserve the product's field names when parsing:

| Spot field | Perp field | JSON type and meaning |
| - | - | - |
| `order_id` | `orderId` | Other order's full hex ID |
| `type` | `type` | `oco`, `oto`, or `unknown` |
| `role` | `role` | `sibling`, `exit`, `primary`, or `unknown`, relative to this order |
| `active` | `active` | Boolean; ended links remain visible |
| `filled_quantity` | `filledQuantity` | Nullable human-base decimal string carried across replacement |
| `created_at`, `ended_at` | `createdAt`, `endedAt` | Nullable millisecond timestamps |
| `end_reason` | `endReason` | Nullable string |
| `ended_order_id` | `endedOrderId` | Nullable full hex ID |
| `cause_order_id` | `causeOrderId` | Nullable full hex ID |
| `replacement_order_id` | `replacementOrderId` | Nullable full hex ID |

Use these relationships to follow the executed child or replacement instead of assuming a parent
or old order ID continues filling. They report indexed linkage, not a new order-submission route.


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