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

# Exchange Gateway REST API

> Current projected books, balances, and open orders.

The REST method playground defaults to mainnet and offers testnet in its server dropdown:

```text theme={null}
Mainnet (default): https://gateway.mainnet.kuru.io
Testnet: https://gateway.testnet.kuru.io
```

It exposes the latest retained proposed, voted, and finalized projections.
Market history and candles are served by the
[Data Source REST API](/api/data-source).

<CardGroup cols={2}>
  <Card title="L2 order book" icon="book-open" href="/api/exchange/reference/l2-book">
    Read a bounded finalized order-book snapshot.
  </Card>

  <Card title="Best bid and offer" icon="arrow-right-arrow-left" href="/api/exchange/reference/bbo">
    Read the current top of book.
  </Card>

  <Card title="User balances" icon="wallet" href="/api/exchange/reference/user-balances">
    Read all current spot balances in the retained snapshot.
  </Card>

  <Card title="User open orders" icon="list" href="/api/exchange/reference/user-orders">
    Read a user's current open-order snapshot.
  </Card>
</CardGroup>

## Projection states

`/api/depth`, `/api/bbo`, and the user snapshot routes accept `proposed`,
`voted`, or `finalized`. Short forms `p`, `v`, and `f` are also accepted.

## Numeric units

* Addresses are lowercase `0x`-prefixed 20-byte values.
* User IDs are unsigned decimal path values.
* Book sequence cursors are JSON integers.
* Book prices are native pp integer strings; sizes are native sp integer strings.
* Order prices are signed native pp integer strings; sizes remain native market size-precision integers.
* Base sizes use the market's native `sizePrecision` domain.
* Token balances use the token's native decimal domain.
* Percentage fields are decimal ratios: `"0.01"` means one percent.

Never parse these quantities through binary floating point.

User orders and balances are bounded snapshots rather than paginated
collections. Each returns at most 2,000 entries and sets `truncated` when
additional entries were omitted.

## Errors

Errors use one envelope:

```json theme={null}
{
  "feedEpoch": 7,
  "error": {
    "code": "BadRequest",
    "message": "limit must be between 1 and 500"
  }
}
```

Stable codes are `BadRequest`, `NotFound`, `Unsupported`, `RateLimited`, and
`Internal`.


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