All Projects → tardis-dev → Tardis Node

tardis-dev / Tardis Node

Licence: mpl-2.0
Convenient access to tick-level real-time and historical cryptocurrency market data via Node.js

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Tardis Node

Ccxt
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Stars: ✭ 22,501 (+17757.94%)
Mutual labels:  btc, eth, trading, market-data, arbitrage, exchange
Cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler
Stars: ✭ 643 (+410.32%)
Mutual labels:  trading, binance, market-data, websocket, exchange
Ccxt Rest
Open Source Unified REST API of 100+ Crypto Exchange Sites (18k+ docker pulls) - https://ccxt-rest.io/
Stars: ✭ 210 (+66.67%)
Mutual labels:  btc, eth, trading, arbitrage, exchange
Krypto Trading Bot
Self-hosted crypto trading bot (automated high frequency market making) written in C++
Stars: ✭ 2,589 (+1954.76%)
Mutual labels:  trading, binance, market-data, exchange
Ccxt.net
CCXT.NET – CryptoCurrency eXchange Trading Library for .NET
Stars: ✭ 89 (-29.37%)
Mutual labels:  trading, market-data, arbitrage, exchange
Roq Api
API for algorithmic and high-frequency trading
Stars: ✭ 132 (+4.76%)
Mutual labels:  trading, market-data, arbitrage, exchange
Cryptotrader
A cryptocurrency trader for all famous exchanges
Stars: ✭ 228 (+80.95%)
Mutual labels:  trading, binance, arbitrage, exchange
Bot18
Bot18 is a high-frequency cryptocurrency trading bot developed by Zenbot creator @carlos8f
Stars: ✭ 157 (+24.6%)
Mutual labels:  btc, eth, trading, arbitrage
coinaly
🚀 Fast and easy to use mobile trade interface for cryptocurrencies. Track your trades to the moon and beyond. Currently only for Bittrex.
Stars: ✭ 32 (-74.6%)
Mutual labels:  exchange, btc, eth, cryptocurrency-exchanges
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (-5.56%)
Mutual labels:  trading, exchange, market-data, arbitrage
bybit-api
Node.js connector for the Bybit APIs and WebSockets, with TypeScript & browser support.
Stars: ✭ 69 (-45.24%)
Mutual labels:  trading, btc, eth, cryptocurrency-exchanges
Go Binance
A Go SDK for Binance API
Stars: ✭ 441 (+250%)
Mutual labels:  btc, eth, binance, exchange
Ccxws
WebSocket client for 38 cryptocurrency exchanges
Stars: ✭ 341 (+170.63%)
Mutual labels:  cryptocurrency-exchanges, binance, websocket, exchange
Crypto Trading Bot
Cryptocurrency trading bot in javascript for Bitfinex, Bitmex, Binance, FTX, Bybit ... (public edition)
Stars: ✭ 1,089 (+764.29%)
Mutual labels:  trading, binance, websocket, exchange
gdax bot
gdax_bot - Micro dollar cost averaging for crypto
Stars: ✭ 57 (-54.76%)
Mutual labels:  trading, btc, eth
uniswap-python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 533 (+323.02%)
Mutual labels:  trading, exchange, eth
robinhood.tools
📈🤑💰 Advanced trading tools and resources for Robinhood Web.
Stars: ✭ 27 (-78.57%)
Mutual labels:  real-time, exchange, market-data
rockfish
Rockfish is an arbitrage bot for the Stellar Decentralized Exchange (SDEX)
Stars: ✭ 58 (-53.97%)
Mutual labels:  trading, arbitrage, cryptocurrency-exchanges
crypto-database
Database for crypto data, supporting several exchanges. Can be used for TA, bots, backtest, realtime trading, etc.
Stars: ✭ 72 (-42.86%)
Mutual labels:  trading, cryptocurrency-exchanges, binance
Coinpricebar
💰 Cryptocurrency prices on MacBook Touch Bar
Stars: ✭ 290 (+130.16%)
Mutual labels:  btc, eth, binance

tardis-dev

Version Try on RunKit


Node.js tardis-dev library provides convenient access to tick-level real-time and historical cryptocurrency market data both in exchange native and normalized formats. Instead of callbacks it relies on async iteration (for await ...of) enabling composability features like seamless switching between real-time data streaming and historical data replay or computing derived data locally.


const { replayNormalized, normalizeTrades, normalizeBookChanges } = require('tardis-dev')

const messages = replayNormalized(
  {
    exchange: 'bitmex',
    symbols: ['XBTUSD', 'ETHUSD'],
    from: '2019-05-01',
    to: '2019-05-02'
  },
  normalizeTrades,
  normalizeBookChanges
)

for await (const message of messages) {
  console.log(message)
}

Try this code live on RunKit



Features

  • historical tick-level market data replay backed by tardis.dev HTTP API — includes full order book depth snapshots plus incremental updates, tick-by-tick trades, historical open interest, funding, index, mark prices, liquidations and more


  • consolidated real-time data streaming API connecting directly to exchanges' public WebSocket APIs


  • support for both exchange-native and normalized market data formats (unified format for accessing market data across all supported exchanges — normalized trades, order book and ticker data)


  • transparent historical local data caching (cached data is stored on disk in compressed GZIP format and decompressed on demand when reading the data)

  • support for top cryptocurrency exchanges: BitMEX, Deribit, Binance, FTX, OKEx, Huobi Futures, Huobi Global, Bitfinex, Coinbase Pro, Kraken Futures, Kraken, Bitstamp, Gemini, Poloniex, Bybit, Phemex, Delta Exchange, FTX US, Binance US, Gate.io, OKCoin, bitFlyer, HitBTC, CoinFLEX (2.0), Binance Jersey and more

  • automatic closed connections and stale connections reconnection logic for real-time streams


  • computing derived data locally like order book imbalance, custom trade bars, book snapshots and more via compute helper function and computables, e.g., volume based bars, top 20 levels order book snapshots taken every 10 ms etc.


  • fast and lightweight architecture — low memory footprint and no heavy in-memory buffering





Installation

Requires Node.js v12+ installed.

npm install tardis-dev --save


Documentation

See official docs.



Examples

Real-time spread across multiple exchanges

Example showing how to quickly display real-time spread and best bid/ask info across multiple exchanges at once. It can be easily adapted to do the same for historical data (replayNormalized instead of streamNormalized).

const tardis = require('tardis-dev')
const { streamNormalized, normalizeBookChanges, combine, compute, computeBookSnapshots } = tardis

const exchangesToStream = [
  { exchange: 'bitmex', symbols: ['XBTUSD'] },
  { exchange: 'deribit', symbols: ['BTC-PERPETUAL'] },
  { exchange: 'cryptofacilities', symbols: ['PI_XBTUSD'] }
]
// for each specified exchange call streamNormalized for it
// so we have multiple real-time streams for all specified exchanges
const realTimeStreams = exchangesToStream.map((e) => {
  return streamNormalized(e, normalizeBookChanges)
})

// combine all real-time message streams into one
const messages = combine(...realTimeStreams)

// create book snapshots with depth1 that are produced
// every time best bid/ask info is changed
// effectively computing real-time quotes
const realTimeQuoteComputable = computeBookSnapshots({
  depth: 1,
  interval: 0,
  name: 'realtime_quote'
})

// compute real-time quotes for combines real-time messages
const messagesWithQuotes = compute(messages, realTimeQuoteComputable)

const spreads = {}

// print spreads info every 100ms
setInterval(() => {
  console.clear()
  console.log(spreads)
}, 100)

// update spreads info real-time
for await (const message of messagesWithQuotes) {
  if (message.type === 'book_snapshot') {
    spreads[message.exchange] = {
      spread: message.asks[0].price - message.bids[0].price,
      bestBid: message.bids[0],
      bestAsk: message.asks[0]
    }
  }
}

Try this code live on RunKit


Seamless switching between real-time streaming and historical market data replay

Example showing simple pattern of providing async iterable of market data messages to the function that can process them no matter if it's is real-time or historical market data. That effectively enables having the same 'data pipeline' for backtesting and live trading.

const tardis = require('tardis-dev')
const { replayNormalized, streamNormalized, normalizeTrades, compute, computeTradeBars } = tardis

const historicalMessages = replayNormalized(
  {
    exchange: 'bitmex',
    symbols: ['XBTUSD'],
    from: '2019-08-01',
    to: '2019-08-02'
  },
  normalizeTrades
)

const realTimeMessages = streamNormalized(
  {
    exchange: 'bitmex',
    symbols: ['XBTUSD']
  },
  normalizeTrades
)

async function produceVolumeBasedTradeBars(messages) {
  const withVolumeTradeBars = compute(
    messages,
    computeTradeBars({
      kind: 'volume',
      interval: 100 * 1000 // aggregate by 100k contracts volume
    })
  )

  for await (const message of withVolumeTradeBars) {
    if (message.type === 'trade_bar') {
      console.log(message.name, message)
    }
  }
}

await produceVolumeBasedTradeBars(historicalMessages)

// or for real time data
//  await produceVolumeBasedTradeBars(realTimeMessages)

Try this code live on RunKit


Stream real-time market data in exchange native data format

const { stream } = require('tardis-dev')

const messages = stream({
  exchange: 'bitmex',
  filters: [
    { channel: 'trade', symbols: ['XBTUSD'] },
    { channel: 'orderBookL2', symbols: ['XBTUSD'] }
  ]
})

for await (const message of messages) {
  console.log(message)
}

Try this code live on RunKit


Replay historical market data in exchange native data format

const { replay } = require('tardis-dev')

const messages = replay({
  exchange: 'bitmex',
  filters: [
    { channel: 'trade', symbols: ['XBTUSD'] },
    { channel: 'orderBookL2', symbols: ['XBTUSD'] }
  ],
  from: '2019-05-01',
  to: '2019-05-02'
})

for await (const message of messages) {
  console.log(message)
}

Try this code live on RunKit



See the tardis-dev docs for more examples.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].