kalshi-cpp 0.6.2
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
ws_models.hpp File Reference
#include "kalshi/models.hpp"
#include <array>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <variant>
#include <vector>

Go to the source code of this file.

Classes

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

Namespaces

namespace  kalshi
 
namespace  kalshi::ws
 

Typedefs

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

Functions

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