nkaz001 / collect-binancefutures

Collect BinanceFutures's trade and orderbook(depth) feeds.
94 stars 27 forks source link
binance collector feeds orderbook-tick-data orderbook-websocket

This project moved to https://github.com/nkaz001/hftbacktest/tree/master/collector

Binance feed collector

Requirements

Python3: run by python3 command.
aiohttp: pip3 install aiohttp

Run

collect.sh [exchange] [symbols separated by comma.] [output path]
example: collect.sh binancefutures btcusdt,ethusdt /mnt/data

Exchanges

AWS tokyo region is recommended to minimize latency.

Converter: feed data to Pandas Dataframe pickle file

Requirements

Python3: run by python3 command.
pandas: pip3 install pandas

Run

`convert.sh [-s INITIAL_MARKET_DEPTH_SNAPSHOT] [-f] [-c] src_file dst_path

option:
with -f: including mark price, funding, book ticker streams
without -f: only market depth and trade streams
with -c: correct exchange timestamp to be monotonically increased

example:
convert.sh /mnt/data/btcusdt_20220811.dat /mnt/data
or with the initial market depth snapshot
convert.sh /mnt/data/btcusdt_20220811.dat /mnt/data -s /mnt/data/btcusdt_20220810.snapshot.pkl

/mnt/data/btcusdt_20220810.snapshot.pkl is End-Of-Day market depth snapshot of 20220810 so it's initial market depth snapshot of 20220811.