Data Infrastructure
How data flows from the market to your screen
Architecture Overview
The Ohey platform uses a multi-layer data pipeline to process raw options data and deliver it to the frontend. There are two primary data delivery modes, each optimized for different use cases.
All 24+ windows support HTTP data fetching. The frontend's Data Abstraction Layer requests processed options data from the API, which queries Redis-backed caches. Data refreshes on user action or automatic polling intervals.
12 WebSocket windows stream live data over a persistent WebSocket connection. Updates arrive as they are computed, requiring no manual refresh. Ideal for watching real-time shifts in gamma exposure, dealer positioning, and vol pressure.
Data Abstraction Layer
The frontend's Data Abstraction Layer (DAL) is a unified interface that every window uses to request data. It handles endpoint selection, authentication, error recovery, and response normalization so that individual windows don't need to manage API details.
- Endpoint abstraction: Windows request data by function name (e.g., "gamma exposure", "iv surface") rather than raw URLs. The DAL routes to the correct API endpoint.
- JWT authentication: Every request includes a JSON Web Token. The backend validates the token and checks tier authorization before returning data.
- Response normalization: The DAL transforms raw API responses into consistent structures that the charting and metric-card rendering systems expect.
- Error handling: Failed requests are retried with backoff. If the API returns a tier restriction, the window renders an upgrade prompt instead of crashing.
WebSocket Connection
WebSocket-enabled windows connect to a single endpoint per symbol:
wss://{host}/ws/gamma-compact/{symbol}?token={jwt}
The server pushes a compact JSON payload on each update cycle. Each WS window extracts the fields it needs from this shared message — GammaPulse reads totalCallGex and totalPutGex, PinMap reads magnetStrike and spotPrice, and so on.
Reconnection Logic
If the connection drops, the client automatically reconnects using exponential backoff:
| Parameter | Value |
|---|---|
| Base delay | 3 seconds |
| Multiplier | 1.5× |
| Maximum delay | 60 seconds |
| Maximum retries | 10 |
After 10 failed reconnection attempts, the window displays a connection error state. Refreshing the page resets the counter.
WebSocket Windows
The following 12 windows use WebSocket streaming (all require Pro tier):
| Window | Key Metrics Consumed |
|---|---|
| Gammatrix | Full gamma chain grid — per-strike GEX, delta, OI, IV (hybrid: also available via HTTP) |
| GammaPulse | totalCallGex, totalPutGex, netGex, aboveSpotGex, belowSpotGex |
| PinMap | magnetStrike, spotPrice, distanceToMagnet |
| VolCube | Top 10 strikes by absolute gamma concentration — magnet and barrier zones |
| SkewSentinel | Average IV skew metric |
| ThetaForge | Σ(callTheta + putTheta) / 1000 — aggregate K/day |
| FlipTrack | Gamma flip strikes, magnitudes, nearest flip to spot |
| FlowRate | Direction (bullish/bearish), magnitude, flow type |
| EigenHedge | PC1 Level, PC2 Slope, PC3 Curvature |
| VolEntropy | Shannon entropy of IV distribution |
| RegimeShift | Regime label, confidence ratio, strategy implications |
| IV Surface | 3D implied volatility surface across strikes and expirations (hybrid: also available via HTTP) |
HTTP Windows
The remaining windows use HTTP data fetching. These windows request data on load and when you change the ticker, expiration, or chart type. They include both Free Tier and Pro-tier windows:
Gammatrix and IV Surface are hybrid windows — they load initial data via HTTP and can also receive live updates via WebSocket. PulseDeck embeds 10 WebSocket modules internally but launches via HTTP data fetch.
Authentication & Authorization
Every API and WebSocket request is authenticated and authorized:
- JWT tokens: Issued on login, included in every request header and WebSocket query parameter. Tokens contain the user's tier level and are validated server-side.
- Tier enforcement: The backend checks the JWT's tier claim before returning data. Requesting a Pro-only window with a Free Tier token returns a 403 response with an upgrade message.
- Concurrent window limits: Free Tier accounts can open 5 windows simultaneously; Pro accounts can open 25. The frontend enforces this, and the backend tracks active connections.
Backend Processing
The backend pipeline processes raw options chain data into the computed metrics that windows display:
Data Ingestion: Raw options chain data (strikes, expirations, Greeks, IV, OI, volume) is sourced from Polygon.io market data API, which aggregates exchange data from OPRA (Options Price Reporting Authority). Data is normalized and stored in Redis.
Computation: Gamma exposure, delta-weighted OI, IV surfaces, dealer hedging pressure, and other derived metrics are computed from the raw chains.
Delivery: HTTP endpoints serve computed data on request. The WebSocket server pushes compact JSON payloads for real-time windows on each update cycle.
Rendering: The frontend receives the data, passes it through the DAL, and renders it using Chart.js (2D charts — bar, line, area, scatter, step, bubble, heat map) or Three.js (3D IV Surface) visualizations.
Connection Status
WebSocket windows display a live connection indicator:
| Indicator | Meaning |
|---|---|
| ● Connected | WebSocket is active and receiving data. |
| ● Reconnecting | Connection dropped. Automatically retrying with exponential backoff. |
| ● Disconnected | All retry attempts exhausted. Refresh the page to reconnect. |
Stale Data Handling
The platform includes safeguards against displaying outdated data:
- WebSocket heartbeat: The server sends periodic keep-alive messages. If no message is received within the expected window, the client initiates reconnection.
- HTTP cache invalidation: HTTP responses include cache-control headers. The DAL discards cached data when a new ticker or expiration is selected.
- Market hours awareness: Windows indicate when data was last updated. Outside U.S. equity market hours (09:30 -- 16:00 ET), data reflects the most recent closing snapshot rather than live feed.
Data Update Frequency
Update cadence varies by delivery method and market conditions:
| Delivery Method | Update Cadence | Notes |
|---|---|---|
| WebSocket streaming | Per computation cycle (typically seconds) | Server pushes on each completed computation cycle. Frequency depends on market activity, ticker popularity, and server load. During off-peak times, cycles may be less frequent. |
| HTTP auto-refresh | Configurable (15–60 seconds) | User-adjustable polling interval. Lower intervals increase API load; the platform throttles to prevent abuse. |
| HTTP on-demand | On user action | Data fetched when a window opens, or when the user changes ticker, expiration, or chart parameters. |