Skip to content

[PRO-3269] Add the overnight field to MarketStatus - #1061

Merged
justinpolygon merged 2 commits into
masterfrom
justin/pro-3269
Dec 2, 2026
Merged

justinpolygon merged 2 commits into
masterfrom
justin/pro-3269

Conversation

@justinpolygon

@justinpolygon justinpolygon commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

/v1/marketstatus/now now returns overnight (bool, "Whether or not the market is in overnight hours (9:00 PM to 4:00 AM ET)"). During the overnight session the response has market: "extended-hours", earlyHours: false and afterHours: false, so overnight: true is the only way to tell that session apart. The Go, JS and JVM clients already have this field. Python models are written by hand, so this one has to be added manually.

  • MarketStatus gets overnight: Optional[bool], read from overnight.
  • The now.json fixture now has "overnight": false, matching what the API returns outside the session.
  • A new test deserializes an overnight-session payload. It calls MarketStatus.from_dict directly, because the mock tree serves one fixture per URL.

The snapshot overnight fields (overnight_trading_change, overnight_trading_change_percent) are already in massive/rest/models/snapshot.py. market_status is a plain string, so the new overnight_trading value already parses. Neither needs a change.

Needs a release before the 2026-12-06 cutover.

make lint and make test_rest pass.

/v1/marketstatus/now now returns overnight (bool). During the overnight
session (9:00 PM to 4:00 AM ET), market is "extended-hours" and both
earlyHours and afterHours are false, so overnight is the only way to
tell that session apart.
@justinpolygon
justinpolygon merged commit 7d63eee into master Dec 2, 2026
7 checks passed
@justinpolygon
justinpolygon deleted the justin/pro-3269 branch December 2, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants