How to use the node-binance-api.first function in node-binance-api

To help you get started, we’ve selected a few node-binance-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bmino / binance-triangle-arbitrage / routes / BinanceController.js View on Github external
if (!isPresent(index)) {
                UNFILLED.push(symbol);
                console.log('Added ' + symbol + ' (' + askDepth + '/' + bidDepth + ') - ' + UNFILLED.length);
            }
        } else if (isPresent(index)) {
            UNFILLED.splice(index, 1);
            console.log('Removed ' + symbol + ' (' + askDepth + '/' + bidDepth + ') - ' + UNFILLED.length);
        }

        sockets.emit('depth:new', {
            ticker: symbol,
            unfilled: UNFILLED,
            time: new Date().getTime(),
            bid: bids,
            ask: asks,
            market: (parseFloat(binance.first(bids)) + parseFloat(binance.first(asks))) / 2
        });
    }, LIMIT);