Real-time services to deploy in a docker container to aggregate live trades and build footprint candles. Supports Binance and Bybit (crypto).
Services:
- Binance Live.
- Bybit Live.
- Binance Backfiller.
-
Clone the repository:
git clone git@github.com:focus1691/orderflow.git
-
Set up a PostgreSQL TimescaleDB instance (Required):
docker run -d --name timescaledb -p 5433:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-latest
-
Configure environment variables:
DB_URL
SYMBOLS
(CSV. Defaults to all exchange symbols)
-
Build and Run the services:
docker-compose up --build -d binance
docker-compose up --build -d bybit
For historical data processing:
-
Set the following environment variables:
SYMBOLS
: Trading pair(s) to backfill for. Comma-separated values.BACKFILL_START_AT
: Start timestamp (ms)BACKFILL_END_AT
: End timestamp (ms)
-
Run the Binance Backfill service:
yarn start:binance-backfill