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

Defaults match Kalshi's Basic tier. More...

#include <kalshi/rate_limit.hpp>

Public Attributes

TokenBucket::Config read {.capacity = 600.0, .refill_per_second = 200.0, .initial_tokens = {}}
 
TokenBucket::Config write {.capacity = 100.0, .refill_per_second = 100.0, .initial_tokens = {}}
 
double default_cost {10.0}
 Cost of requests without a matching rule. Kalshi's default is 10.
 
std::vector< EndpointCostRule > costs
 
std::chrono::milliseconds max_wait {std::chrono::seconds{5}}
 Longest wait for tokens before failing with ErrorCode::RateLimited.
 

Detailed Description

Defaults match Kalshi's Basic tier.

Use rate_limit_config() for your account's actual budgets.

Member Data Documentation

◆ read

TokenBucket::Config kalshi::RateLimitConfig::read {.capacity = 600.0, .refill_per_second = 200.0, .initial_tokens = {}}

◆ write

TokenBucket::Config kalshi::RateLimitConfig::write {.capacity = 100.0, .refill_per_second = 100.0, .initial_tokens = {}}

◆ default_cost

double kalshi::RateLimitConfig::default_cost {10.0}

Cost of requests without a matching rule. Kalshi's default is 10.

◆ costs

std::vector<EndpointCostRule> kalshi::RateLimitConfig::costs

◆ max_wait

std::chrono::milliseconds kalshi::RateLimitConfig::max_wait {std::chrono::seconds{5}}

Longest wait for tokens before failing with ErrorCode::RateLimited.

A request that costs more than its bucket holds fails with InvalidRequest, because Kalshi rejects it too; split large batches.


The documentation for this struct was generated from the following file: