Back to Ccxt

Fetch Okex Futures

wiki/examples/js/fetch-okex-futures.md

4.5.60522 B
Original Source
javascript
// @NO_AUTO_TRANSPILE
import ccxt from '../../js/ccxt.js';
async function test() {
    const exchange = new ccxt.okx();
    await exchange.loadMarkets();
    for (let symbol in exchange.markets) {
        const market = exchange.markets[symbol];
        if (market['future']) {
            console.log('----------------------------------------------------');
            console.log(symbol, await exchange.fetchTicker(symbol));
            await ccxt.sleep(exchange.rateLimit);
        }
    }
}
test();