Summary of CBOE Book Viewer Collector
This document provides a detailed overview of the CBOE Book Viewer Collector, a system designed to continuously monitor and collect market data for the SPY symbol on the EDGX venue. The collector operates 24/7, polling data at specified intervals and storing it in various formats for analysis.
Key Features
- Continuous Operation: The collector runs continuously, polling data every second during market hours (04:00 to 20:00 New York time).
- Data Storage: It writes CSV files every second during live sessions and JSON files every minute, along with immediate writes when data quality changes occur.
- Session Management: The system distinguishes between different market sessions (Closed, Early, Pre-Market, Regular, After-Hours) and adjusts its polling frequency accordingly.
- Error Handling: The collector is designed to recover from browser or page failures by recreating the browser session as needed.
Technical Specifications
The collector is implemented in C# and utilizes the Playwright library for browser automation. Key components include:
- Polling Intervals: 1 second during open sessions and 60 seconds during closed sessions.
- Data Freshness: Data is flagged as stale if it is older than 600 seconds.
- Viewport Settings: The browser is set to a specific viewport size to ensure proper rendering of the CBOE page.
Data Collection Process
The data collection process involves several steps:
- Establish a browser session and navigate to the CBOE Book Viewer URL.
- Dismiss any cookie banners and select the appropriate venue for data collection.
- Capture the DOM snapshot of the market data and parse it to extract relevant information such as best bids, asks, and trade prints.
- Store the captured data in both CSV and JSON formats for further analysis.
Error Handling and Recovery
The system includes robust error handling mechanisms to ensure continuous operation:
- It monitors for stale connections and automatically reloads the page if no activity is detected for a specified duration.
- In case of exceptions, the collector logs the error and attempts to recreate the browser session.
Conclusion
The CBOE Book Viewer Collector is a sophisticated tool designed for real-time market data collection, providing valuable insights into market dynamics for the SPY symbol on the EDGX venue. Its continuous operation, combined with effective error handling and data management strategies, makes it a vital component for traders and analysts seeking to understand market behavior.