Skip to content

Un-park the options view: it is written and tested, just not wired up #1

Description

@Ben05-sys

app/options.py and app/providers/cboe.py build full option chains — delta, gamma, theta, vega, rho, implied volatility and open interest — plus an unusual-activity ranking that finds contracts trading above their entire open interest. It works. tests/test_options.py covers it with 34 passing assertions.

It is just not reachable. The view was taken back out of the terminal as too much at the time, and never went back in. grep -c "api/options" app/server.py returns 0.

So this is a route and a view, not a rewrite.

What it needs

  1. A route in app/server.py — follow _market_news or the new _livetv as the shape. Both cache their payload with strip_cache/store_strip because the upstream is slow relative to how often the UI asks.
  2. A view in app/web/index.html — a tab, a view-options div, a loader, and a draw function. view-earnings is the closest existing model: a table of rows grouped by a key.
  3. Register the key in the keys map near the bottom of index.html and add the tab to the rail. ui_smoke.js asserts the tab count, so update that number in the same PR.

The functions you are wiring

options.chain(symbol, expiry=None, strikes=16)   # one expiry, strikes around spot
options.stats(contracts, expiry=None)            # put/call ratio, IV summary
options.unusual(symbol, min_volume=...)          # volume above open interest

Rules that bite here

  • Cboe data is delayed and the panel must say so. House rule 1: never claim live over stale. The existing panels render DELAYED and mean it.
  • A greek that cannot be computed stays null. Do not default a missing IV to zero — see house rule 2 in CONTRIBUTING.md.
  • Run node tests/ui_smoke.js — it is the only thing that catches a runtime throw at page load.

Good first issue because the hard half — the maths, the provider, the tests — is already done and reviewed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions