lib/utils.rb in SimBot-0.1.21 vs lib/utils.rb in SimBot-0.1.22

- old
+ new

@@ -104,10 +104,20 @@ end # fetch binance order book # @return [float] rate def self.binane_order_book - response = RestClient.get('https://api.binance.com/api/v1/depth?symbol=BCCBTC&limit=100') + response = RestClient.get('https://api.binance.com/api/v1/depth?symbol=BTCUSDT&limit=500') + hash = JSON.parse(response.body) + bids = hash['bids'] + asks = hash['asks'] + { bids: bids, asks: asks } + end + + # fetch binance order book + # @return [float] rate + def self.binane_usdtbtc_order_book + response = RestClient.get('https://api.binance.com/api/v1/depth?symbol=BTCUSDT&limit=500') hash = JSON.parse(response.body) bids = hash['bids'] asks = hash['asks'] { bids: bids, asks: asks } end