How ajslashtracey/obdeltadata works
The project is a specialized trading bot focused on processing orderbook data to calculate a “delta” over a 5% orderbook depth from Coinbase. The code and data in this project are clearly oriented toward ingesting live orderbook logs, processing these logs to calculate important metrics (like delta values), and storing both raw and calculated data for further analysis and strategy development.
Main Components
• Data Source & Exchange Interface:
• Coinbase, which is the origin of the orderbook data.
• The OBfetch.py module, which encapsulates functionality that fetches the full orderbook (all resting orders) and calculates the delta.
• Data Ingestion & Processing:
• OBfetch.py acts as the ingestion engine. It gathers live data and computes key metrics.
• The calculations include deriving the orderbook delta and possibly additional measures (e.g., EMA delta handling shown in the “deltaEmaPrice” directory).
• Data Storage:
• Various CSV files in the project represent different stages and calculations:
• “1%delta” and “5%delta” directories: Likely holding raw or pre-processed delta data with different thresholds.
• “bs” directory: Contains “EmaDeltaPriceTime.csv”, potentially explaining another analysis layer or a signal generation module.
• “deltaEmaPrice” directory: Contains both deployment and test strategy CSVs, plus additional price data exports.
• “ohcl” directory: Contains “converted_price_data.csv”, possibly modeling transformed pricing data into OHLC format.
• Additional CSV files like “2019.csv” and files in these directories point to historical data and backtesting resources.
• Visualization & Quality Check:
• The README embeds links to screenshots that show both data previews and delta quality check visualizations. This indicates that a component (perhaps external to the core scripts) is responsible for visual quality controls.
Relationships and Interactions
• The OBfetch.py module directly interfaces with Coinbase to retrieve orderbook data.
• Once fetched, the data is processed (calculating deltas) and then saved into multiple CSV files organized by the percentage depth or analytic purpose (e.g., “1%delta”, “5%delta”).
• Downstream, the strategy-related modules (within the “deltaEmaPrice” and “bs” directories) might use these processed files to compute trading signals or validate strategy performance.
• The “ohcl” module appears to convert price data from its raw form into OHLC format, perhaps for charting or further analysis.
• The data visualization aspect, as hinted by the README screenshots, provides feedback on the delta's quality and the underlying data integrity.
Architectural Patterns and Design Principles
• Modular Design: Each directory groups related functionalities—data collection, processing, analysis, and visualization.
• Separation of Concerns: Data ingestion (OBfetch.py) is kept distinct from data storage (CSV files) and analysis components.
• Data Pipeline Flow: The system follows a clear pipeline—from data sourcing to processing and storage, with subsequent analysis layers built on top.
Technologies and Frameworks
• The project appears to use Python (as indicated by OBfetch.py) for the trading bot logic.
• CSV files are used extensively as a lightweight data storage mechanism.
• There is no web-based frontend or database server indicated here; the design is file-based and script-driven.
Inclusions
• Clear labels for each component (e.g., Coinbase API, OBfetch.py, CSV Repositories).
• Another for core processes (e.g., OBfetch.py).
• Separate markers for storage modules (CSV data repositories).