kalshi-cpp 0.8.0
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
ws_models.hpp
Go to the documentation of this file.
1// Generated by tools/codegen/generate.py from spec/asyncapi.yaml. Do not edit.
2#pragma once
3
4// WebSocket message types. They live in `kalshi::ws` because several share
5// names with REST models, such as `Trade` and `Fill`.
6
7#include "kalshi/models.hpp"
8
9#include <array>
10#include <cstdint>
11#include <optional>
12#include <string>
13#include <string_view>
14#include <variant>
15#include <vector>
16
17namespace kalshi::ws {
18
36
37[[nodiscard]] constexpr std::string_view to_string(Channel value) noexcept {
38 switch (value) {
40 return "orderbook_delta";
41 case Channel::Ticker:
42 return "ticker";
43 case Channel::Trade:
44 return "trade";
45 case Channel::Fill:
46 return "fill";
48 return "market_positions";
50 return "market_lifecycle_v2";
52 return "multivariate_market_lifecycle";
54 return "communications";
56 return "order_group_updates";
58 return "user_orders";
60 return "cfbenchmarks_value";
62 return "cfbenchmarks_value_5hz";
64 return "pyth_value";
66 break;
67 }
68 return "";
69}
70
72enum class CollateralReturnType : std::uint8_t {
73 Unknown,
74 MECNET,
75 DIRECNET,
76 Unset,
77};
78
79[[nodiscard]] constexpr std::string_view to_string(CollateralReturnType value) noexcept {
80 switch (value) {
82 return "MECNET";
84 return "DIRECNET";
86 return "";
88 break;
89 }
90 return "";
91}
92
102
103[[nodiscard]] constexpr std::string_view to_string(FeeTypeOverride value) noexcept {
104 switch (value) {
106 return "quadratic";
108 return "quadratic_with_maker_fees";
110 return "quadratic_with_combo_maker_fees";
112 return "flat";
114 return "margin_market_maker_program_fees";
116 break;
117 }
118 return "";
119}
120
136
137[[nodiscard]] constexpr std::string_view to_string(LastUpdateReason value) noexcept {
138 switch (value) {
140 return "Decrease";
142 return "Amend";
144 return "MarginCancel";
146 return "SelfTradeCancel";
148 return "ExpiryCancel";
150 return "CloseCancel";
152 return "HaltCancel";
154 return "Trade";
156 return "PostOnlyCrossCancel";
158 return "ReduceOnlyCancel";
160 return "SettlementBoundsCancel";
162 break;
163 }
164 return "";
165}
166
186
187[[nodiscard]] constexpr std::string_view to_string(LifecyclePriceLevelStructure value) noexcept {
188 switch (value) {
190 return "banded_centi_cent";
192 return "";
194 return "linear_cent";
196 return "deci_cent";
198 return "tapered_deci_cent";
200 return "center_whole_edge_half_cent";
202 return "center_whole_edge_quint_cent";
204 return "center_half_edge_half_cent";
206 return "center_half_edge_quint_cent";
208 return "center_half_edge_deci_cent";
210 return "center_quint_edge_quint_cent";
212 return "center_quint_edge_deci_cent";
214 return "center_centi_edge_centi_cent";
216 return "center_deci_edge_centi_cent";
218 break;
219 }
220 return "";
221}
222
224enum class MarketLifecycleV2EventType : std::uint8_t {
225 Unknown,
226 Created,
228 Activated,
230 Determined,
231 Settled,
233};
234
235[[nodiscard]] constexpr std::string_view to_string(MarketLifecycleV2EventType value) noexcept {
236 switch (value) {
238 return "created";
240 return "deactivated";
242 return "activated";
244 return "close_date_updated";
246 return "determined";
248 return "settled";
250 return "price_level_structure_updated";
252 break;
253 }
254 return "";
255}
256
258enum class MultivariateMarketLifecycleEventType : std::uint8_t {
259 Unknown,
260 Created,
262 Activated,
264 Determined,
265 Settled,
266};
267
268[[nodiscard]] constexpr std::string_view
270 switch (value) {
272 return "created";
274 return "deactivated";
276 return "activated";
278 return "close_date_updated";
280 return "determined";
282 return "settled";
284 break;
285 }
286 return "";
287}
288
290enum class OrderAction : std::uint8_t {
291 Unknown,
292 Buy,
293 Sell,
296 Unset,
297};
298
299[[nodiscard]] constexpr std::string_view to_string(OrderAction value) noexcept {
300 switch (value) {
301 case OrderAction::Buy:
302 return "buy";
304 return "sell";
306 return "sell_partial";
308 return "sell_to_close";
310 return "";
312 break;
313 }
314 return "";
315}
316
318enum class OrderGroupUpdatesEventType : std::uint8_t {
319 Unknown,
320 Created,
321 Triggered,
322 Reset,
323 Deleted,
325};
326
327[[nodiscard]] constexpr std::string_view to_string(OrderGroupUpdatesEventType value) noexcept {
328 switch (value) {
330 return "created";
332 return "triggered";
334 return "reset";
336 return "deleted";
338 return "limit_updated";
340 break;
341 }
342 return "";
343}
344
357
358[[nodiscard]] constexpr std::string_view to_string(UpdateAction value) noexcept {
359 switch (value) {
361 return "add_markets";
363 return "delete_markets";
365 return "get_snapshot";
367 return "subscribe_indices";
369 return "unsubscribe_indices";
371 return "indexlist";
373 return "subscribe_underlyings";
375 return "unsubscribe_underlyings";
377 return "underlying_list";
379 break;
380 }
381 return "";
382}
383
385enum class UpdateIntervalMs : std::int64_t {
386 Unknown = -1,
387 V0 = 0,
388 V100 = 100,
389 V1000 = 1000,
390};
391
392[[nodiscard]] constexpr std::string_view to_string(UpdateIntervalMs value) noexcept {
393 switch (value) {
395 return "0";
397 return "100";
399 return "1000";
401 break;
402 }
403 return "";
404}
405
407enum class UserFilter : std::uint8_t {
408 Unknown,
409 Unset,
410 Self,
411};
412
413[[nodiscard]] constexpr std::string_view to_string(UserFilter value) noexcept {
414 switch (value) {
416 return "";
417 case UserFilter::Self:
418 return "self";
420 break;
421 }
422 return "";
423}
424
428 std::int64_t id{0};
430
431 friend bool operator==(const Subscription&, const Subscription&) = default;
432};
433
435template <typename T>
436struct Update {
438 std::int64_t sid{0};
440 std::optional<std::int64_t> seq;
442 std::optional<std::int64_t> id;
444 std::int64_t subscription{0};
447 std::optional<std::int64_t> sending_ts_ms;
448};
449
452 std::string quote_id;
454 std::string rfq_id;
456 std::string market_ticker;
458 std::optional<std::string> event_ticker;
460 std::string yes_bid_dollars;
462 std::string no_bid_dollars;
464 std::optional<std::string> contracts_accepted_fp;
466 std::optional<std::string> yes_contracts_offered_fp;
468 std::optional<std::string> no_contracts_offered_fp;
470 std::optional<std::string> rfq_target_cost_dollars;
471};
472
476 std::string batch_quote_id;
478 std::string rfq_batch_id;
480 std::string quote_creator_id;
482 std::string rfq_creator_id;
486 std::string accepted_ts;
488 std::vector<BatchQuoteAcceptedQuotesItem> quotes;
490 std::optional<std::int64_t> subaccount;
491};
492
495 std::string quote_id;
497 std::string rfq_id;
499 std::string market_ticker;
501 std::optional<std::string> event_ticker;
503 std::string yes_bid_dollars;
505 std::string no_bid_dollars;
507 std::optional<std::string> yes_contracts_offered_fp;
509 std::optional<std::string> no_contracts_offered_fp;
511 std::optional<std::string> rfq_target_cost_dollars;
512};
513
517 std::string batch_quote_id;
519 std::string rfq_batch_id;
521 std::string quote_creator_id;
523 std::string created_ts;
525 std::vector<BatchQuoteCreatedQuotesItem> quotes;
527 std::optional<std::int64_t> subaccount;
528};
529
533 std::string batch_quote_id;
535 std::string rfq_batch_id;
537 std::string rfq_creator_id;
539 std::vector<std::string> executed_rfq_ids;
541 std::vector<std::string> failed_rfq_ids;
543 std::string executed_ts;
545 std::string close_reason;
547 std::optional<std::int64_t> subaccount;
548};
549
553 std::vector<std::string> index_ids;
554};
555
559 std::string value;
561 std::int64_t window_size{};
563 std::int64_t window_start_ts_ms{};
566};
567
571 std::vector<std::string> index_ids;
572};
573
577 std::string index_id;
579 std::int64_t received_at{};
581 std::string data;
586 std::optional<CfbenchmarksAvgData> last_60s_windowed_average_15min;
587};
588
592 std::string index_id;
594 std::string value_usd;
596 std::int64_t source_ts_ms{};
598 std::int64_t received_at{};
600 std::string data;
601};
602
606 std::string event_ticker;
608 std::optional<FeeTypeOverride> fee_type_override;
610 std::optional<double> fee_multiplier_override;
611};
612
616 std::string event_ticker;
618 std::int64_t exchange_index{};
620 std::string title;
622 std::string subtitle;
626 std::string series_ticker;
628 std::optional<std::int64_t> strike_date;
630 std::optional<std::string> strike_period;
631};
632
634struct Fill {
636 std::string trade_id;
638 std::string order_id;
640 std::optional<std::string> client_order_id;
642 std::string market_ticker;
644 std::int64_t exchange_index{};
646 bool is_taker{};
650 std::int64_t ts{};
652 std::int64_t ts_ms{};
654 std::string yes_price_dollars;
656 std::string count_fp;
658 std::string fee_cost;
662 std::string post_position_fp;
670 std::optional<std::int64_t> subaccount;
671};
672
675 std::string name;
676 std::string title;
677 std::string yes_sub_title;
679 std::string no_sub_title;
680 std::string rules_primary;
681 std::string rules_secondary;
683 std::string event_ticker;
685 std::optional<std::string> strike_type;
686 std::optional<double> floor_strike;
687 std::optional<double> cap_strike;
688 std::optional<RawJson> custom_strike;
689};
690
693 std::string start;
695 std::string end;
697 std::string step;
698};
699
704 std::string market_ticker;
706 std::optional<std::int64_t> exchange_index;
708 std::optional<std::int64_t> open_ts;
711 std::optional<std::int64_t> close_ts;
713 std::optional<std::int64_t> determination_ts;
715 std::optional<std::int64_t> settled_ts;
717 std::optional<std::string> result;
719 std::optional<std::string> settlement_value;
721 std::optional<bool> is_deactivated;
723 std::optional<LifecycleAdditionalMetadata> additional_metadata;
728 std::optional<LifecyclePriceLevelStructure> price_level_structure;
731 std::optional<std::vector<MarketLifecycleV2PriceRangesItem>> price_ranges;
732};
733
737 std::string market_ticker;
739 std::optional<std::string> strike_type;
741 std::optional<double> floor_strike;
743 std::optional<double> cap_strike;
746 std::optional<RawJson> custom_strike;
748 std::optional<std::string> yes_sub_title;
749};
750
754 std::string user_id;
756 std::string market_ticker;
758 std::string position_fp;
764 std::string fees_paid_dollars;
768 std::string volume_fp;
770 std::optional<std::int64_t> subaccount;
771};
772
777 std::string market_ticker;
779 std::optional<std::int64_t> exchange_index;
781 std::optional<std::int64_t> open_ts;
784 std::optional<std::int64_t> close_ts;
786 std::optional<std::int64_t> determination_ts;
788 std::optional<std::int64_t> settled_ts;
790 std::optional<std::string> result;
792 std::optional<std::string> settlement_value;
794 std::optional<bool> is_deactivated;
796 std::optional<LifecycleAdditionalMetadata> additional_metadata;
800 std::optional<LifecyclePriceLevelStructure> price_level_structure;
801};
802
808 std::string order_group_id;
810 std::optional<std::string> contracts_limit_fp;
812 std::int64_t ts_ms{};
813};
814
818 std::string market_ticker;
820 std::string market_id;
822 std::int64_t clock{};
824 std::string price_dollars;
826 std::string delta_fp;
830 std::optional<std::string> client_order_id;
833 std::optional<std::string> ts;
835 std::optional<std::int64_t> ts_ms;
837 std::optional<std::int64_t> subaccount;
838};
839
843 std::string market_ticker;
845 std::string market_id;
848 std::int64_t clock{};
850 std::optional<std::vector<std::array<std::string, 2>>> yes_dollars_fp;
852 std::optional<std::vector<std::array<std::string, 2>>> no_dollars_fp;
853};
854
858 std::vector<std::string> underlying_tickers;
859};
860
862struct PythValue {
864 std::string underlying_ticker;
866 std::string value_usd;
868 std::int64_t source_ts_ms{};
870 std::int64_t received_at{};
871};
872
876 std::string quote_id;
878 std::string rfq_id;
880 std::string quote_creator_id;
882 std::string rfq_creator_id;
884 std::string market_ticker;
886 std::optional<std::string> event_ticker;
888 std::string yes_bid_dollars;
890 std::string no_bid_dollars;
892 std::optional<kalshi::Side> accepted_side;
894 std::optional<std::string> contracts_accepted_fp;
896 std::optional<std::string> yes_contracts_offered_fp;
898 std::optional<std::string> no_contracts_offered_fp;
900 std::optional<std::string> rfq_target_cost_dollars;
902 std::optional<std::int64_t> subaccount;
903};
904
908 std::string quote_id;
910 std::string rfq_id;
912 std::string quote_creator_id;
914 std::string rfq_creator_id;
916 std::string market_ticker;
918 std::optional<std::string> event_ticker;
920 std::string yes_bid_dollars;
922 std::string no_bid_dollars;
924 std::optional<std::string> yes_contracts_offered_fp;
926 std::optional<std::string> no_contracts_offered_fp;
928 std::optional<std::string> rfq_target_cost_dollars;
930 std::string created_ts;
932 std::optional<std::int64_t> subaccount;
933};
934
938 std::string quote_id;
940 std::string rfq_id;
942 std::string quote_creator_id;
944 std::string rfq_creator_id;
946 std::string order_id;
948 std::string client_order_id;
950 std::string market_ticker;
952 std::string executed_ts;
954 std::optional<std::int64_t> subaccount;
956 std::optional<std::string> rfq_batch_id;
957};
958
961 std::string rfq_id;
963 std::string market_ticker;
965 std::optional<std::string> event_ticker;
967 std::optional<std::string> yes_bid_dollars;
969 std::optional<std::string> no_bid_dollars;
971 std::optional<std::string> contracts_fp;
973 std::optional<std::string> yes_contracts_offered_fp;
975 std::optional<std::string> no_contracts_offered_fp;
977 std::optional<std::string> rfq_target_cost_dollars;
978};
979
983 std::string rfq_batch_id;
985 std::optional<std::string> client_batch_id;
987 std::int64_t version{};
989 std::string updated_ts;
995 std::vector<RfqBatchBestQuotesRfqsItem> rfqs;
997 std::optional<std::int64_t> subaccount;
998};
999
1002 std::string event_ticker;
1004 std::string market_ticker;
1008 std::optional<std::string> yes_settlement_value_dollars;
1009};
1010
1013 std::string id;
1015 std::string market_ticker;
1017 std::optional<std::string> event_ticker;
1019 std::optional<std::string> contracts_fp;
1021 std::optional<std::string> target_cost_dollars;
1023 std::optional<std::string> mve_collection_ticker;
1025 std::vector<std::int64_t> leg_indices;
1026};
1027
1031 std::string id;
1033 std::string creator_id;
1035 std::string created_ts;
1037 std::vector<RfqBatchCreatedLegsItem> legs;
1039 std::vector<RfqBatchCreatedRfqsItem> rfqs;
1040};
1041
1045 std::string id;
1047 std::string creator_id;
1049 std::vector<std::string> rfq_ids;
1051 std::string deleted_ts;
1052};
1053
1057 std::string rfq_batch_id;
1059 std::optional<std::string> client_batch_id;
1061 std::string rfq_creator_id;
1063 std::vector<std::string> executed_rfq_ids;
1065 std::vector<std::string> failed_rfq_ids;
1067 std::string executed_ts;
1069 std::string close_reason;
1071 std::optional<std::int64_t> subaccount;
1072};
1073
1084
1088 std::string id;
1090 std::string creator_id;
1092 std::string market_ticker;
1094 std::optional<std::string> event_ticker;
1096 std::optional<std::string> contracts_fp;
1098 std::optional<std::string> target_cost_dollars;
1100 std::string created_ts;
1102 std::optional<std::string> mve_collection_ticker;
1104 std::optional<std::vector<RfqCreatedMveSelectedLegsItem>> mve_selected_legs;
1106 std::optional<std::string> rfq_batch_id;
1107};
1108
1112 std::string id;
1114 std::string creator_id;
1116 std::string market_ticker;
1118 std::optional<std::string> event_ticker;
1120 std::optional<std::string> contracts_fp;
1122 std::optional<std::string> target_cost_dollars;
1124 std::string deleted_ts;
1126 std::optional<std::string> rfq_batch_id;
1127};
1128
1132 std::optional<std::string> market_ticker;
1134 std::vector<std::string> market_tickers;
1137 std::optional<std::string> market_id;
1140 std::vector<std::string> market_ids;
1142 std::optional<bool> send_initial_snapshot;
1144 std::optional<bool> skip_ticker_ack;
1146 std::optional<bool> use_yes_price;
1148 std::optional<UpdateIntervalMs> update_interval_ms;
1150 std::optional<UserFilter> user_filter;
1152 std::optional<std::int64_t> shard_factor;
1154 std::optional<std::int64_t> shard_key;
1156 std::vector<std::string> index_ids;
1158 std::vector<std::string> underlying_tickers;
1159};
1160
1162struct Ticker {
1164 std::string market_id;
1166 std::string market_ticker;
1168 std::string price_dollars;
1170 std::string yes_bid_dollars;
1172 std::string yes_ask_dollars;
1174 std::string volume_fp;
1176 std::string open_interest_fp;
1178 std::int64_t dollar_volume{};
1180 std::int64_t dollar_open_interest{};
1182 std::string yes_bid_size_fp;
1184 std::string yes_ask_size_fp;
1188 std::int64_t ts{};
1190 std::int64_t ts_ms{};
1192 std::string time;
1193};
1194
1220
1224 std::optional<std::string> market_ticker;
1226 std::vector<std::string> market_tickers;
1228 std::optional<std::string> market_id;
1230 std::vector<std::string> market_ids;
1232 std::optional<bool> send_initial_snapshot;
1235 std::vector<std::string> index_ids;
1237 std::vector<std::string> underlying_tickers;
1238};
1239
1243 std::string order_id;
1245 std::string user_id;
1247 std::string ticker;
1249 std::int64_t exchange_index{};
1255 bool is_yes{};
1263 std::string fill_count_fp;
1267 std::string initial_count_fp;
1277 std::string client_order_id;
1279 std::optional<std::string> order_group_id;
1281 std::optional<kalshi::SelfTradePreventionType> self_trade_prevention_type;
1283 std::optional<std::string> created_time;
1285 std::optional<std::string> last_update_time;
1287 std::optional<std::string> expiration_time;
1289 std::optional<std::int64_t> expiration_ts_ms;
1291 std::optional<std::int64_t> created_ts_ms;
1293 std::optional<std::int64_t> last_updated_ts_ms;
1295 std::optional<LastUpdateReason> last_update_reason;
1297 std::optional<std::int64_t> subaccount_number;
1298};
1299
1303 std::int64_t sid{0};
1304 std::optional<std::int64_t> sending_ts_ms;
1305};
1306
1310 std::optional<std::int64_t> sending_ts_ms;
1311};
1312
1315struct Updated {
1317 std::vector<std::string> market_tickers;
1318 std::vector<std::string> market_ids;
1319 std::vector<std::string> index_ids;
1320 std::vector<std::string> underlying_tickers;
1321 std::optional<std::int64_t> sending_ts_ms;
1322};
1323
1326 std::string channel;
1327 std::int64_t sid{0};
1328};
1329
1332 std::int64_t id{0};
1333 std::vector<ListedSubscription> subscriptions;
1334 std::optional<std::int64_t> sending_ts_ms;
1335};
1336
1338using Message =
1339 std::variant<Update<OrderbookSnapshot>, Update<OrderbookDelta>, Update<Ticker>, Update<Trade>,
1352[[nodiscard]] constexpr std::string_view error_code_name(std::int64_t code) noexcept {
1353 switch (code) {
1354 case 1:
1355 return "Unable to process message";
1356 case 2:
1357 return "Params required";
1358 case 3:
1359 return "Channels required";
1360 case 4:
1361 return "Subscription IDs required";
1362 case 5:
1363 return "Unknown command";
1364 case 7:
1365 return "Unknown subscription ID";
1366 case 8:
1367 return "Unknown channel name";
1368 case 9:
1369 return "Authentication required";
1370 case 10:
1371 return "Channel error";
1372 case 11:
1373 return "Invalid parameter";
1374 case 12:
1375 return "Exactly one subscription ID is required";
1376 case 13:
1377 return "Unsupported action";
1378 case 14:
1379 return "Market Ticker required";
1380 case 15:
1381 return "Action required";
1382 case 18:
1383 return "Command timeout";
1384 case 19:
1385 return "shard_factor must be > 0";
1386 case 20:
1387 return "shard_factor is required when shard_key is set";
1388 case 21:
1389 return "shard_key must be >= 0 and < shard_factor";
1390 case 22:
1391 return "shard_factor must be <= 100";
1392 case 23:
1393 return "Match IDs required";
1394 case 24:
1395 return "Index IDs required";
1396 case 25:
1397 return "Subscription buffer overflow";
1398 case 26:
1399 return "Subscription market limit exceeded";
1400 case 27:
1401 return "Too many requests";
1402 case 28:
1403 return "Underlying tickers required";
1404 case 29:
1405 return "update_interval_ms must be 0, 100 or 1000";
1406 default:
1407 return "";
1408 }
1409}
1410} // namespace kalshi::ws
Definition ws_models.hpp:17
MarketLifecycleV2EventType
Field to annotate which of the event type this event is for.
Definition ws_models.hpp:224
@ PriceLevelStructureUpdated
price_level_structure_updated
@ Unknown
A value this SDK version does not know.
MultivariateMarketLifecycleEventType
Field to annotate which of the event type this event is for.
Definition ws_models.hpp:258
@ Unknown
A value this SDK version does not know.
OrderGroupUpdatesEventType
Order group event type.
Definition ws_models.hpp:318
@ Unknown
A value this SDK version does not know.
UpdateIntervalMs
Orderbook channel only.
Definition ws_models.hpp:385
@ Unknown
A value this SDK version does not know.
FeeTypeOverride
Event fee type override.
Definition ws_models.hpp:94
@ QuadraticWithComboMakerFees
quadratic_with_combo_maker_fees
@ QuadraticWithMakerFees
quadratic_with_maker_fees
@ Unknown
A value this SDK version does not know.
@ MarginMarketMakerProgramFees
margin_market_maker_program_fees
constexpr std::string_view error_code_name(std::int64_t code) noexcept
Kalshi's name for a WebSocket error code, or an empty string for codes this SDK version does not know...
Definition ws_models.hpp:1352
CollateralReturnType
Collateral return type, MECNET or DIRECNET of the event.
Definition ws_models.hpp:72
@ Unknown
A value this SDK version does not know.
Channel
A WebSocket channel.
Definition ws_models.hpp:20
@ MarketPositions
market_positions
@ PythValue
pyth_value
@ CfbenchmarksValue
cfbenchmarks_value
@ CfbenchmarksValue5hz
cfbenchmarks_value_5hz
@ Unknown
A value this SDK version does not know.
@ UserOrders
user_orders
@ MultivariateMarketLifecycle
multivariate_market_lifecycle
@ MarketLifecycleV2
market_lifecycle_v2
@ OrderbookDelta
orderbook_delta
@ Communications
communications
@ OrderGroupUpdates
order_group_updates
std::variant< Update< OrderbookSnapshot >, Update< OrderbookDelta >, Update< Ticker >, Update< Trade >, Update< Fill >, Update< MarketPosition >, Update< EventLifecycle >, Update< EventFeeUpdate >, Update< MultivariateMarketLifecycle >, Update< RfqCreated >, Update< RfqDeleted >, Update< QuoteCreated >, Update< QuoteAccepted >, Update< QuoteExecuted >, Update< RfqBatchCreated >, Update< RfqBatchDeleted >, Update< BatchQuoteCreated >, Update< RfqBatchBestQuotes >, Update< BatchQuoteAccepted >, Update< RfqBatchExecuted >, Update< BatchQuoteExecuted >, Update< OrderGroupUpdates >, Update< UserOrder >, Update< CfbenchmarksValue >, Update< CfbenchmarksIndexList >, Update< CfbenchmarksValue5Hz >, Update< Cfbenchmarks5HzIndexList >, Update< PythValue >, Update< PythUnderlyingList >, Update< MarketMetadataUpdated >, Update< MarketLifecycleV2 >, Subscribed, Unsubscribed, Updated, SubscriptionList > Message
Everything WebSocketClient delivers to on_message.
Definition ws_models.hpp:1349
UpdateAction
Definition ws_models.hpp:345
@ SubscribeUnderlyings
subscribe_underlyings
@ DeleteMarkets
delete_markets
@ UnderlyingList
underlying_list
@ GetSnapshot
get_snapshot
@ Unknown
A value this SDK version does not know.
@ UnsubscribeIndices
unsubscribe_indices
@ SubscribeIndices
subscribe_indices
@ UnsubscribeUnderlyings
unsubscribe_underlyings
OrderAction
Deprecated.
Definition ws_models.hpp:290
@ SellToClose
sell_to_close
@ Unknown
A value this SDK version does not know.
@ SellPartial
sell_partial
UserFilter
Communications channel only.
Definition ws_models.hpp:407
@ Unknown
A value this SDK version does not know.
LastUpdateReason
Reason for the most recent update, if applicable.
Definition ws_models.hpp:122
@ SelfTradeCancel
SelfTradeCancel
@ Unknown
A value this SDK version does not know.
@ PostOnlyCrossCancel
PostOnlyCrossCancel
@ SettlementBoundsCancel
SettlementBoundsCancel
@ ReduceOnlyCancel
ReduceOnlyCancel
LifecyclePriceLevelStructure
Optional - The market price level structure on creation or price_level_structure_updated events.
Definition ws_models.hpp:169
@ CenterQuintEdgeDeciCent
center_quint_edge_deci_cent
@ CenterHalfEdgeHalfCent
center_half_edge_half_cent
@ CenterDeciEdgeCentiCent
center_deci_edge_centi_cent
@ CenterQuintEdgeQuintCent
center_quint_edge_quint_cent
@ CenterWholeEdgeHalfCent
center_whole_edge_half_cent
@ CenterCentiEdgeCentiCent
center_centi_edge_centi_cent
@ CenterHalfEdgeDeciCent
center_half_edge_deci_cent
@ Unknown
A value this SDK version does not know.
@ CenterWholeEdgeQuintCent
center_whole_edge_quint_cent
@ CenterHalfEdgeQuintCent
center_half_edge_quint_cent
constexpr std::string_view to_string(Channel value) noexcept
Definition ws_models.hpp:37
Side
Definition models.hpp:867
BookSide
Side of the book for an order or trade.
Definition models.hpp:110
OrderStatus
The status of an order.
Definition models.hpp:604
OutcomeSide
Outcome side.
Definition models.hpp:644
Definition ws_models.hpp:450
std::optional< std::string > rfq_target_cost_dollars
Target cost from the child RFQ in dollars (optional)
Definition ws_models.hpp:470
std::optional< std::string > no_contracts_offered_fp
Fixed-point no contracts offered (2 decimals) (optional)
Definition ws_models.hpp:468
std::string yes_bid_dollars
Yes side bid price in dollars.
Definition ws_models.hpp:460
std::string no_bid_dollars
No side bid price in dollars.
Definition ws_models.hpp:462
std::optional< std::string > yes_contracts_offered_fp
Fixed-point yes contracts offered (2 decimals) (optional)
Definition ws_models.hpp:466
std::string market_ticker
Combo market ticker of the child RFQ.
Definition ws_models.hpp:456
std::string rfq_id
Identifier of the child RFQ.
Definition ws_models.hpp:454
std::string quote_id
Identifier of the accepted child quote.
Definition ws_models.hpp:452
std::optional< std::string > contracts_accepted_fp
Fixed-point contracts requested by the child RFQ (2 decimals) (optional)
Definition ws_models.hpp:464
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:458
Notification when your batch quote wins children of an accepted RFQ batch.
Definition ws_models.hpp:474
kalshi::Side accepted_side
Which side the RFQ batch creator accepted on every child (yes/no)
Definition ws_models.hpp:484
std::string quote_creator_id
Your public communications ID as the batch quote creator.
Definition ws_models.hpp:480
std::vector< BatchQuoteAcceptedQuotesItem > quotes
Only the children you won, each with your accepted quote.
Definition ws_models.hpp:488
std::string batch_quote_id
Identifier of your batch quote.
Definition ws_models.hpp:476
std::string rfq_batch_id
Identifier of the RFQ batch.
Definition ws_models.hpp:478
std::optional< std::int64_t > subaccount
Optional - Present only when your batch quote used a subaccount.
Definition ws_models.hpp:490
std::string rfq_creator_id
Public communications ID of the RFQ batch creator, obscured as in quote_accepted.
Definition ws_models.hpp:482
std::string accepted_ts
Timestamp when the RFQ batch was accepted.
Definition ws_models.hpp:486
Definition ws_models.hpp:493
std::string rfq_id
Identifier of the child RFQ.
Definition ws_models.hpp:497
std::string no_bid_dollars
No side bid price in dollars.
Definition ws_models.hpp:505
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:501
std::string yes_bid_dollars
Yes side bid price in dollars.
Definition ws_models.hpp:503
std::string quote_id
Identifier the child quote keeps if it wins the child.
Definition ws_models.hpp:495
std::optional< std::string > rfq_target_cost_dollars
Target cost from the child RFQ in dollars (optional)
Definition ws_models.hpp:511
std::optional< std::string > yes_contracts_offered_fp
Fixed-point yes contracts offered (2 decimals) (optional)
Definition ws_models.hpp:507
std::optional< std::string > no_contracts_offered_fp
Fixed-point no contracts offered (2 decimals) (optional)
Definition ws_models.hpp:509
std::string market_ticker
Combo market ticker of the child RFQ.
Definition ws_models.hpp:499
Notification when you create a batch quote on an RFQ batch.
Definition ws_models.hpp:515
std::string quote_creator_id
Your public communications ID as the batch quote creator.
Definition ws_models.hpp:521
std::vector< BatchQuoteCreatedQuotesItem > quotes
One quote per child RFQ.
Definition ws_models.hpp:525
std::string created_ts
Timestamp when the batch quote was created.
Definition ws_models.hpp:523
std::string batch_quote_id
Unique identifier for the batch quote.
Definition ws_models.hpp:517
std::string rfq_batch_id
Identifier of the RFQ batch this batch quote prices.
Definition ws_models.hpp:519
std::optional< std::int64_t > subaccount
Optional - Present only when your batch quote used a subaccount.
Definition ws_models.hpp:527
Notification when the RFQ batch your batch quote won children of has executed or failed.
Definition ws_models.hpp:531
std::string batch_quote_id
Identifier of your batch quote.
Definition ws_models.hpp:533
std::string rfq_batch_id
Identifier of the RFQ batch.
Definition ws_models.hpp:535
std::optional< std::int64_t > subaccount
Optional - Present only when your batch quote used a subaccount.
Definition ws_models.hpp:547
std::string executed_ts
Timestamp when the last child of the batch finished.
Definition ws_models.hpp:543
std::string rfq_creator_id
Public communications ID of the RFQ batch creator.
Definition ws_models.hpp:537
std::vector< std::string > executed_rfq_ids
Your children whose trades executed.
Definition ws_models.hpp:539
std::string close_reason
How your children ended.
Definition ws_models.hpp:545
std::vector< std::string > failed_rfq_ids
Your children whose trades failed to execute.
Definition ws_models.hpp:541
The index IDs recently observed on the 5Hz stream, sent in response to an indexlist action.
Definition ws_models.hpp:551
std::vector< std::string > index_ids
Index IDs recently observed on the 5Hz stream.
Definition ws_models.hpp:553
Trailing 60-second average metadata.
Definition ws_models.hpp:557
std::string value
Average value over the window, formatted to 8 decimal places.
Definition ws_models.hpp:559
std::int64_t window_end_ts_exclusive
Window end boundary, exclusive (unix ms)
Definition ws_models.hpp:565
std::int64_t window_size
Number of ticks counted in the window.
Definition ws_models.hpp:561
std::int64_t window_start_ts_ms
Window start boundary (unix ms)
Definition ws_models.hpp:563
The set of available CF Benchmarks index IDs, sent in response to an indexlist action.
Definition ws_models.hpp:569
std::vector< std::string > index_ids
Available CF Benchmarks index IDs.
Definition ws_models.hpp:571
Real-time CF Benchmarks index value at up to 5 updates per second.
Definition ws_models.hpp:590
std::int64_t received_at
When Kalshi received the upstream frame (unix ms)
Definition ws_models.hpp:598
std::string value_usd
Index value in USD, formatted with exactly 8 decimal places.
Definition ws_models.hpp:594
std::string data
The raw CF Benchmarks JSON frame, as a string.
Definition ws_models.hpp:600
std::string index_id
CF Benchmarks index ID (for example "BRTI")
Definition ws_models.hpp:592
std::int64_t source_ts_ms
Upstream publication timestamp of the tick (unix ms)
Definition ws_models.hpp:596
Real-time CF Benchmarks index value with trailing 60-second and quarter-hour averages.
Definition ws_models.hpp:575
std::string data
The raw CF Benchmarks JSON frame, as a string.
Definition ws_models.hpp:581
std::int64_t received_at
When Kalshi received the upstream frame (unix ms)
Definition ws_models.hpp:579
std::string index_id
CF Benchmarks index ID (for example "BRTI")
Definition ws_models.hpp:577
CfbenchmarksAvgData avg_60s_data
Trailing 60-second average metadata.
Definition ws_models.hpp:583
std::optional< CfbenchmarksAvgData > last_60s_windowed_average_15min
Optional - present only during the final minute before quarter-hour close (:00, :15,...
Definition ws_models.hpp:586
Emitted when an event-level fee override is set or cleared.
Definition ws_models.hpp:604
std::string event_ticker
Unique identifier for the event.
Definition ws_models.hpp:606
std::optional< double > fee_multiplier_override
Event fee multiplier override.
Definition ws_models.hpp:610
std::optional< FeeTypeOverride > fee_type_override
Event fee type override.
Definition ws_models.hpp:608
Event creation notification.
Definition ws_models.hpp:614
std::string subtitle
Subtitle of event.
Definition ws_models.hpp:622
std::optional< std::string > strike_period
Optional - String to indicate the strike period of the event if there is one.
Definition ws_models.hpp:630
std::string series_ticker
Series ticker for the event.
Definition ws_models.hpp:626
std::int64_t exchange_index
Identifier for the exchange shard the event's markets live on.
Definition ws_models.hpp:618
std::optional< std::int64_t > strike_date
Optional - Unix timestamp to indicate the strike date of the event if there is one.
Definition ws_models.hpp:628
std::string title
Title of event.
Definition ws_models.hpp:620
CollateralReturnType collateral_return_type
Collateral return type, MECNET or DIRECNET of the event.
Definition ws_models.hpp:624
std::string event_ticker
Unique identifier for the event being created.
Definition ws_models.hpp:616
Private fill information for authenticated user.
Definition ws_models.hpp:634
std::int64_t ts_ms
Unix timestamp for when the update happened (in milliseconds)
Definition ws_models.hpp:652
kalshi::Side purchased_side
Deprecated.
Definition ws_models.hpp:664
std::string yes_price_dollars
Price for the yes side of the fill in dollars.
Definition ws_models.hpp:654
std::string order_id
Unique identifier for orders.
Definition ws_models.hpp:638
std::string fee_cost
Exchange fee paid for this fill in fixed-point dollars.
Definition ws_models.hpp:658
std::int64_t exchange_index
Identifier for the exchange shard where the fill occurred.
Definition ws_models.hpp:644
std::string post_position_fp
Fixed-point position after the fill (2 decimals)
Definition ws_models.hpp:662
kalshi::OutcomeSide outcome_side
The outcome side this fill positioned the user for.
Definition ws_models.hpp:666
kalshi::BookSide book_side
Same directional bit as outcome_side in book vocabulary.
Definition ws_models.hpp:668
std::optional< std::int64_t > subaccount
Optional subaccount number for the fill.
Definition ws_models.hpp:670
OrderAction action
Deprecated.
Definition ws_models.hpp:660
bool is_taker
If you were a taker on this fill.
Definition ws_models.hpp:646
std::string market_ticker
Unique identifier for markets.
Definition ws_models.hpp:642
kalshi::Side side
Deprecated.
Definition ws_models.hpp:648
std::optional< std::string > client_order_id
Optional client-provided order ID.
Definition ws_models.hpp:640
std::string trade_id
Unique identifier for fills.
Definition ws_models.hpp:636
std::int64_t ts
Deprecated - Unix timestamp for when the update happened (in seconds).
Definition ws_models.hpp:650
std::string count_fp
Fixed-point contracts filled (2 decimals)
Definition ws_models.hpp:656
Optional - This key will be emitted when the market is created.
Definition ws_models.hpp:674
std::optional< RawJson > custom_strike
Definition ws_models.hpp:688
std::string title
Definition ws_models.hpp:676
std::string rules_secondary
Definition ws_models.hpp:681
std::string yes_sub_title
Definition ws_models.hpp:677
std::string event_ticker
Definition ws_models.hpp:683
std::string name
Definition ws_models.hpp:675
std::optional< std::string > strike_type
Definition ws_models.hpp:685
std::optional< double > floor_strike
Definition ws_models.hpp:686
std::optional< double > cap_strike
Definition ws_models.hpp:687
std::string rules_primary
Definition ws_models.hpp:680
bool can_close_early
Definition ws_models.hpp:682
std::int64_t expected_expiration_ts
Definition ws_models.hpp:684
std::string no_sub_title
Deprecated.
Definition ws_models.hpp:679
One entry of a list_subscriptions reply.
Definition ws_models.hpp:1325
std::int64_t sid
Definition ws_models.hpp:1327
std::string channel
Definition ws_models.hpp:1326
std::string step
Tick size (minimum price increment) within this band, in dollars.
Definition ws_models.hpp:697
std::string start
Starting price for this band, in dollars.
Definition ws_models.hpp:693
std::string end
Ending price for this band, in dollars.
Definition ws_models.hpp:695
Market lifecycle events (created, activated, deactivated, close_date_updated, determined,...
Definition ws_models.hpp:702
std::optional< std::string > settlement_value
Optional - This key will ONLY exist when the market is determined.
Definition ws_models.hpp:719
std::optional< std::int64_t > settled_ts
Optional - This key will ONLY exist when the market is settled.
Definition ws_models.hpp:715
std::optional< std::int64_t > open_ts
Optional - This key will ONLY exist when the market is created.
Definition ws_models.hpp:708
std::optional< std::vector< MarketLifecycleV2PriceRangesItem > > price_ranges
Optional - Emitted alongside price_level_structure (on market creation and price_level_structure_upda...
Definition ws_models.hpp:731
std::optional< std::string > result
Optional - This key will ONLY exist when the market is determined.
Definition ws_models.hpp:717
MarketLifecycleV2EventType event_type
Field to annotate which of the event type this event is for.
Definition ws_models.hpp:725
std::optional< LifecycleAdditionalMetadata > additional_metadata
Optional - This key will be emitted when the market is created.
Definition ws_models.hpp:723
std::optional< LifecyclePriceLevelStructure > price_level_structure
Optional - The market price level structure on creation or price_level_structure_updated events.
Definition ws_models.hpp:728
std::optional< std::int64_t > close_ts
Optional - This key will ONLY exist when the market is created OR when the close date is updated.
Definition ws_models.hpp:711
std::optional< std::int64_t > determination_ts
Optional - This key will ONLY exist when the market is determined.
Definition ws_models.hpp:713
std::string market_ticker
Unique identifier for markets.
Definition ws_models.hpp:704
std::optional< bool > is_deactivated
Optional - This key will ONLY exist when the market is paused/unpaused.
Definition ws_models.hpp:721
std::optional< std::int64_t > exchange_index
Optional - This key will ONLY exist when the market is created.
Definition ws_models.hpp:706
Updated strike information or yes subtitle.
Definition ws_models.hpp:735
std::optional< double > floor_strike
Optional - This key will ONLY exist for metadata_updated events.
Definition ws_models.hpp:741
std::optional< std::string > yes_sub_title
Optional - This key will ONLY exist for metadata_updated events.
Definition ws_models.hpp:748
std::optional< RawJson > custom_strike
Optional - This key will ONLY exist for metadata_updated events with a custom or structured strike ty...
Definition ws_models.hpp:746
std::optional< double > cap_strike
Optional - This key will ONLY exist for metadata_updated events.
Definition ws_models.hpp:743
std::string market_ticker
Unique identifier for markets.
Definition ws_models.hpp:737
std::optional< std::string > strike_type
Optional - This key will ONLY exist for metadata_updated events.
Definition ws_models.hpp:739
Real-time position updates for authenticated user.
Definition ws_models.hpp:752
std::string position_fee_cost_dollars
Total position fee cost as a fixed-point dollar string.
Definition ws_models.hpp:766
std::string fees_paid_dollars
Total fees paid as a fixed-point dollar string.
Definition ws_models.hpp:764
std::string volume_fp
Fixed-point total volume traded (2 decimals)
Definition ws_models.hpp:768
std::optional< std::int64_t > subaccount
Optional subaccount number for the position.
Definition ws_models.hpp:770
std::string position_fp
Fixed-point net position (2 decimals)
Definition ws_models.hpp:758
std::string user_id
User ID for the position.
Definition ws_models.hpp:754
std::string market_ticker
Market ticker for the position.
Definition ws_models.hpp:756
std::string realized_pnl_dollars
Realized profit/loss as a fixed-point dollar string.
Definition ws_models.hpp:762
std::string position_cost_dollars
Current cost basis of the position as a fixed-point dollar string.
Definition ws_models.hpp:760
Multivariate market lifecycle events (created, activated, deactivated, close_date_updated,...
Definition ws_models.hpp:775
std::optional< bool > is_deactivated
Optional - This key will ONLY exist when the market is paused/unpaused.
Definition ws_models.hpp:794
std::optional< std::int64_t > close_ts
Optional - This key will ONLY exist when the market is created OR when the close date is updated.
Definition ws_models.hpp:784
std::optional< std::int64_t > determination_ts
Optional - This key will ONLY exist when the market is determined.
Definition ws_models.hpp:786
std::string market_ticker
Unique identifier for markets.
Definition ws_models.hpp:777
std::optional< std::string > settlement_value
Optional - This key will ONLY exist when the market is determined.
Definition ws_models.hpp:792
std::optional< std::int64_t > open_ts
Optional - This key will ONLY exist when the market is created.
Definition ws_models.hpp:781
std::optional< LifecycleAdditionalMetadata > additional_metadata
Optional - This key will be emitted when the market is created.
Definition ws_models.hpp:796
MultivariateMarketLifecycleEventType event_type
Field to annotate which of the event type this event is for.
Definition ws_models.hpp:798
std::optional< std::int64_t > exchange_index
Optional - This key will ONLY exist when the market is created.
Definition ws_models.hpp:779
std::optional< std::string > result
Optional - This key will ONLY exist when the market is determined.
Definition ws_models.hpp:790
std::optional< LifecyclePriceLevelStructure > price_level_structure
Optional - The market price level structure on creation.
Definition ws_models.hpp:800
std::optional< std::int64_t > settled_ts
Optional - This key will ONLY exist when the market is settled.
Definition ws_models.hpp:788
Order group lifecycle and limit updates for authenticated user.
Definition ws_models.hpp:804
std::int64_t ts_ms
Matching engine timestamp at which the event was processed, as Unix epoch milliseconds.
Definition ws_models.hpp:812
std::string order_group_id
Order group identifier.
Definition ws_models.hpp:808
std::optional< std::string > contracts_limit_fp
Updated contracts limit in fixed-point (2 decimals).
Definition ws_models.hpp:810
OrderGroupUpdatesEventType event_type
Order group event type.
Definition ws_models.hpp:806
Update to be applied to the current order book view.
Definition ws_models.hpp:816
std::optional< std::string > ts
Deprecated - Optional timestamp for when the orderbook change was recorded (RFC3339,...
Definition ws_models.hpp:833
std::string delta_fp
Fixed-point contract delta (2 decimals)
Definition ws_models.hpp:826
std::string market_ticker
Unique market identifier.
Definition ws_models.hpp:818
std::optional< std::string > client_order_id
Optional - Present only when you caused this orderbook change.
Definition ws_models.hpp:830
std::optional< std::int64_t > subaccount
Optional - Present only when you caused this orderbook change and are using subaccounts.
Definition ws_models.hpp:837
std::int64_t clock
Exchange clock of the latest change included in this delta.
Definition ws_models.hpp:822
std::optional< std::int64_t > ts_ms
Optional - Unix timestamp for when the orderbook change was recorded (in milliseconds)
Definition ws_models.hpp:835
std::string market_id
Unique market UUID.
Definition ws_models.hpp:820
kalshi::Side side
Market side.
Definition ws_models.hpp:828
std::string price_dollars
Price level in dollars.
Definition ws_models.hpp:824
Complete view of the order book's aggregated price levels.
Definition ws_models.hpp:841
std::int64_t clock
Exchange clock of the newest change this snapshot includes, or 0 if the market has no recorded change...
Definition ws_models.hpp:848
std::string market_ticker
Unique market identifier.
Definition ws_models.hpp:843
std::optional< std::vector< std::array< std::string, 2 > > > no_dollars_fp
Optional - Same format as "yes_dollars_fp" but for the NO side of the orderbook.
Definition ws_models.hpp:852
std::optional< std::vector< std::array< std::string, 2 > > > yes_dollars_fp
Optional - This key will not exist if there are no Yes offers in the orderbook.
Definition ws_models.hpp:850
std::string market_id
Unique market UUID.
Definition ws_models.hpp:845
Recently streamed Pyth underlying tickers.
Definition ws_models.hpp:856
std::vector< std::string > underlying_tickers
Underlying tickers observed on the Pyth stream in the last two hours.
Definition ws_models.hpp:858
Deduplicated real-time Pyth price or Treasury yield for an underlying ticker.
Definition ws_models.hpp:862
std::string value_usd
Value formatted to 8 decimal places in the underlying's quoted units.
Definition ws_models.hpp:866
std::int64_t received_at
When Kalshi received the Pyth update (unix ms)
Definition ws_models.hpp:870
std::int64_t source_ts_ms
Pyth source timestamp (unix ms)
Definition ws_models.hpp:868
std::string underlying_ticker
Qualified Pyth underlying ticker.
Definition ws_models.hpp:864
Notification when a quote is accepted.
Definition ws_models.hpp:874
std::string rfq_creator_id
Public communications ID of the RFQ creator (pseudonymous).
Definition ws_models.hpp:882
std::string quote_creator_id
Public communications ID of the quote creator (anonymized)
Definition ws_models.hpp:880
std::string yes_bid_dollars
Yes side bid price in dollars.
Definition ws_models.hpp:888
std::string no_bid_dollars
No side bid price in dollars.
Definition ws_models.hpp:890
std::string rfq_id
Identifier of the RFQ this quote is for.
Definition ws_models.hpp:878
std::optional< std::string > no_contracts_offered_fp
Fixed-point no contracts offered (2 decimals) (optional)
Definition ws_models.hpp:898
std::string market_ticker
Market ticker for the quote.
Definition ws_models.hpp:884
std::optional< std::int64_t > subaccount
Optional - Present only when your side of this quote used a subaccount.
Definition ws_models.hpp:902
std::optional< std::string > rfq_target_cost_dollars
Target cost from the RFQ in dollars (optional)
Definition ws_models.hpp:900
std::optional< kalshi::Side > accepted_side
Which side was accepted (yes/no) (optional)
Definition ws_models.hpp:892
std::string quote_id
Unique identifier of the quote that executes.
Definition ws_models.hpp:876
std::optional< std::string > yes_contracts_offered_fp
Fixed-point yes contracts offered (2 decimals) (optional)
Definition ws_models.hpp:896
std::optional< std::string > contracts_accepted_fp
Fixed-point contracts accepted (2 decimals) (optional)
Definition ws_models.hpp:894
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:886
Notification when a quote is created on an RFQ.
Definition ws_models.hpp:906
std::string quote_id
Unique identifier for the quote.
Definition ws_models.hpp:908
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:918
std::optional< std::int64_t > subaccount
Optional - Present only when your side of this quote used a subaccount.
Definition ws_models.hpp:932
std::string market_ticker
Market ticker for the quote.
Definition ws_models.hpp:916
std::string rfq_creator_id
Public communications ID of the RFQ creator (pseudonymous).
Definition ws_models.hpp:914
std::optional< std::string > no_contracts_offered_fp
Fixed-point no contracts offered (2 decimals) (optional)
Definition ws_models.hpp:926
std::string rfq_id
Identifier of the RFQ this quote is for.
Definition ws_models.hpp:910
std::string yes_bid_dollars
Yes side bid price in dollars.
Definition ws_models.hpp:920
std::string created_ts
Timestamp when the quote was created.
Definition ws_models.hpp:930
std::optional< std::string > rfq_target_cost_dollars
Target cost from the RFQ in dollars (optional)
Definition ws_models.hpp:928
std::optional< std::string > yes_contracts_offered_fp
Fixed-point yes contracts offered (2 decimals) (optional)
Definition ws_models.hpp:924
std::string quote_creator_id
Public communications ID of the quote creator (anonymized)
Definition ws_models.hpp:912
std::string no_bid_dollars
No side bid price in dollars.
Definition ws_models.hpp:922
Notification when a quote is executed and orders are placed.
Definition ws_models.hpp:936
std::string order_id
Your order ID resulting from the quote execution.
Definition ws_models.hpp:946
std::string quote_creator_id
Anonymized identifier for the quote creator.
Definition ws_models.hpp:942
std::string executed_ts
Timestamp when the quote was executed and orders were placed.
Definition ws_models.hpp:952
std::optional< std::string > rfq_batch_id
Identifier of the RFQ batch, when the quote is on a child RFQ of an RFQ batch.
Definition ws_models.hpp:956
std::string quote_id
Unique identifier for the quote that was executed.
Definition ws_models.hpp:938
std::string rfq_creator_id
Anonymized identifier for the RFQ creator.
Definition ws_models.hpp:944
std::string client_order_id
Your client order ID for the executed order.
Definition ws_models.hpp:948
std::optional< std::int64_t > subaccount
Optional - Present only when your side of this quote used a subaccount.
Definition ws_models.hpp:954
std::string market_ticker
Market ticker for the executed quote.
Definition ws_models.hpp:950
std::string rfq_id
Identifier of the RFQ this quote was for.
Definition ws_models.hpp:940
Definition ws_models.hpp:959
std::optional< std::string > yes_contracts_offered_fp
Fixed-point contracts the best yes bid offers (2 decimals).
Definition ws_models.hpp:973
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:965
std::string rfq_id
Identifier of the child RFQ.
Definition ws_models.hpp:961
std::optional< std::string > rfq_target_cost_dollars
Target cost from the child RFQ in dollars (optional)
Definition ws_models.hpp:977
std::optional< std::string > contracts_fp
Fixed-point contracts requested by the child RFQ (2 decimals).
Definition ws_models.hpp:971
std::optional< std::string > no_contracts_offered_fp
Fixed-point contracts the best no bid offers (2 decimals).
Definition ws_models.hpp:975
std::optional< std::string > no_bid_dollars
Best no bid across makers, in dollars.
Definition ws_models.hpp:969
std::optional< std::string > yes_bid_dollars
Best yes bid across makers, in dollars.
Definition ws_models.hpp:967
std::string market_ticker
Combo market ticker of the child RFQ.
Definition ws_models.hpp:963
The best quotes across makers on your RFQ batch.
Definition ws_models.hpp:981
std::string updated_ts
Timestamp when a best bid last changed.
Definition ws_models.hpp:989
bool yes_complete
Whether every child has a yes bid, so the batch can be accepted on the yes side.
Definition ws_models.hpp:991
bool no_complete
Whether every child has a no bid, so the batch can be accepted on the no side.
Definition ws_models.hpp:993
std::optional< std::int64_t > subaccount
Optional - Present only when your RFQ batch used a subaccount.
Definition ws_models.hpp:997
std::optional< std::string > client_batch_id
The client_batch_id you gave when creating the batch.
Definition ws_models.hpp:985
std::int64_t version
Increases with every snapshot of this batch.
Definition ws_models.hpp:987
std::vector< RfqBatchBestQuotesRfqsItem > rfqs
One entry per child RFQ, in the order the children were requested.
Definition ws_models.hpp:995
std::string rfq_batch_id
Identifier of your RFQ batch.
Definition ws_models.hpp:983
Definition ws_models.hpp:1000
kalshi::Side side
Side selected for the leg.
Definition ws_models.hpp:1006
std::string market_ticker
Market ticker for the leg.
Definition ws_models.hpp:1004
std::string event_ticker
Event ticker for the leg.
Definition ws_models.hpp:1002
std::optional< std::string > yes_settlement_value_dollars
Yes settlement value in dollars for the leg.
Definition ws_models.hpp:1008
Definition ws_models.hpp:1011
std::string market_ticker
Combo market ticker of the child RFQ.
Definition ws_models.hpp:1015
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:1017
std::optional< std::string > target_cost_dollars
Target cost in dollars (optional)
Definition ws_models.hpp:1021
std::string id
Unique identifier for the child RFQ.
Definition ws_models.hpp:1013
std::optional< std::string > contracts_fp
Fixed-point contracts requested (2 decimals) (optional)
Definition ws_models.hpp:1019
std::vector< std::int64_t > leg_indices
Indexes into legs of this combo's legs.
Definition ws_models.hpp:1025
std::optional< std::string > mve_collection_ticker
Multivariate event collection ticker (optional)
Definition ws_models.hpp:1023
Notification when an RFQ batch is created.
Definition ws_models.hpp:1029
std::string id
Unique identifier for the RFQ batch.
Definition ws_models.hpp:1031
std::vector< RfqBatchCreatedLegsItem > legs
Distinct legs across the batch's combos, each listed once.
Definition ws_models.hpp:1037
std::string creator_id
Public communications ID of the batch creator (pseudonymous).
Definition ws_models.hpp:1033
std::vector< RfqBatchCreatedRfqsItem > rfqs
The child RFQs, in the order they were requested.
Definition ws_models.hpp:1039
std::string created_ts
Timestamp when the RFQ batch was created.
Definition ws_models.hpp:1035
Notification when an RFQ batch closes.
Definition ws_models.hpp:1043
std::vector< std::string > rfq_ids
The child RFQs, which closed with the batch.
Definition ws_models.hpp:1049
std::string deleted_ts
Timestamp when the RFQ batch closed.
Definition ws_models.hpp:1051
std::string creator_id
Public communications ID of the batch creator, obscured as in rfq_batch_created.
Definition ws_models.hpp:1047
std::string id
Unique identifier for the RFQ batch.
Definition ws_models.hpp:1045
Notification when your accepted RFQ batch has executed or failed.
Definition ws_models.hpp:1055
std::optional< std::int64_t > subaccount
Optional - Present only when your RFQ batch used a subaccount.
Definition ws_models.hpp:1071
std::string executed_ts
Timestamp when the last child finished.
Definition ws_models.hpp:1067
std::string rfq_batch_id
Identifier of your RFQ batch.
Definition ws_models.hpp:1057
std::optional< std::string > client_batch_id
The client_batch_id you gave when creating the batch.
Definition ws_models.hpp:1059
std::string rfq_creator_id
Your public communications ID as the RFQ batch creator.
Definition ws_models.hpp:1061
std::vector< std::string > failed_rfq_ids
Child RFQs whose trades failed to execute.
Definition ws_models.hpp:1065
std::vector< std::string > executed_rfq_ids
Child RFQs whose trades executed.
Definition ws_models.hpp:1063
std::string close_reason
How the batch ended.
Definition ws_models.hpp:1069
Definition ws_models.hpp:1074
std::optional< std::string > yes_settlement_value_dollars
Yes settlement value in dollars for the selected leg.
Definition ws_models.hpp:1082
kalshi::Side side
Side selected for the leg.
Definition ws_models.hpp:1080
std::string event_ticker
Event ticker for the selected leg.
Definition ws_models.hpp:1076
std::string market_ticker
Market ticker for the selected leg.
Definition ws_models.hpp:1078
Notification when an RFQ is created.
Definition ws_models.hpp:1086
std::string market_ticker
Market ticker for the RFQ.
Definition ws_models.hpp:1092
std::optional< std::string > contracts_fp
Fixed-point contracts requested (2 decimals) (optional)
Definition ws_models.hpp:1096
std::optional< std::string > target_cost_dollars
Target cost in dollars (optional)
Definition ws_models.hpp:1098
std::optional< std::string > rfq_batch_id
Identifier of the RFQ batch this RFQ is a child of.
Definition ws_models.hpp:1106
std::string id
Unique identifier for the RFQ.
Definition ws_models.hpp:1088
std::string created_ts
Timestamp when the RFQ was created.
Definition ws_models.hpp:1100
std::optional< std::vector< RfqCreatedMveSelectedLegsItem > > mve_selected_legs
Selected legs for an MVE RFQ.
Definition ws_models.hpp:1104
std::string creator_id
Public communications ID of the RFQ creator (pseudonymous).
Definition ws_models.hpp:1090
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:1094
std::optional< std::string > mve_collection_ticker
Multivariate event collection ticker.
Definition ws_models.hpp:1102
Notification when an RFQ is deleted.
Definition ws_models.hpp:1110
std::string creator_id
Public communications ID of the RFQ creator (pseudonymous).
Definition ws_models.hpp:1114
std::optional< std::string > target_cost_dollars
Target cost in dollars (optional)
Definition ws_models.hpp:1122
std::string deleted_ts
Timestamp when the RFQ was deleted.
Definition ws_models.hpp:1124
std::string id
Unique identifier for the RFQ.
Definition ws_models.hpp:1112
std::optional< std::string > contracts_fp
Fixed-point contracts requested (2 decimals) (optional)
Definition ws_models.hpp:1120
std::optional< std::string > event_ticker
Event ticker (optional)
Definition ws_models.hpp:1118
std::optional< std::string > rfq_batch_id
Identifier of the RFQ batch this RFQ is a child of, which closed with it.
Definition ws_models.hpp:1126
std::string market_ticker
Market ticker for the RFQ.
Definition ws_models.hpp:1116
Options for subscribe; the client sets the channel.
Definition ws_models.hpp:1130
std::optional< UpdateIntervalMs > update_interval_ms
Orderbook channel only.
Definition ws_models.hpp:1148
std::optional< std::string > market_id
Subscribe to a single market by UUID (ticker only; mutually exclusive with market_ids and market_tick...
Definition ws_models.hpp:1137
std::optional< bool > skip_ticker_ack
If true, OK responses omit the market_tickers/market_ids lists for this subscription.
Definition ws_models.hpp:1144
std::vector< std::string > market_ids
Subscribe to multiple markets by UUID (ticker only; mutually exclusive with market_id and market_tick...
Definition ws_models.hpp:1140
std::optional< bool > use_yes_price
Orderbook channel only.
Definition ws_models.hpp:1146
std::optional< std::int64_t > shard_factor
Number of shards for communications channel fanout (optional)
Definition ws_models.hpp:1152
std::optional< bool > send_initial_snapshot
If true, receive an initial snapshot for requested market tickers on the ticker channel.
Definition ws_models.hpp:1142
std::vector< std::string > market_tickers
Subscribe to multiple markets.
Definition ws_models.hpp:1134
std::optional< std::int64_t > shard_key
Shard key for communications channel fanout (requires shard_factor)
Definition ws_models.hpp:1154
std::optional< std::string > market_ticker
Subscribe to a single market.
Definition ws_models.hpp:1132
std::vector< std::string > index_ids
cfbenchmarks_value and cfbenchmarks_value_5hz channels only.
Definition ws_models.hpp:1156
std::optional< UserFilter > user_filter
Communications channel only.
Definition ws_models.hpp:1150
std::vector< std::string > underlying_tickers
pyth_value channel only.
Definition ws_models.hpp:1158
The server confirmed a subscription.
Definition ws_models.hpp:1301
std::int64_t sid
Definition ws_models.hpp:1303
Subscription subscription
Definition ws_models.hpp:1302
std::optional< std::int64_t > sending_ts_ms
Definition ws_models.hpp:1304
The reply to list_subscriptions; id is the command's ID.
Definition ws_models.hpp:1331
std::vector< ListedSubscription > subscriptions
Definition ws_models.hpp:1333
std::optional< std::int64_t > sending_ts_ms
Definition ws_models.hpp:1334
A handle for one channel subscription.
Definition ws_models.hpp:427
friend bool operator==(const Subscription &, const Subscription &)=default
Channel channel
Definition ws_models.hpp:429
Market price ticker information.
Definition ws_models.hpp:1162
std::string yes_bid_dollars
Best bid price for yes side in dollars.
Definition ws_models.hpp:1170
std::string yes_ask_size_fp
Fixed-point contracts at best ask (2 decimals)
Definition ws_models.hpp:1184
std::string volume_fp
Fixed-point total contracts traded (2 decimals)
Definition ws_models.hpp:1174
std::int64_t dollar_volume
Signed whole-dollar cumulative traded notional.
Definition ws_models.hpp:1178
std::string market_id
Unique market UUID.
Definition ws_models.hpp:1164
std::string yes_bid_size_fp
Fixed-point contracts at best bid (2 decimals)
Definition ws_models.hpp:1182
std::string last_trade_size_fp
Fixed-point contracts in last trade (2 decimals)
Definition ws_models.hpp:1186
std::string yes_ask_dollars
Best ask price for yes side in dollars.
Definition ws_models.hpp:1172
std::int64_t ts_ms
Unix timestamp for when the update happened (in milliseconds)
Definition ws_models.hpp:1190
std::int64_t dollar_open_interest
Signed whole-dollar open-interest notional.
Definition ws_models.hpp:1180
std::string price_dollars
Last traded price in dollars.
Definition ws_models.hpp:1168
std::string market_ticker
Unique market identifier.
Definition ws_models.hpp:1166
std::string open_interest_fp
Fixed-point open interest (2 decimals)
Definition ws_models.hpp:1176
std::int64_t ts
Deprecated - Unix timestamp for when the update happened (in seconds).
Definition ws_models.hpp:1188
std::string time
Deprecated - Timestamp for when the update happened (RFC3339, truncated to milliseconds).
Definition ws_models.hpp:1192
Public trade information.
Definition ws_models.hpp:1196
std::string trade_id
Unique identifier for the trade.
Definition ws_models.hpp:1198
std::string count_fp
Fixed-point contracts traded (2 decimals)
Definition ws_models.hpp:1206
std::string market_ticker
Unique market identifier.
Definition ws_models.hpp:1200
bool is_block_trade
True if the trade was matched off book as a block trade.
Definition ws_models.hpp:1214
std::string yes_price_dollars
Yes side price in dollars.
Definition ws_models.hpp:1202
std::string no_price_dollars
No side price in dollars.
Definition ws_models.hpp:1204
std::int64_t ts
Deprecated - Unix timestamp in seconds.
Definition ws_models.hpp:1216
kalshi::BookSide taker_book_side
Same directional bit as taker_outcome_side in book vocabulary.
Definition ws_models.hpp:1212
kalshi::Side taker_side
Deprecated.
Definition ws_models.hpp:1208
std::int64_t ts_ms
Unix timestamp in milliseconds.
Definition ws_models.hpp:1218
kalshi::OutcomeSide taker_outcome_side
The outcome side the taker is positioned for.
Definition ws_models.hpp:1210
The server ended a subscription after unsubscribe.
Definition ws_models.hpp:1308
Subscription subscription
Definition ws_models.hpp:1309
std::optional< std::int64_t > sending_ts_ms
Definition ws_models.hpp:1310
Options for update_subscription; the client sets the subscription.
Definition ws_models.hpp:1222
std::vector< std::string > market_tickers
Add/remove multiple markets.
Definition ws_models.hpp:1226
std::optional< std::string > market_ticker
Add/remove a single market.
Definition ws_models.hpp:1224
std::vector< std::string > market_ids
Add/remove multiple markets by UUID (ticker only)
Definition ws_models.hpp:1230
std::optional< std::string > market_id
Add/remove a single market by UUID (ticker only)
Definition ws_models.hpp:1228
std::vector< std::string > index_ids
CF Benchmarks index IDs to add or remove.
Definition ws_models.hpp:1235
std::optional< bool > send_initial_snapshot
If true, receive an initial snapshot for newly added market tickers on the ticker channel.
Definition ws_models.hpp:1232
std::vector< std::string > underlying_tickers
Pyth underlyings to add or remove.
Definition ws_models.hpp:1237
UpdateAction action
Definition ws_models.hpp:1233
One data frame. msg holds the channel's payload.
Definition ws_models.hpp:436
std::int64_t subscription
Subscription::id of the subscription that produced the frame.
Definition ws_models.hpp:444
std::optional< std::int64_t > id
The command that asked for this frame, such as a get_snapshot.
Definition ws_models.hpp:442
T msg
Definition ws_models.hpp:445
std::int64_t sid
The server's subscription ID, which changes after a reconnect.
Definition ws_models.hpp:438
std::optional< std::int64_t > sending_ts_ms
Server send time in Unix milliseconds, when supplied.
Definition ws_models.hpp:447
std::optional< std::int64_t > seq
Present on sequenced channels. The client checks it for gaps.
Definition ws_models.hpp:440
An update_subscription succeeded.
Definition ws_models.hpp:1315
std::vector< std::string > underlying_tickers
Definition ws_models.hpp:1320
Subscription subscription
Definition ws_models.hpp:1316
std::vector< std::string > market_tickers
Definition ws_models.hpp:1317
std::vector< std::string > index_ids
Definition ws_models.hpp:1319
std::vector< std::string > market_ids
Definition ws_models.hpp:1318
std::optional< std::int64_t > sending_ts_ms
Definition ws_models.hpp:1321
Real-time order updates for authenticated user.
Definition ws_models.hpp:1241
std::string client_order_id
Client-provided order identifier.
Definition ws_models.hpp:1277
kalshi::BookSide book_side
Same directional bit as outcome_side in book vocabulary.
Definition ws_models.hpp:1259
std::optional< std::int64_t > last_updated_ts_ms
Last update time as a Unix timestamp in milliseconds.
Definition ws_models.hpp:1293
std::string taker_fees_dollars
Taker fees in fixed-point dollars (6 decimals).
Definition ws_models.hpp:1273
std::string remaining_count_fp
Number of contracts remaining in fixed-point (2 decimals)
Definition ws_models.hpp:1265
std::optional< kalshi::SelfTradePreventionType > self_trade_prevention_type
Self-trade prevention type.
Definition ws_models.hpp:1281
std::string initial_count_fp
Initial number of contracts in fixed-point (2 decimals)
Definition ws_models.hpp:1267
std::optional< std::string > expiration_time
Deprecated - Order expiration time in RFC3339 format, truncated to milliseconds.
Definition ws_models.hpp:1287
std::string yes_price_dollars
Yes price in fixed-point dollars (4 decimals)
Definition ws_models.hpp:1261
kalshi::OrderStatus status
Current order status.
Definition ws_models.hpp:1251
std::string fill_count_fp
Number of contracts filled in fixed-point (2 decimals)
Definition ws_models.hpp:1263
std::string maker_fees_dollars
Maker fees in fixed-point dollars (6 decimals).
Definition ws_models.hpp:1275
std::optional< LastUpdateReason > last_update_reason
Reason for the most recent update, if applicable.
Definition ws_models.hpp:1295
kalshi::OutcomeSide outcome_side
The outcome side this order is positioned for.
Definition ws_models.hpp:1257
std::string ticker
Market ticker for the order.
Definition ws_models.hpp:1247
std::string user_id
User identifier.
Definition ws_models.hpp:1245
std::optional< std::string > order_group_id
Order group identifier, if applicable.
Definition ws_models.hpp:1279
std::string order_id
Unique order identifier.
Definition ws_models.hpp:1243
std::int64_t exchange_index
Identifier for the exchange shard where the order resides.
Definition ws_models.hpp:1249
std::optional< std::int64_t > expiration_ts_ms
Order expiration time as a Unix timestamp in milliseconds.
Definition ws_models.hpp:1289
bool is_yes
Deprecated.
Definition ws_models.hpp:1255
std::optional< std::int64_t > subaccount_number
Subaccount number (0 for primary, 1-63 for subaccounts)
Definition ws_models.hpp:1297
std::string taker_fill_cost_dollars
Taker fill cost in fixed-point dollars (6 decimals)
Definition ws_models.hpp:1269
kalshi::Side side
Deprecated.
Definition ws_models.hpp:1253
std::optional< std::string > last_update_time
Deprecated - Last update time in RFC3339 format, truncated to milliseconds.
Definition ws_models.hpp:1285
std::optional< std::string > created_time
Deprecated - Order creation time in RFC3339 format, truncated to milliseconds.
Definition ws_models.hpp:1283
std::string maker_fill_cost_dollars
Maker fill cost in fixed-point dollars (6 decimals)
Definition ws_models.hpp:1271
std::optional< std::int64_t > created_ts_ms
Order creation time as a Unix timestamp in milliseconds.
Definition ws_models.hpp:1291