We override the fetch_order_book and parse_order_book calls in each ext_exchange, return the orderbook response as we need back to persist into the DB.
Pros:
Avoids extra work parsing the unified CCXT response, after CCXT has parsed the raw orderbook result
Data such as 'timestamp' is not parsed/used by CCXT into its unified response (see parse_order_book comment). This gives us a chance to use some of the "lost" information.
Theoretically better performance in both cycles and memory (not benchmarked yet)
Cons:
Requires more work for maintaining each exchange object
If we re-use the same ext_exchange object for order scraping and the main bot, could risk unexpected problems in one project when a change has been made to accommodate the other.
If we do not re-use, may introduce another layer of complexity in the design between our client layer and our ext_ objects
Proposal:
We override the
fetch_order_book
andparse_order_book
calls in each ext_exchange, return the orderbook response as we need back to persist into the DB.Pros:
parse_order_book
comment). This gives us a chance to use some of the "lost" information.Cons:
ext_exchange
object for order scraping and the main bot, could risk unexpected problems in one project when a change has been made to accommodate the other.