Skip to content

feat(market): parse is_block_trade on public trades#48

Merged
Reddimus merged 1 commit into
mainfrom
feat/public-trade-is-block-trade
Jun 3, 2026
Merged

feat(market): parse is_block_trade on public trades#48
Reddimus merged 1 commit into
mainfrom
feat/public-trade-is-block-trade

Conversation

@Reddimus

@Reddimus Reddimus commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Upstream API sync — Kalshi changelog 2026-05-29

Kalshi's 2026-05-29 changelog adds is_block_trade to GET /markets/trades (and /historical/trades): "public trade responses now identify block trades and support filtering by block status." Block trades are large negotiated prints routed off the central order book, so trade-flow / microstructure consumers should be able to distinguish them from order-book activity.

Changes

  • Add PublicTrade::is_block_trade — defaults false; absent on older payloads, so backward/forward compatible (no behavioural change for existing consumers).
  • Refactor (durable): extracted the inline get_trades body parser into a testable api_detail::parse_trades_response, matching the existing parse_deposits_response / parse_withdrawals_response convention. Previously the public-trades parse was inline and untested.
  • Test: test_response_parsers.cpp::TradesParseBlockTradeFlag covers present→true, absent→false, plus the other PublicTrade fields.

Verification

make build && make test && make lint all green locally — 164/164 tests pass, format check + cpp_auto_audit clean.

Notes

  • REST-only surface (the live WS trade frame does not currently carry the field, per the captured production frame in test_ws_parser.cpp); WS sync deferred until upstream adds it there.
  • Endpoint rate-limit cost changes (Kalshi 2026-05-25 / 06-01) need no action — kalshi-cpp fetches costs live via get_endpoint_costs().

Kalshi's 2026-05-29 changelog adds is_block_trade to GET /markets/trades
responses (public trade responses now flag block trades + support
filtering by block status). Block trades are large negotiated prints
routed off the central order book, so trade-flow / microstructure
consumers should be able to distinguish them from order-book activity.

- Add PublicTrade::is_block_trade (defaults false; absent on older
  payloads, so backward/forward compatible).
- Extract the inline get_trades body parser into a testable
  api_detail::parse_trades_response, matching the existing
  parse_deposits_response / parse_withdrawals_response convention.
- test_response_parsers.cpp covers the flag (present->true, absent->
  false) plus the other PublicTrade fields.

Verified locally: make build && make test (164/164) && make lint green.
@Reddimus Reddimus merged commit cf563eb into main Jun 3, 2026
4 checks passed
@Reddimus Reddimus deleted the feat/public-trade-is-block-trade branch June 3, 2026 03:59
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.

1 participant