feat(market): parse is_block_trade on public trades#48
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream API sync — Kalshi changelog 2026-05-29
Kalshi's 2026-05-29 changelog adds
is_block_tradetoGET /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
PublicTrade::is_block_trade— defaultsfalse; absent on older payloads, so backward/forward compatible (no behavioural change for existing consumers).get_tradesbody parser into a testableapi_detail::parse_trades_response, matching the existingparse_deposits_response/parse_withdrawals_responseconvention. Previously the public-trades parse was inline and untested.test_response_parsers.cpp::TradesParseBlockTradeFlagcovers present→true, absent→false, plus the otherPublicTradefields.Verification
make build && make test && make lintall green locally — 164/164 tests pass, format check + cpp_auto_audit clean.Notes
tradeframe does not currently carry the field, per the captured production frame intest_ws_parser.cpp); WS sync deferred until upstream adds it there.get_endpoint_costs().