CCXT 通用交易所 API

其為一套可在任何交易所進行交易的 API

https://github.com/ccxt/ccxt/wiki/Manual#market-orders

https://docs.ccxt.com/en/latest/manual.html

獲取初始化需要放入參數的 Credentials

從 requiredCredentials 可以知道在上方交易所內的 object 參數放入哪些欄位

const ccxt = require ('ccxt');

(async function () {
    const exchange = new ccxt.binance ({...})
    console.log(exchange.requiredCredentials)
  },
}) ();

獲取可呼叫方法

const ccxt = require ('ccxt');

(async function () {
    const exchange = new ccxt.binance ({...})
    console.log(exchange.has)
  },
}) ();

獲取所有可用交易對

最小下單金額可以從 ['TOKEN/TOKEN']['limits']['cost']['min'] 獲取

https://github.com/ccxt/ccxt/issues/1972#issuecomment-366834844

建立市價訂單

建立限價訂單

獲取交易所資金費率 Funding Rate

獲取交易所 Open Interest (OI)

取得歷史價格

推薦使用https://min-api.cryptocompare.com/documentation

如果要取得歷史資料可以用toTs,會返回其timestamp之前的limit參數筆資料,然後用batch方式去不斷抓資料。

e.g.

然後將TimeFrom 在放入下一筆的toTs繼續往更早之前的資料抓取

Last updated

Was this helpful?