Created
October 26, 2020 13:21
-
-
Save thaaddeus/cdb2078e6429696926cd35cc2440d022 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install tardis-client | |
import asyncio | |
from tardis_client import TardisClient, Channel | |
tardis_client = TardisClient(api_key="YOUR_API_KEY") | |
async def replay(): | |
messages = tardis_client.replay( | |
exchange="binance-futures", | |
from_date="2020-10-01", | |
to_date="2020-10-02", | |
filters=[Channel(name="aggTrade", symbols=["btcusdt"])] | |
) | |
# messages as provided by Binance USDT Futures real-time stream | |
async for local_timestamp, message in messages: | |
# for the sake of example, just print the message | |
# you can add the code here to map the message to different shape and save it | |
print(message) | |
asyncio.run(replay()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment