Skip to content

openport 0.2.0

Choose a tag to compare

@38st 38st released this 26 Sep 02:00

openport 0.2.0

Built from 3ff3f95.

Install

  • Docker (amd64 and arm64): docker run --rm -p 127.0.0.1:8080:8080 -v openport:/var/lib/openport ghcr.io/38st/openport:0.2.0, or docker build -t openport . from this tag.
  • Linux archives (amd64 and arm64): need OpenSSL 3, zlib and zstd (apt install libssl3t64 zlib1g libzstd1 on Ubuntu 24.04). Unpack one and run bin/openportd.
  • macOS archive (Apple silicon): needs nothing installed. Unpack it with tar -xzf and run bin/openportd. Unpacked in Finder, macOS may refuse to run it as from an unidentified developer; xattr -dr com.apple.quarantine on the folder allows it. (Replaced on 2026-09-26 with this self-contained build of the same 0.2.0 code, which links OpenSSL and zstd statically; SHA256SUMS was updated with it.)

Then open http://127.0.0.1:8080. openportd --help lists every option. SHA256SUMS covers every archive.

What's new since 0.1.0

Market data

  • Cboe's new host. Cboe moved its delayed quotes from cdn.cboe.com to cdn-api.cboe.com in September 2026: the old host went stale on 2026-09-23, then answered with redirects. openport now reads the new host, and its HTTP client follows redirects (up to five, never from https down to http). Under 0.1.0 the chains fall back to Cboe's slower quote pages and the chart backfill fails, so this upgrade matters if you use the default data source.
  • IWM and DIA by default. openportd and the Docker image subscribe to SPX, SPY, QQQ, IWM and DIA.
  • Regular-session marks. Outside the session, stocks and ETFs are marked at their last regular close, not at after-hours prints.

Calendar, halts and settlement

  • Cboe's holiday schedule. openportd reads Cboe's published schedule at start and daily, so a special closure no longer needs a new build. --no-cboe-holidays turns it off.
  • Market-wide circuit breakers. The 7%, 13% and 20% levels of NYSE Rule 7.12 halt trading: orders reject with MARKET_HALTED, status and WebSocket ticks carry the state, the terminal shows a banner, and a halt survives a restart.
  • Official-close settlement. PM-settled options settle on Cboe's official close, revisions included, instead of the first print after 16:00.

Dividends and analytics

  • Dividends from Massive. --dividends massive reads cash dividends from Massive's API with MASSIVE_API_KEY.
  • Cash dividends in the American model. The binomial trees take known cash dividends (the escrowed model), which moves the early-exercise boundary of in-the-money calls before an ex-date.

Simulator rules

  • Slippage. slippage_ticks (0 to 10) fills every option that many ticks past the displayed far side.
  • Portfolio margin. margin: portfolio replaces strategy margin with a risk scan per underlying in the manner of Cboe Rule 12.4 and FINRA Rule 4210(g). The presets keep strategy margin and no slippage.

Fixes

  • Trading could stop after a restart. When an underlying's contract definitions reached the engine before any of its prices (Databento sends definitions first, as Massive and ThetaData do without an underlying price), its analytics were stamped with the wall clock, and an account with positions or orders rejected them as future-dated (INVALID_TIME), which disabled its trading until the next restart.
  • Resting orders wait out data gaps. An order whose quote arrived while the rest of the portfolio's marks or valuations were stale, as right after a stall, was cancelled with RISK_CHANGED. It now keeps working and fills once the data is complete.

Every commit since v0.1.0

  • Rules: a data gap holds a resting order's fill instead of cancelling it
  • Paper: analytics from before any price can no longer disable an account
  • Version 0.2.0
  • Cboe: read its delayed quotes from cdn-api.cboe.com, and follow redirects
  • Analytics: known cash dividends in the American exercise model
  • Rules: optional slippage, and portfolio margin
  • Halts: circuit-breaker state in status and ticks, kept across restarts, with a banner
  • Cboe: mark stocks and ETFs at their last regular close outside the session; trade IWM and DIA by default
  • Tests: brace the assertions GCC flags as a dangling else
  • Settlement: PM options settle on the official close, revisions included
  • Calendar: keep the first of two announced entries for a date, as documented
  • Dividends: read them from Massive's API with --dividends massive
  • Calendar and halts: Cboe's holiday schedule, and market-wide circuit breakers
  • README: start from the published image, ghcr.io/38st/openport