Orderbook API

Introduction

Orderbook API offers a detailed interface for accessing and managing order books on the platform. Users can retrieve aggregated order books in general or specific to a certain exchange and asset pair, as well as access the current pending order book with appropriate authorization. It includes functionality to release pending volume and to access an aggregated internal order book for a specified asset pair. The API also includes a powerful control measure that allows users, with the appropriate API key, to force the deletion of a price level for a specific exchange, pair, and side, giving them a high level of control over the order book's state.

1. Aggregated Orderbook

Aggregated orderbook is a hybrid data structure. It can contain multiple trading sources, even those that have different architecture. For example it includes OrionPoolV2, Curve (stable pool) trading source.

Query ParamDescriptionExample

pair (Required)

Pair ticker, delimited with -, lowercase or uppercase strings are accepted.

pair=ORN-USDT

depth (Optional)

The depth of orderbook, both asks and bids.

depth=20

Request example:

curl -X 'GET' \
  'https://trade.orionprotocol.io/backend/api/v1/orderbook?pair=ORN-ETH&depth=3' \
  -H 'accept: */*'

Response example:

{
  "asks": [
    {
      "price": 0.0005601,
      "amount": 115.2,
      "exchanges": [
        "BINANCE"
      ],
      "path": [
        {
          "assetPair": "ETH-USDT",
          "action": "SELL"
        },
        {
          "assetPair": "ORN-USDT",
          "action": "BUY"
        }
      ]
    },
    {
      "price": 0.0005599,
      "amount": 315,
      "exchanges": [
        "BINANCE"
      ],
      "path": [
        {
          "assetPair": "ETH-USDT",
          "action": "SELL"
        },
        {
          "assetPair": "ORN-USDT",
          "action": "BUY"
        }
      ]
    },
    {
      "price": 0.0005595,
      "amount": 1294,
      "exchanges": [
        "BINANCE"
      ],
      "path": [
        {
          "assetPair": "ETH-USDT",
          "action": "SELL"
        },
        {
          "assetPair": "ORN-USDT",
          "action": "BUY"
        }
      ]
    }
  ],
  "bids": [
    {
      "price": 0.0008052,
      "amount": 68.18462089131944,
      "exchanges": [
        "ORION_POOL"
      ],
      "path": [
        {
          "assetPair": "ORN-ETH",
          "action": "SELL"
        }
      ]
    },
    {
      "price": 0.0008052,
      "amount": 15.36430112,
      "exchanges": [
        "ORION_POOL"
      ],
      "path": [
        {
          "assetPair": "ORN-USDT",
          "action": "SELL"
        },
        {
          "assetPair": "ETH-USDT",
          "action": "BUY"
        }
      ]
    },
    {
      "price": 0.0008036,
      "amount": 136.23247170975154,
      "exchanges": [
        "ORION_POOL"
      ],
      "path": [
        {
          "assetPair": "ORN-ETH",
          "action": "SELL"
        }
      ]
    }
  ]
}

2. Aggregated Orderbook for the specified exchange and pair

Note: previous query parameters are applicable.

ParamDescriptionExamplePossible values

exchange (required)

Exchange to aggregate data from

BINANCE

filterByBrokerBalances

TODO

false

true, false

Request Example

In this example

curl -X 'GET' \
  'https://trade.orionprotocol.io/backend/api/v1/orderbook/BINANCE/ORN-USDT?depth=3&filterByBrokerBalances=false' \
  -H 'accept: */*'

Response example:

{
  "asks": [
    {
      "price": 1.0241,
      "amount": 179.1,
      "path": [
        {
          "assetPair": "ORN-USDT",
          "action": "BUY"
        }
      ]
    },
    {
      "price": 1.0242,
      "amount": 195.2,
      "path": [
        {
          "assetPair": "ORN-USDT",
          "action": "BUY"
        }
      ]
    },
    {
      "price": 1.0244,
      "amount": 486.6,
      "path": [
        {
          "assetPair": "ORN-USDT",
          "action": "BUY"
        }
      ]
    }
  ],
  "bids": [
    {
      "price": 1.0233,
      "amount": 136.8,
      "path": [
        {
          "assetPair": "ORN-USDT",
          "action": "SELL"
        }
      ]
    },
    {
      "price": 1.0229,
      "amount": 94.2,
      "path": [
        {
          "assetPair": "ORN-USDT",
          "action": "SELL"
        }
      ]
    },
    {
      "price": 1.0228,
      "amount": 116.4,
      "path": [
        {
          "assetPair": "ORN-USDT",
          "action": "SELL"
        }
      ]
    }
  ]
}

3. Internal Aggregated Orderbook for specified asset pair

Last updated