kalshi-cpp 0.6.2
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
kalshi::ws Namespace Reference

Classes

struct  Cfbenchmarks5HzIndexList
 The index IDs recently observed on the 5Hz stream, sent in response to an indexlist action. More...
 
struct  CfbenchmarksAvgData
 Trailing 60-second average metadata. More...
 
struct  CfbenchmarksIndexList
 The set of available CF Benchmarks index IDs, sent in response to an indexlist action. More...
 
struct  CfbenchmarksValue
 Real-time CF Benchmarks index value with trailing 60-second and quarter-hour averages. More...
 
struct  CfbenchmarksValue5Hz
 Real-time CF Benchmarks index value at up to 5 updates per second. More...
 
struct  EventFeeUpdate
 Emitted when an event-level fee override is set or cleared. More...
 
struct  EventLifecycle
 Event creation notification. More...
 
struct  Fill
 Private fill information for authenticated user. More...
 
struct  LifecycleAdditionalMetadata
 Optional - This key will be emitted when the market is created. More...
 
struct  ListedSubscription
 One entry of a list_subscriptions reply. More...
 
struct  MarketLifecycleV2
 Market lifecycle events (created, activated, deactivated, close_date_updated, determined, settled, price_level_structure_updated) More...
 
struct  MarketLifecycleV2PriceRangesItem
 
struct  MarketMetadataUpdated
 Updated strike information or yes subtitle. More...
 
struct  MarketPosition
 Real-time position updates for authenticated user. More...
 
struct  MultivariateMarketLifecycle
 Multivariate market lifecycle events (created, activated, deactivated, close_date_updated, determined, settled) More...
 
struct  OrderbookDelta
 Update to be applied to the current order book view. More...
 
struct  OrderbookSnapshot
 Complete view of the order book's aggregated price levels. More...
 
struct  OrderGroupUpdates
 Order group lifecycle and limit updates for authenticated user. More...
 
struct  PythUnderlyingList
 Recently streamed Pyth underlying tickers. More...
 
struct  PythValue
 Deduplicated real-time Pyth price for an underlying ticker. More...
 
struct  QuoteAccepted
 Notification when a quote is accepted. More...
 
struct  QuoteCreated
 Notification when a quote is created on an RFQ. More...
 
struct  QuoteExecuted
 Notification when a quote is executed and orders are placed. More...
 
struct  RfqCreated
 Notification when an RFQ is created. More...
 
struct  RfqCreatedMveSelectedLegsItem
 
struct  RfqDeleted
 Notification when an RFQ is deleted. More...
 
struct  Subscribed
 The server confirmed a subscription. More...
 
struct  SubscribeParams
 Options for subscribe; the client sets the channel. More...
 
struct  Subscription
 A handle for one channel subscription. More...
 
struct  SubscriptionList
 The reply to list_subscriptions; id is the command's ID. More...
 
struct  Ticker
 Market price ticker information. More...
 
struct  Trade
 Public trade information. More...
 
struct  Unsubscribed
 The server ended a subscription after unsubscribe. More...
 
struct  Update
 One data frame. msg holds the channel's payload. More...
 
struct  Updated
 An update_subscription succeeded. More...
 
struct  UpdateSubscriptionParams
 Options for update_subscription; the client sets the subscription. More...
 
struct  UserOrder
 Real-time order updates for authenticated user. More...
 

Typedefs

using Message = 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< OrderGroupUpdates >, Update< UserOrder >, Update< CfbenchmarksValue >, Update< CfbenchmarksIndexList >, Update< CfbenchmarksValue5Hz >, Update< Cfbenchmarks5HzIndexList >, Update< PythValue >, Update< PythUnderlyingList >, Update< MarketMetadataUpdated >, Update< MarketLifecycleV2 >, Subscribed, Unsubscribed, Updated, SubscriptionList >
 Everything WebSocketClient delivers to on_message.
 

Enumerations

enum class  Channel : std::uint8_t {
  Unknown , OrderbookDelta , Ticker , Trade ,
  Fill , MarketPositions , MarketLifecycleV2 , MultivariateMarketLifecycle ,
  Communications , OrderGroupUpdates , UserOrders , CfbenchmarksValue ,
  CfbenchmarksValue5hz , PythValue
}
 A WebSocket channel. More...
 
enum class  CollateralReturnType : std::uint8_t { Unknown , MECNET , DIRECNET , Unset }
 Collateral return type, MECNET or DIRECNET of the event. More...
 
enum class  FeeTypeOverride : std::uint8_t {
  Unknown , Quadratic , QuadraticWithMakerFees , QuadraticWithComboMakerFees ,
  Flat , MarginMarketMakerProgramFees
}
 Event fee type override. More...
 
enum class  LifecyclePriceLevelStructure : std::uint8_t {
  Unknown , BandedCentiCent , Unset , LinearCent ,
  DeciCent , TaperedDeciCent , CenterWholeEdgeHalfCent , CenterWholeEdgeQuintCent ,
  CenterHalfEdgeHalfCent , CenterHalfEdgeQuintCent , CenterHalfEdgeDeciCent , CenterQuintEdgeQuintCent ,
  CenterQuintEdgeDeciCent , CenterCentiEdgeCentiCent , CenterDeciEdgeCentiCent
}
 Optional - The market price level structure on creation or price_level_structure_updated events. More...
 
enum class  MarketLifecycleV2EventType : std::uint8_t {
  Unknown , Created , Deactivated , Activated ,
  CloseDateUpdated , Determined , Settled , PriceLevelStructureUpdated
}
 Field to annotate which of the event type this event is for. More...
 
enum class  MultivariateMarketLifecycleEventType : std::uint8_t {
  Unknown , Created , Deactivated , Activated ,
  CloseDateUpdated , Determined , Settled
}
 Field to annotate which of the event type this event is for. More...
 
enum class  OrderAction : std::uint8_t {
  Unknown , Buy , Sell , SellPartial ,
  SellToClose , Unset
}
 Deprecated. More...
 
enum class  OrderGroupUpdatesEventType : std::uint8_t {
  Unknown , Created , Triggered , Reset ,
  Deleted , LimitUpdated
}
 Order group event type. More...
 
enum class  UpdateAction : std::uint8_t {
  Unknown , AddMarkets , DeleteMarkets , GetSnapshot ,
  SubscribeIndices , UnsubscribeIndices , Indexlist , SubscribeUnderlyings ,
  UnsubscribeUnderlyings , UnderlyingList
}
 
enum class  UserFilter : std::uint8_t { Unknown , Unset , Self }
 Communications channel only. More...
 

Functions

constexpr std::string_view to_string (Channel value) noexcept
 
constexpr std::string_view to_string (CollateralReturnType value) noexcept
 
constexpr std::string_view to_string (FeeTypeOverride value) noexcept
 
constexpr std::string_view to_string (LifecyclePriceLevelStructure value) noexcept
 
constexpr std::string_view to_string (MarketLifecycleV2EventType value) noexcept
 
constexpr std::string_view to_string (MultivariateMarketLifecycleEventType value) noexcept
 
constexpr std::string_view to_string (OrderAction value) noexcept
 
constexpr std::string_view to_string (OrderGroupUpdatesEventType value) noexcept
 
constexpr std::string_view to_string (UpdateAction value) noexcept
 
constexpr std::string_view to_string (UserFilter value) noexcept
 
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.
 

Typedef Documentation

◆ Message

Enumeration Type Documentation

◆ Channel

enum class kalshi::ws::Channel : std::uint8_t
strong

A WebSocket channel.

Enumerator
Unknown 

A value this SDK version does not know.

OrderbookDelta 

orderbook_delta

Ticker 

ticker

Trade 

trade

Fill 

fill

MarketPositions 

market_positions

MarketLifecycleV2 

market_lifecycle_v2

MultivariateMarketLifecycle 

multivariate_market_lifecycle

Communications 

communications

OrderGroupUpdates 

order_group_updates

UserOrders 

user_orders

CfbenchmarksValue 

cfbenchmarks_value

CfbenchmarksValue5hz 

cfbenchmarks_value_5hz

PythValue 

pyth_value

◆ CollateralReturnType

enum class kalshi::ws::CollateralReturnType : std::uint8_t
strong

Collateral return type, MECNET or DIRECNET of the event.

Enumerator
Unknown 

A value this SDK version does not know.

MECNET 

MECNET

DIRECNET 

DIRECNET

Unset 

empty string

◆ FeeTypeOverride

enum class kalshi::ws::FeeTypeOverride : std::uint8_t
strong

Event fee type override.

Enumerator
Unknown 

A value this SDK version does not know.

Quadratic 

quadratic

QuadraticWithMakerFees 

quadratic_with_maker_fees

QuadraticWithComboMakerFees 

quadratic_with_combo_maker_fees

Flat 

flat

MarginMarketMakerProgramFees 

margin_market_maker_program_fees

◆ LifecyclePriceLevelStructure

enum class kalshi::ws::LifecyclePriceLevelStructure : std::uint8_t
strong

Optional - The market price level structure on creation or price_level_structure_updated events.

Enumerator
Unknown 

A value this SDK version does not know.

BandedCentiCent 

banded_centi_cent

Unset 

empty string

LinearCent 

linear_cent

DeciCent 

deci_cent

TaperedDeciCent 

tapered_deci_cent

CenterWholeEdgeHalfCent 

center_whole_edge_half_cent

CenterWholeEdgeQuintCent 

center_whole_edge_quint_cent

CenterHalfEdgeHalfCent 

center_half_edge_half_cent

CenterHalfEdgeQuintCent 

center_half_edge_quint_cent

CenterHalfEdgeDeciCent 

center_half_edge_deci_cent

CenterQuintEdgeQuintCent 

center_quint_edge_quint_cent

CenterQuintEdgeDeciCent 

center_quint_edge_deci_cent

CenterCentiEdgeCentiCent 

center_centi_edge_centi_cent

CenterDeciEdgeCentiCent 

center_deci_edge_centi_cent

◆ MarketLifecycleV2EventType

enum class kalshi::ws::MarketLifecycleV2EventType : std::uint8_t
strong

Field to annotate which of the event type this event is for.

Enumerator
Unknown 

A value this SDK version does not know.

Created 

created

Deactivated 

deactivated

Activated 

activated

CloseDateUpdated 

close_date_updated

Determined 

determined

Settled 

settled

PriceLevelStructureUpdated 

price_level_structure_updated

◆ MultivariateMarketLifecycleEventType

enum class kalshi::ws::MultivariateMarketLifecycleEventType : std::uint8_t
strong

Field to annotate which of the event type this event is for.

Enumerator
Unknown 

A value this SDK version does not know.

Created 

created

Deactivated 

deactivated

Activated 

activated

CloseDateUpdated 

close_date_updated

Determined 

determined

Settled 

settled

◆ OrderAction

enum class kalshi::ws::OrderAction : std::uint8_t
strong

Deprecated.

Enumerator
Unknown 

A value this SDK version does not know.

Buy 

buy

Sell 

sell

SellPartial 

sell_partial

SellToClose 

sell_to_close

Unset 

empty string

◆ OrderGroupUpdatesEventType

enum class kalshi::ws::OrderGroupUpdatesEventType : std::uint8_t
strong

Order group event type.

Enumerator
Unknown 

A value this SDK version does not know.

Created 

created

Triggered 

triggered

Reset 

reset

Deleted 

deleted

LimitUpdated 

limit_updated

◆ UpdateAction

enum class kalshi::ws::UpdateAction : std::uint8_t
strong
Enumerator
Unknown 

A value this SDK version does not know.

AddMarkets 

add_markets

DeleteMarkets 

delete_markets

GetSnapshot 

get_snapshot

SubscribeIndices 

subscribe_indices

UnsubscribeIndices 

unsubscribe_indices

Indexlist 

indexlist

SubscribeUnderlyings 

subscribe_underlyings

UnsubscribeUnderlyings 

unsubscribe_underlyings

UnderlyingList 

underlying_list

◆ UserFilter

enum class kalshi::ws::UserFilter : std::uint8_t
strong

Communications channel only.

Enumerator
Unknown 

A value this SDK version does not know.

Unset 

empty string

Self 

self

Function Documentation

◆ to_string() [1/10]

constexpr std::string_view kalshi::ws::to_string ( Channel  value)
constexprnoexcept

◆ to_string() [2/10]

constexpr std::string_view kalshi::ws::to_string ( CollateralReturnType  value)
constexprnoexcept

◆ to_string() [3/10]

constexpr std::string_view kalshi::ws::to_string ( FeeTypeOverride  value)
constexprnoexcept

◆ to_string() [4/10]

constexpr std::string_view kalshi::ws::to_string ( LifecyclePriceLevelStructure  value)
constexprnoexcept

◆ to_string() [5/10]

constexpr std::string_view kalshi::ws::to_string ( MarketLifecycleV2EventType  value)
constexprnoexcept

◆ to_string() [6/10]

constexpr std::string_view kalshi::ws::to_string ( MultivariateMarketLifecycleEventType  value)
constexprnoexcept

◆ to_string() [7/10]

constexpr std::string_view kalshi::ws::to_string ( OrderAction  value)
constexprnoexcept

◆ to_string() [8/10]

constexpr std::string_view kalshi::ws::to_string ( OrderGroupUpdatesEventType  value)
constexprnoexcept

◆ to_string() [9/10]

constexpr std::string_view kalshi::ws::to_string ( UpdateAction  value)
constexprnoexcept

◆ to_string() [10/10]

constexpr std::string_view kalshi::ws::to_string ( UserFilter  value)
constexprnoexcept

◆ error_code_name()

constexpr std::string_view kalshi::ws::error_code_name ( std::int64_t  code)
constexprnoexcept

Kalshi's name for a WebSocket error code, or an empty string for codes this SDK version does not know.