Voltaire API (1.4.0)

Download OpenAPI specification:Download

Introduction

Welcome to the Voltaire API documentation. If you'd like to use Voltaire programmatically, you've come to the right place.

This is a REST API which implements essential functionality for trading. Voltaire regularly releases non-breaking API updates. A complimentary WebSocket API is currently in development.

Order Types

Voltaire currently supports Market and Limit orders.

Type Description
Market Filled immediately against resting orders. If the order can not be filled completely it is rejected.
Limit Filled at or more favorably than the specified price against resting orders. If some of the quantity remains unfilled, it rests on the continuous trading order book until traded against.

Maker and Taker

All orders can be categorised as maker only, taker only, or both maker and taker. The definition of the order (with the exception of a market order) is based on the outcome of the order.

A maker order is one which is resting in the order book before being filled. Maker orders can be completely untouched orders, or the remaining part of a partially filled order. In the latter case, only the remaining part can be considered to be maker, as the filled part did not rest in the order book and filled immediately.

A taker order is one which does not rest in the order book before being filled. Taker orders can be orders which filled immediately, or the immediate fill part of a partially filled order. Market orders are always considered taker orders as they fill immediately.

Order matching

Orders are executed in price-time priority as received by the matching engine. Note that taker sell orders are matched first with the latest maker buy orders when multiple maker buy orders exist at the same price.

Updates and changes

Voltaire strives to never introduce breaking changes as part of our engineering design process. Should any breaking changes be introduced, these will be communicated to API users via email.

Suggestions

If you have any feedback or queries please contact support at the email listed at the top of this page.

Authentication

ApiKey

Order and account management endpoints are private and require authentication. To use these endpoints you will need to create a valid API key from your profile page. This key must then be provided as the X-VOLT-API-KEY header on each request.

The API key should be treated as secret data and not exposed to any users. To ensure the security of your API key, we strongly suggest that you make requests to the Voltaire API server-side whenever possible.

Two-key System

Voltaire implements a two-key system for API key management. Two API keys (Key 1 and Key 2) can be avaliabe to a single user account. This provides a fallback key allowing continuous API use should Key 1 need be rotated.

Generating keys on your profile shifts Key 1 into the place of Key 2, whilst generating a new key in the place of Key 1.

To use this mechanic correctly, generate and configure your implementation to use Key 1. Should a rotation be required, generate a new Key 1. This will shift Key 1 to Key 2, and a fresh Key 1 is avaliable to use.

Should Key 1 be compromised, Key 1 should be generated twice. This in effect replaces both Key 1 and Key 2 with fresh API keys.

Security scheme type: API Key
header parameter name: X-VOLT-API-KEY

Account management

Endpoints for account management.

Account info

Get information about your account.

Authorizations:

Responses

200

Operation successful

401

The API key is not valid

500

We had a problem with our server

get /users/self

Production server

https://api.voltaire.cash/users/self

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "1",
  • "name": "Lillian Kuvalis",
  • "email": "terrill14@cveiguulymquns4m.ga",
  • "balances":
    {
    }
}

Order management

Endpoints for order management.

Place a new order

Place a limit or market order.

Authorizations:
Request Body schema: application/json
One of
  • LimitPayload
  • MarketPayload
type
required
string
Value:"limit"
side
required
string (Side)
Enum:"buy" "sell"
product_id
required
string (ProductId)
Enum:"BSV-BCH" "BTC-BCH" "ETH-BCH" "LTC-BCH"
price
required
string^\d+(\.\d+)?$
quantity
required
string^\d+(\.\d+)?$

Responses

201

Order created

400

A precondition is not met

401

The API key is not valid

422

Invalid order

500

We had a problem with our server

503

The server is overloaded or down for maintenance

post /orders

Production server

https://api.voltaire.cash/orders

Request samples

application/json
Copy
Expand all Collapse all
{
  • "type": "limit",
  • "side": "buy",
  • "product_id": "BSV-BCH",
  • "price": "4.0338",
  • "quantity": "0.00184"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "0000000000000001",
  • "type": "limit",
  • "side": "buy",
  • "product_id": "BTC-BCH",
  • "price": "4.0338",
  • "quantity": "0.00184",
  • "remaining_quantity": "0.00184",
  • "time": "2018-05-30T14:29:27.891Z"
}

Get all open orders

Get all open orders for a product. Returned orders are sorted by creation time in descending order.

Authorizations:
query Parameters
product_id
required
string (ProductId)
Enum:"BSV-BCH" "BTC-BCH" "ETH-BCH" "LTC-BCH"

The product ID

Responses

200

Operation successful

401

The API key is not valid

422

Invalid parameters

500

We had a problem with our server

get /orders

Production server

https://api.voltaire.cash/orders

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Get an open order

Get an open order by ID.

Authorizations:
path Parameters
id
required
string (OrderId) ^\d{16}$
Example: "0000000000000001"

The order ID

Responses

200

Operation successful

401

The API key is not valid

404

The specified resource was not found

500

We had a problem with our server

get /orders/{id}

Production server

https://api.voltaire.cash/orders/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "0000000000000001",
  • "type": "limit",
  • "side": "buy",
  • "product_id": "BTC-BCH",
  • "price": "4.0338",
  • "quantity": "0.00184",
  • "remaining_quantity": "0.00184",
  • "time": "2018-05-30T14:29:27.891Z"
}

Cancel an order

Cancel an open order.

Authorizations:
path Parameters
id
required
string (OrderId) ^\d{16}$
Example: "0000000000000001"

The order ID

Responses

200

Operation successful

401

The API key is not valid

404

The specified resource was not found

500

We had a problem with our server

delete /orders/{id}

Production server

https://api.voltaire.cash/orders/{id}

Response samples

application/json
Copy
Expand all Collapse all
{ }

Get a list of fills

Get a list of fills for a product. Returned fills are sorted by time in descending order.

Authorizations:
query Parameters
product_id
required
string (ProductId)
Enum:"BSV-BCH" "BTC-BCH" "ETH-BCH" "LTC-BCH"

The product ID

after
integer <int64> (AfterBefore) >= 1

Request items after (older) than this ID

before
integer <int64> (AfterBefore) >= 1

Request items before (newer) than this ID

limit
integer <int32> (Limit) [ 1 .. 100 ]
Default: 100

The number of results to return

Responses

200

Operation successful

400

Invalid request

401

The API key is not valid

422

Invalid parameters

500

We had a problem with our server

get /fills

Production server

https://api.voltaire.cash/fills

Response samples

application/json
Copy
Expand all Collapse all
{
  • "sequence": 7,
  • "fills":
    [
    ]
}

Market data

Endpoints to get information about the Voltaire market.

Get products

Get the list of available currency pairs for trading.

Responses

200

Operation successful

get /products

Production server

https://api.voltaire.cash/products

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Get the order book

Get the order book for a product. The aggregation level can be customized with the level parameter. See below for details.

The returned asks and bids are sorted by price in descending order. Each ask and bid is a tuple with 3 elements. The first element is always the price. The second element represents the sum of quantity of the orders at that price or just the order quantity depending on whether the result is aggregated or not. Similarly the third element represents the count of orders at that price or the order ID depending on whether the result is aggregated or not.

path Parameters
id
required
string (ProductId)
Enum:"BSV-BCH" "BTC-BCH" "ETH-BCH" "LTC-BCH"

The product ID

query Parameters
level
integer <int32> [ 1 .. 3 ]
Default: 3

Specifies the aggreation level to use.

  • When level is 1 only the best bid and ask are returned.
  • When level is 2 the result is aggregated by price.
  • When level is set to 3 the result is not aggregated, meaning that all orders at each price are returned.

Responses

200

Operation successful

404

The specified resource was not found

422

Invalid parameters

500

We had a problem with our server

get /products/{id}/book

Production server

https://api.voltaire.cash/products/{id}/book

Response samples

application/json
Copy
Expand all Collapse all
{
  • "sequence": 8,
  • "asks":
    [
    ],
  • "bids":