Routefire API API Reference

Official documentation of the Routefire API.

API Endpoint
https://routefire.io/api/v1
Terms of Service: https://routefire.io
Contact: contact@routefire.io
Schemes: https
Version: 1.0.0

Authentication

api_key

type
apiKey
name
Authorization
in
header

auth

Authentication

Obtain auth token

POST /authenticate

Obtains a fresh auth (JWT) token from API credentials. The uid field takes the API key ID issued by Routefire, and the password field takes the API key secret associated with it. This token should be used in all other API calls as a bearer token -- in a header of the form Authorization: Bearer 123abdef....

undefined

Request Example
{
  "uid": "RF-API-KEY",
  "password": "RF-API-KEY-SECRET"
}
200 OK

successful operation

401 Unauthorized

Unauthorized (likely bad credentials)

Response Content-Types: application/json
Response Example (200 OK)
{
  "token": "abc..."
}

orders

Order information

Submit a new order

POST /orders/submit

Submit a new order to the Routefire Trading Server. Execution algorithm can be twap, vwap, pvol, or iso at time of writing. Specific parameters to the algorithms are included in the algo_params map -- keys can be found in the execution algorithms' documentation.

undefined

Request Example
{
  "user_id": "abc23g-defe3...",
  "buy_asset": "btc",
  "sell_asset": "eur",
  "quantity": "10.505",
  "algo": "twap",
  "algo_params": {
    "key1": "value1",
    "key2": "value2"
  }
}
200 OK

successful operation

401 Unauthorized

Unauthorized (get new JWT)

500 Internal Server Error

Message not routable

Response Content-Types: application/json
Response Example (200 OK)
{
  "order_id": "abc12-abc23-..."
}

Get order status

POST /orders/status

Get current status of a Routefire order. If complete, the status will be FILL; if entirely unfilled, OPEN; otherwise, PARTIAL_FILL.

undefined

Request Example
{
  "user_id": "ba041-1df40-d0202",
  "order_id": "025ab-235ag-asdf..."
}
200 OK

successful operation

401 Unauthorized

Unauthorized (get new JWT)

500 Internal Server Error

Message not routable

Response Content-Types: application/json
Response Example (200 OK)
{
  "status": "PARTIAL_FILL",
  "filled": "0.52300"
}

Cancel an order

POST /orders/cancel

Cancel a Routefire order. Returns the status of the order at time of cancellation.

undefined

Request Example
{
  "user_id": "ba041-1df40-d0202",
  "order_id": "025ab-235ag-asdf..."
}
200 OK

successful operation

401 Unauthorized

Unauthorized (get new JWT)

500 Internal Server Error

Message not routable

Response Content-Types: application/json
Response Example (200 OK)
{
  "status": "PARTIAL_FILL",
  "filled": "0.52300"
}

Get all current orders

POST /orders

Get all current orders for a user and their fill values. Order descriptions are included in the orders map; status is reported in the status map.

undefined

Request Example
{
  "user_id": "ba041-1df40-d0202"
}

successful operation

401 Unauthorized

Unauthorized (get new JWT)

500 Internal Server Error

Account not routable

Response Content-Types: application/json
Response Example (200 OK)
{
  "user_id": "abc23g-defe3...",
  "orders": {
    "order_one": {
      "user_id": "abc23g-defe3...",
      "buy_asset": "btc",
      "sell_asset": "eur",
      "quantity": "10.505",
      "algo": "twap",
      "algo_params": {
        "key1": "value1",
        "key2": "value2"
      }
    },
    "order_two": {
      "user_id": "abc23g-defe3...",
      "buy_asset": "btc",
      "sell_asset": "eur",
      "quantity": "10.505",
      "algo": "twap",
      "algo_params": {
        "key1": "value1",
        "key2": "value2"
      }
    }
  },
  "status": {
    "order_one": {
      "status": "PARTIAL_FILL",
      "filled": "0.52300"
    },
    "order_two": {
      "status": "PARTIAL_FILL",
      "filled": "0.52300"
    }
  }
}

data

General market data inquiries

Get market statistics

POST /data/inquire

Get current statistics for a pair/size combination.

undefined

Request Example
{
  "uid": "RF-API-KEY-HERE",
  "buy_asset": "btc",
  "sell_asset": "eur",
  "quantity": "10.505"
}

successful operation

401 Unauthorized

Unauthorized (get new JWT)

500 Internal Server Error

Account not routable

Response Content-Types: application/json
Response Example (200 OK)
{
  "iso_cost": "8923.23104",
  "top_of_book": {
    "key1": "value1",
    "key2": "value2"
  }
}

Get consolidated order book

POST /data/consolidated

Get consolidated order book data for a given pair. This request will return the order-level information for each venue to which your account is connected.

undefined

Request Example
{
  "uid": "RF-API-KEY-HERE",
  "buy_asset": "btc",
  "sell_asset": "eur",
  "quantity": "10.505"
}
200 OK

successful operation

401 Unauthorized

Unauthorized (get new JWT)

500 Internal Server Error

Account not routable

Response Content-Types: application/json
Response Example (200 OK)
{
  "bids": [
    {
      "quantity": "1.5",
      "price": "8000.55",
      "venue": "gemini",
      "auction": false
    }
  ],
  "offers": [
    {
      "quantity": "1.5",
      "price": "8000.55",
      "venue": "gemini",
      "auction": false
    }
  ]
}

Schema Definitions

OrderRequest: object

user_id: string
order_id: string
Example
{
  "user_id": "ba041-1df40-d0202",
  "order_id": "025ab-235ag-asdf..."
}

OrderStatus: object

status: string
filled: string
Example
{
  "status": "PARTIAL_FILL",
  "filled": "0.52300"
}

UserInquiry: object

uid: string
buy_asset: string
sell_asset: string
quantity: string
Example
{
  "uid": "RF-API-KEY-HERE",
  "buy_asset": "btc",
  "sell_asset": "eur",
  "quantity": "10.505"
}

UserInquiryResponse: object

iso_cost: string
top_of_book: KVPairs
Example
{
  "iso_cost": "8923.23104",
  "top_of_book": {
    "key1": "value1",
    "key2": "value2"
  }
}

UserOrderRequest: object

user_id: string
buy_asset: string
sell_asset: string
quantity: string
algo: string
algo_params: KVPairs
Example
{
  "user_id": "abc23g-defe3...",
  "buy_asset": "btc",
  "sell_asset": "eur",
  "quantity": "10.505",
  "algo": "twap",
  "algo_params": {
    "key1": "value1",
    "key2": "value2"
  }
}

OrderBookEntry: object

quantity: string
price: string
venue: string
auction: boolean
Example
{
  "quantity": "1.5",
  "price": "8000.55",
  "venue": "gemini",
  "auction": false
}

OrderBook: object

Example
{
  "bids": [
    {
      "quantity": "1.5",
      "price": "8000.55",
      "venue": "gemini",
      "auction": false
    }
  ],
  "offers": [
    {
      "quantity": "1.5",
      "price": "8000.55",
      "venue": "gemini",
      "auction": false
    }
  ]
}

KVPairs: object

key1: string
key2: string
Example
{
  "key1": "value1",
  "key2": "value2"
}

AllOrdersStatus: object

user_id: string
orders: object
order_one: UserOrderRequest
order_two: UserOrderRequest
status: object
order_one: OrderStatus
order_two: OrderStatus
Example
{
  "user_id": "abc23g-defe3...",
  "orders": {
    "order_one": {
      "user_id": "abc23g-defe3...",
      "buy_asset": "btc",
      "sell_asset": "eur",
      "quantity": "10.505",
      "algo": "twap",
      "algo_params": {
        "key1": "value1",
        "key2": "value2"
      }
    },
    "order_two": {
      "user_id": "abc23g-defe3...",
      "buy_asset": "btc",
      "sell_asset": "eur",
      "quantity": "10.505",
      "algo": "twap",
      "algo_params": {
        "key1": "value1",
        "key2": "value2"
      }
    }
  },
  "status": {
    "order_one": {
      "status": "PARTIAL_FILL",
      "filled": "0.52300"
    },
    "order_two": {
      "status": "PARTIAL_FILL",
      "filled": "0.52300"
    }
  }
}

UserRequest: object

user_id: string
Example
{
  "user_id": "ba041-1df40-d0202"
}

UserJwtToken: object

token: string
Example
{
  "token": "abc..."
}

UserOrderId: object

order_id: string
Example
{
  "order_id": "abc12-abc23-..."
}

UserLoginRequest: object

uid: string
password: string
Example
{
  "uid": "RF-API-KEY",
  "password": "RF-API-KEY-SECRET"
}