基于区块链的毕业设计tardis-dev – 塔迪斯德夫

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计tardis-dev – 塔迪斯德夫 是一篇很好的国外资料

tardis-dev

tardis-dev - 塔迪斯德夫 tardis-dev - 塔迪斯德夫

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) }

tardis-dev - 塔迪斯德夫

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)

  • seamless switching between real-time streaming and historical market data replay thanks to async iterables providing unified way of consuming data messages

  • 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

  • combining multiple exchanges feeds into single one via combine helper function — synchronized historical market data replay and consolidated real-time data streaming from multiple exchanges

  • 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.

  • full limit order book reconstruction both for real-time and historical data via OrderBook object

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

  • extensible mapping logic that allows adjusting normalized formats for specific needs

  • built-in TypeScript support

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]     }   } }

tardis-dev - 塔迪斯德夫

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)

tardis-dev - 塔迪斯德夫

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) }

tardis-dev - 塔迪斯德夫

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) }

tardis-dev - 塔迪斯德夫

See the tardis-dev docs for more examples.


tardis dev

<tardis-dev>><tardis-dev>

节点.jstardis dev library提供了方便的访问tick级别的实时和历史加密货币市场数据,包括exchange原生格式和标准化格式。它不依赖于回调,而是依赖于异步迭代(用于await…of),从而支持诸如实时数据流和历史数据回放之间的无缝切换,或者本地计算派生数据。

tardis-dev - 塔迪斯德夫

历史分档位市场数据回放支持塔迪斯·德夫HTTP API-包括完整的订单深度快照和增量更新、逐点交易、历史未平仓利率、融资、指数、标记价格,清算和更多

整合的实时数据流API直接连接到交易所的公共WebSocket API

需要节点.jsv12+已安装。

演示如何同时在多个交易所快速显示实时价差和最佳买卖信息的示例。它可以很容易地适应于对历史数据执行相同的操作(replynormalized而不是streamNormalized)。

tardis-dev - 塔迪斯德夫

示例显示了一种简单的模式,即向可以处理这些消息的函数提供不同步的市场数据消息,而不管它是实时的还是历史的市场数据。这就有效地为回溯测试和实时交易提供了相同的“数据管道”。

tardis-dev - 塔迪斯德夫

tardis-dev - 塔迪斯德夫

<tardis-dev>

tardis dev

特性

安装

文档

参见官方文档。

示例

在实时流和历史市场数据回放之间无缝切换

以exchange原生数据格式流式传输实时市场数据

以exchange原生数据格式重播历史市场数据

请参阅tardis dev文档更多例子。

  • 历史记录的市场数据回放支持塔迪斯·德夫HTTP API-包括完整的订单深度快照和增量更新、逐点交易、历史未平仓利率、融资、指数、标记价格,清算和其他
  • 整合实时数据流API,直接连接到交易所的公共WebSocket API
  • 支持交易所本地和标准化市场数据格式(用于访问所有受支持交易所的市场数据的统一格式-标准化交易、订单和股票数据)
  • 由于异步iterables提供统一的数据消息消费方式,在实时流和历史市场数据回放之间实现无缝切换
  • 透明的历史本地数据缓存(缓存的数据以压缩的GZIP格式存储在磁盘上,在读取数据时按需解压缩)
  • 支持顶级加密货币交易所:BitMEX、Deribit、Binance、FTX、OKEx、Huobi Futures、霍比全球、Bitfinex、Coinbase Pro、Kraken期货、Kraken、Bitstamp、Gemini、Poloniex、Bybit、Phemex、Delta Exchange、FTX US、Binance US,门.io,OKCoin、bitFlyer、HitBTC、CoinFLEX(2.0)、Binance Jersey等
  • 自动关闭连接和过时实时数据流的连接重新连接逻辑
  • 通过组合辅助功能将多个交易所合并为一个交易所-同步历史市场数据回放和来自多个交易所的合并实时数据流
  • 计算本地衍生数据,如订单不平衡、自定义交易条、,通过compute helper函数和computables(例如基于卷的条形图)预订快照和更多内容,每10毫秒拍摄一次的前20级订单簿快照等。
  • 通过OrderBook对象为实时和历史数据进行全面限制的订单重建
  • 快速而轻量级的体系结构-低内存占用和无大量内存缓冲
  • 可扩展映射逻辑,允许调整规范化格式针对特定需求
  • 内置TypeScript支持
  • 节点.jstardis dev library提供了方便的访问tick级别的实时和历史加密货币市场数据,包括exchange原生格式和标准化格式。它不依赖于回调,而是依赖于异步迭代(用于await…of),从而支持诸如实时数据流和历史数据回放之间的无缝切换,或者本地计算派生数据。

    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) }

    tardis-dev - 塔迪斯德夫

    特性

    • 历史记录的市场数据回放支持塔迪斯·德夫HTTP API-包括完整的订单深度快照和增量更新、逐点交易、历史未平仓利率、融资、指数、标记价格,清算和其他
    • 整合实时数据流API,直接连接到交易所的公共WebSocket API

    • 支持交易所本地和标准化市场数据格式(用于访问所有受支持交易所的市场数据的统一格式-标准化交易、订单和股票数据)

    • 由于异步iterables提供统一的数据消息消费方式,在实时流和历史市场数据回放之间实现无缝切换

    • 透明的历史本地数据缓存(缓存的数据以压缩的GZIP格式存储在磁盘上,在读取数据时按需解压缩)

    • 支持顶级加密货币交易所:BitMEX、Deribit、Binance、FTX、OKEx、Huobi Futures、霍比全球、Bitfinex、Coinbase Pro、Kraken期货、Kraken、Bitstamp、Gemini、Poloniex、Bybit、Phemex、Delta Exchange、FTX US、Binance US,门.io,OKCoin、bitFlyer、HitBTC、CoinFLEX(2.0)、Binance Jersey等

    • 自动关闭连接和过时实时数据流的连接重新连接逻辑

    • 通过组合辅助功能将多个交易所合并为一个交易所-同步历史市场数据回放和来自多个交易所的合并实时数据流

    • 计算本地衍生数据,如订单不平衡、自定义交易条、,通过compute helper函数和computables(例如基于卷的条形图)预订快照和更多内容,每10毫秒拍摄一次的前20级订单簿快照等。

    • 通过OrderBook对象为实时和历史数据进行全面限制的订单重建

    • 快速而轻量级的体系结构-低内存占用和无大量内存缓冲

    • 可扩展映射逻辑,允许调整规范化格式针对特定需求

    • 内置TypeScript支持

    文档

    需要节点.jsv12+已安装。

    npm install tardis-dev --save

    参见官方文档。

    示例

    在实时流和历史市场数据回放之间无缝切换

    以exchange原生数据格式流式传输实时市场数据

    演示如何同时在多个交易所快速显示实时价差和最佳买卖信息的示例。它可以很容易地适应于对历史数据执行相同的操作(replynormalized而不是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]     }   } }

    tardis-dev - 塔迪斯德夫

    以exchange原生数据格式重播历史市场数据

    tardis-dev - 塔迪斯德夫

    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)

    示例显示了一种简单的模式,即向可以处理这些消息的函数提供不同步的市场数据消息,而不管它是实时的还是历史的市场数据。这就有效地为回溯测试和实时交易提供了相同的“数据管道”。

    请参阅tardis dev文档更多例子。

  • 历史记录的市场数据回放支持塔迪斯·德夫HTTP API-包括完整的订单深度快照和增量更新、逐点交易、历史未平仓利率、融资、指数、标记价格,清算和其他
  • 整合实时数据流API,直接连接到交易所的公共WebSocket API
  • 支持交易所本地和标准化市场数据格式(用于访问所有受支持交易所的市场数据的统一格式-标准化交易、订单和股票数据)
  • 由于异步iterables提供统一的数据消息消费方式,在实时流和历史市场数据回放之间实现无缝切换
  • 透明的历史本地数据缓存(缓存的数据以压缩的GZIP格式存储在磁盘上,在读取数据时按需解压缩)
  • 支持顶级加密货币交易所:BitMEX、Deribit、Binance、FTX、OKEx、Huobi Futures、霍比全球、Bitfinex、Coinbase Pro、Kraken期货、Kraken、Bitstamp、Gemini、Poloniex、Bybit、Phemex、Delta Exchange、FTX US、Binance US,门.io,OKCoin、bitFlyer、HitBTC、CoinFLEX(2.0)、Binance Jersey等
  • 自动关闭连接和过时实时数据流的连接重新连接逻辑
  • 通过组合辅助功能将多个交易所合并为一个交易所-同步历史市场数据回放和来自多个交易所的合并实时数据流
  • 计算本地衍生数据,如订单不平衡、自定义交易条、,通过compute helper函数和computables(例如基于卷的条形图)预订快照和更多内容,每10毫秒拍摄一次的前20级订单簿快照等。
  • 通过OrderBook对象为实时和历史数据进行全面限制的订单重建
  • 快速而轻量级的体系结构-低内存占用和无大量内存缓冲
  • 可扩展映射逻辑,允许调整规范化格式针对特定需求
  • 内置TypeScript支持
  • 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) }

    tardis-dev - 塔迪斯德夫

    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) }

    tardis-dev - 塔迪斯德夫

    See the tardis-dev docs for more examples.

    部分转自网络,侵权联系删除区块链源码网

    www.interchains.cc

    https://www.interchains.cc/16347.html

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计tardis-dev – 塔迪斯德夫

    提供最优质的资源集合

    立即查看 了解详情