historical tick-level market data replay backed by Tardis.dev HTTP API — includes full order book depth snapshots plus incremental updates, trades, historical open interest, funding, index, mark prices, liquidations and more
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)
computing derived data locally like order book imbalance, customizable 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
tardis-dev lib uses debug package for verbose logging and debugging purposes that can be enabled via DEBUG environment variable set to tardis-dev*.
Usage with TypeScript
Simply change from require
to ES Modules import
to enjoy first class TypeScript typings.
Historical market data helpers
init(options)
This function doesn't affect real-time streaming functionality in any way, it's useful only for historical data replay.
When working with market data via replay and replayNormalized, by default only the first day of each month of historical data is available for replay, and locally cached historical data is stored in the default location on disk (OS temp dir).
Init function allows providing an apiKey received via email after ordering historical market data access via Tardis.dev website, as well as a custom cacheDir. apiKey can also be provided directly via options of replay and replayNormalized functions - that overrides anything that was provided via init.
init options
name
type
default
description
apiKey
string (optional)
undefined
API key for Tardis.dev HTTP API - if not provided only first day of each month of historical data is accessible
cacheDir
string
<os.tmpdir>/.tardis-cache
path to local dir that will be used as cache location - if not provided default temp dir for given OS will be used
getExchangeDetails(exchange)
Given exchange id provides exchange details (available symbols, availability dates, available channels, pricing info etc) provided by exchanges/:exchange API endpoint.
type of response returned by awaiting on getExchangeDetails
getApiKeyAccessInfo(apiKey?)
Given apiKey provided as optional parameter or provided in init function provides information about what historical data is available for it - exchanges, date ranges, symbols.
type of response returned by awaiting on getApiKeyAccessInfo()
clearCache()
Clears local data cache dir.
downloadDatasets(options)
Downloads CSV datasets for specified exchange, data types, symbols and date range. Handles pagination, retries and local file caching automatically.