This project is an implementation of an order book (DOM) with a real-time visualization interface using Plotly Dash. The data is sourced from ByBit's open API, providing live and authentic market information.
- Real-time Data: Continuously updated market data fetched from ByBit API.
- All Market Pairs: Automatically retrieves all available market pairs from the API.
- Customizable Settings: Easy to adjust settings.
- Python >= 3.12
- Dependencies listed in
pyproject.toml
- Clone the repository.
- Install dependencies using
poetry install. - Run the application:
make run.
The application includes a range of configurable settings to tailor its behavior and display. Below is a detailed explanation of each:
APP_DEBUG: Enables or disables debug mode for development purposes.
Default:TrueAPP_PORT: Specifies the port where the Dash app runs.
Default:8050APP_UPDATE_INTERVAL_MS: The interval (in milliseconds) at which the order book data updates.
Default:3000(3 seconds)
API_URL: The base URL for the ByBit API.
Default:"https://api.bybit.com"API_ORDERS_LIMIT: Limits the number of orders fetched per request.
Default:200API_ORDERS_CATEGORY: Defines the trading category (spot,linear,inverse,option).
Default:"spot"
ORDERBOOK_LEVELS_TO_SHOW: Number of price levels to display in the order book visualization.
Default:10ORDERBOOK_AGGREGATION_LEVELS: Available price aggregation levels for grouping order book data.
Default:["0.01", "0.1", "1", "10", "100"]ORDERBOOK_QUANTITY_PRECISION: Precision options for displaying order quantities.
Default:["0", "1", "2", "3", "4"]ORDERBOOK_PRICE_PRECISION: Precision options for displaying prices.
Default:["0", "1", "2", "3", "4"]
Adjust these settings in the configuration file to suit your specific requirements. For example:
- Set
APP_UPDATE_INTERVAL_MSto1000for 1-second updates. - Increase
ORDERBOOK_LEVELS_TO_SHOWto visualize more price levels.
By tweaking these parameters, you can optimize the application for different datasets, user preferences, or system capabilities.
