We do NOT override the fetch_order_book and parse_order_book calls in each ext_exchange, return the orderbook response as the CCXT unified response, and format the orderbook data as we need. Then persist into the DB.
Pros:
Much less maintenance work as we do not override the fetch_order_book and parse_order_book functions in CCXT exchanges
Since the CCXT response is unified, likely will require less 'special cases' (i.e. some exchanges may treat the 'timestamp' field as timestamp order placed, vs timestamp which order was fetched) in parsing the response from each exchange.
Cons:
Theoretically worse performance in both cycles and memory (not benchmarked yet) since we are parsing the unified CCXT response, after CCXT has parsed the raw orderbook result.
We "lose" some of the information not used by the CCXT unified response such as timestamp (see parse_order_book comment in #194 ).
Counter-proposal to #194 :
We do NOT override the
fetch_order_book
andparse_order_book
calls in each ext_exchange, return the orderbook response as the CCXT unified response, and format the orderbook data as we need. Then persist into the DB.Pros:
fetch_order_book
andparse_order_book
functions in CCXT exchangesCons:
parse_order_book
comment in #194 ).