A standalone Flask application for visualizing real-time option chain data built on top of OpenAlgo API and WebSockets.
- Real-time Data: Live option chain updates via Server-Sent Events (SSE).
- Market Depth: View Bid/Ask quantities and spreads.
- Dynamic Expiries: Automatically fetches and caches expiry dates for NIFTY, BANKNIFTY, and SENSEX.
- Calculated Metrics: Real-time PCR (Put-Call Ratio) and Volume analysis.
- Responsive UI: Modern interface built with DaisyUI and Tailwind CSS.
- Python 3.10+
- OpenAlgo API Key (and running OpenAlgo instance)
-
Clone the repository:
git clone https://github.com/marketcalls/option-chain cd option-chain -
Create a virtual environment:
Windows:
python -m venv venv venv\Scripts\activate
macOS/Linux:
python3 -m venv venv source venv/bin/activate -
Install uv (recommended):
pip install uv
-
Install dependencies: Method 1: Using uv (Recommended) Dependencies will be automatically installed when running the app.
Method 2: Using requirements.txt
pip install -r requirements.txt
Method 3: Using pyproject.toml
pip install .
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand configure your settings:SECRET_KEY=your_secret_key_here OPENALGO_API_KEY=your_openalgo_api_key OPENALGO_HOST=http://127.0.0.1:5000 OPENALGO_WS_URL=ws://127.0.0.1:8765
-
Start the application using uv:
uv run app.py
-
Or using standard python:
python app.py
-
Access the Option Chain: Open your browser and navigate to
http://127.0.0.1:5800.
app.py: Main Flask application entry point.utils/: Helper modules for API interaction, WebSocket management, and option chain logic.templates/: HTML templates (Jinja2).static/: Static assets (CSS, JS).
This project is licensed under the MIT License - see the LICENSE file for details.
