tardis-dev / tardis-machine

Locally runnable server with built-in data caching, providing both tick-level historical and consolidated real-time cryptocurrency market data via HTTP and WebSocket APIs
https://docs.tardis.dev/api/tardis-machine
Mozilla Public License 2.0
235 stars 46 forks source link

inconsistent response with okex* exchanges #13

Closed thangng48 closed 2 years ago

thangng48 commented 2 years ago

We have noticed inconsistency in data response from tardis-machine


With 2 different tardis-machine instance, with same query { symbols: [ 'RVN-USDT-SWAP' ], exchange: 'okex-swap', dataTypes: [ 'trade' ], from: '2022-03-09T05:57:44Z', to: '2022-03-09T06:17:46Z' }:

tardis-dev:machine GET /replay-normalized request started, options: { symbols: [ 'RVN-USDT-SWAP' ], exchange: 'okex-swap', dataTypes: [ 'trade' ], from: '2022-03-09T05:57:44Z', to: '2022-03-09T06:17:46Z' } +1h
tardis-dev:machine GET /replay-normalized request finished, options: { symbols: [ 'RVN-USDT-SWAP' ], exchange: 'okex-swap', dataTypes: [ 'trade' ], from: '2022-03-09T05:57:44Z', to: '2022-03-09T06:17:46Z' }, time: 8.742 seconds, total messages count: 438 +9s
2022-03-09T10:31:38.860Z tardis-dev:machine GET /replay-normalized request started, options: { symbols: [ 'RVN-USDT-SWAP' ], exchange: 'okex-swap', dataTypes: [ 'trade' ], from: '2022-03-09T05:57:44Z', to: '2022-03-09T06:17:46Z' }
2022-03-09T10:31:48.970Z tardis-dev:machine GET /replay-normalized request finished, options: { symbols: [ 'RVN-USDT-SWAP' ], exchange: 'okex-swap', dataTypes: [ 'trade' ], from: '2022-03-09T05:57:44Z', to: '2022-03-09T06:17:46Z' }, time: 10.11 seconds, total messages count: 0

With same tardis-machine instance

  1. inconsistent replay data
  1. inconsistent replay and replay-normalized data
thaaddeus commented 2 years ago

Can you please update to last tardis-machine version and try again?

We've migrated to okex v5 API (v3 api is discontinued) starting from 2021-12-23 and that means data format and channel names have changed.

In your case, starting from 2021-12-23 you need to use new channel names for 'replay':

Replay-normalized should work fine with latest version It's not documented yet, but should be soon.

thangng48 commented 2 years ago

@thaaddeus

You're correct. Just to clarify, the 1st problem happened because one of the tardis-machine instance was in old version. Thanks you.