pub struct Kalshi { /* private fields */ }Implementations§
Source§impl Kalshi
impl Kalshi
pub fn new(config: KalshiConfig) -> Result<Kalshi, KalshiError>
pub fn with_default_config() -> Result<Kalshi, KalshiError>
Trait Implementations§
Source§impl Exchange for Kalshi
impl Exchange for Kalshi
fn id(&self) -> &'static str
fn name(&self) -> &'static str
Source§fn manifest(&self) -> &'static ExchangeManifest
fn manifest(&self) -> &'static ExchangeManifest
Returns the exchange manifest containing connection and data mapping configuration.
Source§async fn fetch_markets(
&self,
params: &FetchMarketsParams,
) -> Result<(Vec<Market>, Option<String>), OpenPxError>
async fn fetch_markets( &self, params: &FetchMarketsParams, ) -> Result<(Vec<Market>, Option<String>), OpenPxError>
Fetch one page of markets from this exchange. Read more
async fn fetch_market(&self, market_id: &str) -> Result<Market, OpenPxError>
Source§async fn fetch_orderbook(
&self,
req: OrderbookRequest,
) -> Result<Orderbook, OpenPxError>
async fn fetch_orderbook( &self, req: OrderbookRequest, ) -> Result<Orderbook, OpenPxError>
Fetch L2 orderbook for a market outcome.
Uses owned types for async compatibility.
Source§async fn fetch_price_history(
&self,
req: PriceHistoryRequest,
) -> Result<Vec<Candlestick>, OpenPxError>
async fn fetch_price_history( &self, req: PriceHistoryRequest, ) -> Result<Vec<Candlestick>, OpenPxError>
Fetch historical OHLCV price history / candlestick data for a market outcome.
Source§async fn fetch_trades(
&self,
req: TradesRequest,
) -> Result<(Vec<MarketTrade>, Option<String>), OpenPxError>
async fn fetch_trades( &self, req: TradesRequest, ) -> Result<(Vec<MarketTrade>, Option<String>), OpenPxError>
Fetch recent public trades (“tape”) for a market outcome.
Returns
(trades, next_cursor) where next_cursor supports pagination.async fn create_order( &self, market_id: &str, outcome: &str, side: OrderSide, price: f64, size: f64, params: HashMap<String, String>, ) -> Result<Order, OpenPxError>
async fn cancel_order( &self, order_id: &str, _market_id: Option<&str>, ) -> Result<Order, OpenPxError>
async fn fetch_order( &self, order_id: &str, _market_id: Option<&str>, ) -> Result<Order, OpenPxError>
async fn fetch_open_orders( &self, _params: Option<FetchOrdersParams>, ) -> Result<Vec<Order>, OpenPxError>
async fn fetch_positions( &self, market_id: Option<&str>, ) -> Result<Vec<Position>, OpenPxError>
async fn fetch_balance(&self) -> Result<HashMap<String, f64>, OpenPxError>
Source§async fn fetch_fills(
&self,
market_id: Option<&str>,
limit: Option<usize>,
) -> Result<Vec<Fill>, OpenPxError>
async fn fetch_fills( &self, market_id: Option<&str>, limit: Option<usize>, ) -> Result<Vec<Fill>, OpenPxError>
Fetch user’s fill (trade execution) history for a market.
Source§async fn fetch_balance_raw(&self) -> Result<Value, OpenPxError>
async fn fetch_balance_raw(&self) -> Result<Value, OpenPxError>
Fetch raw balance response from exchange API
fn describe(&self) -> ExchangeInfo
Source§async fn refresh_balance(&self) -> Result<(), OpenPxError>
async fn refresh_balance(&self) -> Result<(), OpenPxError>
Refresh cached balance/allowance state if supported by the exchange.
Source§async fn fetch_orderbook_history(
&self,
req: OrderbookHistoryRequest,
) -> Result<(Vec<OrderbookSnapshot>, Option<String>), OpenPxError>
async fn fetch_orderbook_history( &self, req: OrderbookHistoryRequest, ) -> Result<(Vec<OrderbookSnapshot>, Option<String>), OpenPxError>
Fetch historical L2 orderbook snapshots for a market.
Returns
(snapshots, next_cursor) for pagination.Source§async fn fetch_user_activity(
&self,
params: FetchUserActivityParams,
) -> Result<Value, OpenPxError>
async fn fetch_user_activity( &self, params: FetchUserActivityParams, ) -> Result<Value, OpenPxError>
Fetch user activity (positions, trades, portfolio data) for a given address.
Auto Trait Implementations§
impl Freeze for Kalshi
impl !RefUnwindSafe for Kalshi
impl Send for Kalshi
impl Sync for Kalshi
impl Unpin for Kalshi
impl UnsafeUnpin for Kalshi
impl !UnwindSafe for Kalshi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more