Skip to content

052order

张帅磊 edited this page Jun 10, 2020 · 8 revisions

Order API

  • Acquire Order

#Example

#Request
{
  "method":"order.query",
  "params":[
    "BTCBCH",  # market
    0,         # side, 0 no limit, 1 sell, 2 buy
    0,         # ofsset
    10         # limit
    ],
  "id":15
}

#Response
{
  "error": null, 
  "result": {
    "limit": 10,
    "offset": 0,
    "total": 1,
    "records": [
     {
          "id": 48239,
          "type": 1,
          "side": 2,
          "user": 553,
          "account": 0,
          "option": 32,
          "ctime": 1590373332.036361,
          "mtime": 1590373332.036361,
          "market": "BCHBTC",
          "source": "outest",
          "client_id": "abc",
          "price": "0.01900000",
          "amount": "2.00000000",
          "taker_fee": "0.0001",
          "maker_fee": "0.0001",
          "left": "2.00000000",
          "deal_stock": "0.00000000",
          "deal_money": "0.00000000000000000000",
          "deal_fee": "0.000000000000000000000000",
          "asset_fee": "0.000000000000000000000000",
          "fee_discount": "1.0000",
          "last_deal_amount": "0",
          "last_deal_price": "0",
          "last_deal_time": 0.0,
          "last_deal_id": 0,
          "last_role": 0,
          "fee_asset": null
      }
    ]
  },
  "id": 15
 }
  • Subscribe Order

#Example

#Request

{
  "method":"order.subscribe",
  "params":["BTCBCH"], # market list
  "id":15
}

#notify
{
  "method": "order.update", 
  "params": [
       2,    #event: event type,Integer, 1: PUT, 2: UPDATE, 3: FINISH
       {
            "id": 48239,
            "type": 1,
            "side": 2,
            "user": 553,
            "account": 0,
            "option": 32,
            "ctime": 1590373332.036361,
            "mtime": 1590373332.036361,
            "market": "BCHBTC",
            "source": "outest",
            "client_id": "abc",
            "price": "0.01900000",
            "amount": "2.00000000",
            "taker_fee": "0.0001",
            "maker_fee": "0.0001",
            "left": "2.00000000",
            "deal_stock": "0.00000000",
            "deal_money": "0.00000000000000000000",
            "deal_fee": "0.000000000000000000000000",
            "asset_fee": "0.000000000000000000000000",
            "fee_discount": "1.0000",
            "last_deal_amount": "0",
            "last_deal_price": "0",
            "last_deal_time": 0.0,
            "last_deal_id": 0,
            "last_role": 0,
            "fee_asset": null 
       }
  ], 
  "id": null
}

HTTP API Introduction

Common API

Market API

Account API

Trading API

Margin API

Contract API

WebSocket API Introduction

Clone this wiki locally