Orderbook btcCCXT Crypto Exchange Order Book Data [Example Tutorial]
Now that we have covered how to access the order book for a single trading pair using CCXT, we want to expand our approach to collecting order book data for every trading pair on the exchange. Unfortunately, collecting this amount of data is a bit tricky for CCXT.
The data for each market pair must be requested on an individual basis from Binance. Sending all of these requests can take up to 5 minutes or more since Binance has rate limits for how quickly you can access data. Each request we send will return the bid and ask depth market data for the individual trading pair. The result of the above example code will return the aggregated bid and ask orders for each trading pair available on the exchange. Note: Use caution when accessing excessive data from the exchange.
Continuously requesting order book data can clog up your trading service since it will restrict the number of requests you can make to perform other actions on the exchange. Due to the limitations with CCXT, our team has developed a professional grade alternative. The following example demonstrates how you can access the order book for a single asset using the Shrimpy Developer APIs.
These keys will be used in the following scripts. The Shrimpy APIs return a well-organized list of order book data which includes the base symbol, quote symbol, exchange, and each of the available orders on the exchange precisely labeled. Now, Shrimpy really shines when it comes to aggregating data across asset pairs or even exchanges. The following examples will highlight some of these use cases.
Retrieve the order book for every pair on Bittrex. You can quickly see how the difference between this last example and the previous Shrimpy example, which only requested data for one trading pair, is essentially the same. All we did was remove the inputs for quote currency, base currency, and limit.
Everything else remained exactly the same and retrieved all the data we needed in a single request. This prevents us from spending 5 minutes collecting data for each trading pair individually. Continuing from our last example, there are still more ways we can configure which data we collect from the Shrimpy APIs. Most times, we only need a subset of the order books available on the exchange. As a result, we might want to know all of the base or quote currencies which connect to a specific asset.
In these cases, we can request data for all pairs connected to a specific base or quote currency. Access the order book for every pair on Bittrex which uses BTC as the quote currency. They wrote this in reference to the chart below, which shows that Bitcoin Sentiment and Social Volume are near two-year highs. Weibo, which has over million active users, briefly trended the term as the sixth-most popular.
This is for good reason: the halving is expected to have a positive effect on the cryptocurrency market. He explained that from a simple supply-demand analysis, it makes sense for BTC to rally after the halving:. Most miners sell their block rewards as fast as they can.
Share Tweet Send Share.