tardis-dev replay large historical trades for multiple exchanges
const { replayNormalized, normalizeTrades, combine } = require('tardis-dev')
const from = '2019-07-01'
const to = '2019-07-02'
const exchanges = [
{
exchange: 'bitmex',
symbols: ['XBTUSD']
},
{
exchange: 'deribit',
symbols: ['BTC-PERPETUAL']
},
{
exchange: 'cryptofacilities',
symbols: ['PI_XBTUSD']
}
]
const historicalTrades = exchanges.map(exchange => {
return replayNormalized({ from, to, ...exchange }, normalizeTrades)
})
const LARGE_TRADE_THRESHOLD = 100 * 1000 // 100k contracts
async function run() {
for await (const trade of combine(...historicalTrades)) {
if (trade.amount >= LARGE_TRADE_THRESHOLD) {
console.log(trade.exchange, trade)
}
}
}
run()
no comments