Orderbook

QL
Last updated last month

Message signing

All authenticated rest messages such as trading api, shall be provided with an authorization header in the format:

Authorization: <public_key>;<time/epoch/ms>;<signature>

Step 1: string concat: public_key + time/epoch/ms + url_path + body Step 2: calculate sha256 hash from step 1 Step 3: Calculate signature from secret key sign(sk, sha256(publickey + time/epoch/ms + url_path + body)

Definitions

<market> is a pair defined by

<asset_code1>/<asset_code2>

Example:

  1. QDEX/ETH

  2. QDEX/EOS,0x345345435

  3. OMG,0x123123/EOS,0x123123

Asset code can have comma to delimit the the smart contract associated to the ERC-20.

get
Get Status

https://testnet-02.quantachain.io:5200
/status
Shows the status of peers connection, and block state
Request
Response
200: OK
Cake successfully retrieved.
{
Peers: [{
NodeId: "0.0.0.0:7100",
Status: "alive",
ConsensusState: "",
HeaderHash: "123123213",
BlockHeight: 0
}]
}

post
Submit Order

https://testnet-02.quantachain.io:5200
/submitorder
Request
Response
Headers
Authorization
required
string
public_key;date;signature
Body Parameters
required
object
{ Market string Side int // 1 = BUY, 0 = SELL Price int // price * 10,000,000 Size int // size * 10,000,000 }
200: OK

get
Get Account

https://testnet-02.quantachain.io:5200
/account
Request
Response
Path Parameters
optional
string
200: OK
{
CurrentOrders: [{
OrderId: uint64
Market: uint64
Side int32
Price uint64
Size uint64
Filled uint64
}]
}

get
Get Order Depth

https://testnet-02.quantachain.io:5200
/depth/<market>
Request
Response
Path Parameters
market
required
string
See data definition
200: OK
{
"type": "depth",
"partial": false,
"symbol": "BTC/USD",
"seq": 59744048,
"ts": 1520491080,
"bids": [
[
"4.000000", // amount
"10052.000000", // price
],
...
],
"asks": [
[
"2.000000",
"10066.000000",
],
...
]
}
302: Found
Asset not found

get
Get Settlement

https://testnet-02.quantachain.io:5200
/settlement/<market>
Shows status of settlement
Request
Response
Path Parameters
market
optional
string
See definition
200: OK
{
trades: [{
"type": "trade",
"amount": "1.000000",
"price": "10000.000000",
"symbol": "BTC/USD",
"signed: true
}]
}