This library enables:
- Fetching the list of available cryptocurrency markets for a given exchange/venue
- Fetching the order book for the given cryptocurrency market
- Throttling/rate-limiting requests, by using the specific exchange's rate-limit (and backing off if a "Too Many Requests"-HTTP error is received)
The fetched order books are compatible with the orderbook
library, which we can then use to query the liquidity of the given market.
The functionality of this library is exposed as the CLI application rest-depth.
To add support for a new exchange, implement the EnumMarkets
class (which retrieves a list of supported markets) for the given exchange, as well as the MarketBook
class which:
- Retrieves an orderbook when given a
Market
returned by theEnumMarkets
implementation - Returns the rate limit for fetching orderbooks from the given exchange
Note that Binance restricts the IP addresses that can access its services, so that US IP addresses are denied access. Because the VMs for the GitHub CI are located in the US, the tests for Binance are disabled for the GitHub CI.