Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
binance.websockets.depthCache(tickers, function(symbol, depth) {
var bids = binance.sortBids(depth.bids);
var asks = binance.sortAsks(depth.asks);
var askDepth = Object.keys(asks).length;
var bidDepth = Object.keys(bids).length;
var index = UNFILLED.indexOf(symbol);
if (askDepth < MIN_THRESHOLD && bidDepth < MIN_THRESHOLD) {
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', {