Skip to content

Instantly share code, notes, and snippets.

@thaaddeus
Created January 27, 2022 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thaaddeus/2a57a81084c40290dd045edd9b2ea3dc to your computer and use it in GitHub Desktop.
Save thaaddeus/2a57a81084c40290dd045edd9b2ea3dc to your computer and use it in GitHub Desktop.
const { replay } = require('tardis-dev')
;(async () => {
const messages = replay({
exchange: 'deribit',
from: '2021-12-01',
to: '2021-12-02',
filters: [{ channel: 'book', symbols: ['BTC-PERPETUAL'] }],
apiKey: '<YOUR_API_KEY>'
})
// localTimestamp is a message arrival timestamp
// message is a message object as provided by Deribit real-time stream
for await (const { localTimestamp, message } of messages) {
console.log(localTimestamp, message)
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment