Skip to content

SDK interfaces

Steffel edited this page Jul 15, 2020 · 17 revisions

Public API

Market Data

getTrades

A list of recent public trades

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "time": 1499865549590,
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]
[{
    "time": "2014-11-07T22:19:28.578544Z",
    "trade_id": 74,
    "price": "10.00000000",
    "size": "0.01000000",
    "side": "buy"
}, {
    "time": "2014-11-07T01:08:43.642366Z",
    "trade_id": 73,
    "price": "100.00000000",
    "size": "0.01000000",
    "side": "sell"
}]

parameters

Name Type Mandatory Description
symbol STRING YES ex: BTCUUSDT

Returned Type:

[
  {
    "id": Int,
    "time": Datetime,
    "price": Decimal,
    "qty": Decimal,
  }
]

getTicker

binance

{
  "symbol": "LTCBTC",
  "price": "4.00000200"
}

coinbase

{
  "trade_id": 4729088,
  "price": "333.99",
  "size": "0.193",
  "bid": "333.98",
  "ask": "333.99",
  "volume": "5957.11914015",
  "time": "2015-11-14T20:46:03.511254Z"
}

parameters

Name Type Mandatory Description
symbol STRING YES ex: BTCUUSDT

Returned Type:

{
  price: Decimal
}

TODO

Exchange Information, Fee Schedule and Trading Rules

fetchMarkets

a list of trading pairs and their statuses + market structure

fetchCurrencies

a list of tokens or assets and their statuses + currency structure

fetchTradingLimits

min/max order volume, price, cost, precision, etc...

fetchTradingFees

trading fees, either public or personal

fetchFundingLimits

a list of withdrawal limits

Market Data

fetchTicker

24h volumes and stats + ticker structure

fetchOrderBook

L2/L3 + orderbook structure

get_user_trades

the personal history of filled trades for the account

fetchOHLCV

a list of candles or kline data for traded volumes in different timeframes 1m, 15m, 1h, 1d, ... + OHLCV structure

Private API Trading

fetchBalance

for all types of accounts + balance structure

fetchAccounts

required if the exchange has multiple accounts or sub-accounts

createOrder

limit/market orders + order structure

cancelOrder

editOrder

change the price and/or amount of an open order

Trading History

fetchOrder

one order by order id + order structure

fetchOpenOrders

a list of all open orders

fetchOrders

a list of all orders

fetchMyTrades

the personal history of filled trades for the account + trade structure

Funding

fetchDepositAddress – deposit address(es) + address structure

fetchDeposits

fetchWithdrawals

fetchTransactions + transaction structure

fetchLedger

transactions, transfers, referrals, cashbacks + ledger entry structure

withdraw

transfer

required if exchange has multiple accounts or sub-accounts