Overview
Connect to receive real-time market data for all markets within a specific event, including bid/ask prices, volume, and open interest.
Connection
wss://api.bison.markets/ws/kalshi/event/{eventTicker}
The Kalshi event ticker (e.g., KXBTC-100K)
Example Connection
const eventTicker = "KXBTC-100K" ;
const ws = new WebSocket (
`wss://api.bison.markets/ws/kalshi/event/ ${ eventTicker } `
);
ws . onopen = () => {
console . log ( `Connected to ${ eventTicker } market data` );
// Send heartbeat every 30 seconds
setInterval (() => {
if ( ws . readyState === WebSocket . OPEN ) {
ws . send ( JSON . stringify ({ type: "ping" }));
}
}, 30000 );
};
ws . onmessage = ( event ) => {
const data = JSON . parse ( event . data );
// Ignore ping/pong messages
if ( data . type === "ping" || data . type === "pong" ) {
return ;
}
console . log ( "Market update:" , data );
updateMarketDisplay ( data );
};
Ticker updates contain the latest market data:
{
"market_ticker" : "KXBTC-100K-DEC31" ,
"yes_bid_uusdc" : 720000 ,
"yes_ask_uusdc" : 750000 ,
"no_bid_uusdc" : 250000 ,
"no_ask_uusdc" : 280000 ,
"last_price_uusdc" : 735000 ,
"volume" : 15000 ,
"open_interest" : 50000
}
Response Fields
Market ticker being updated
Best bid price for YES in µUSDC
Best ask price for YES in µUSDC
Best bid price for NO in µUSDC
Best ask price for NO in µUSDC
Last traded price in µUSDC
Current open interest (outstanding contracts)
All price fields are in µUSDC (microUSDC). To convert to USDC: priceUSDC = priceUusdc / 1,000,000 For example, 750000 µUSDC = 0.75 USDC (75% probability).
Example: Building a Price Display
const eventTicker = "KXBTC-100K" ;
const ws = new WebSocket (
`wss://api.bison.markets/ws/kalshi/event/ ${ eventTicker } `
);
// Store market data
const markets = new Map ();
ws . onmessage = ( event ) => {
const data = JSON . parse ( event . data );
if ( data . type === "ping" || data . type === "pong" ) {
return ;
}
// Update market data
markets . set ( data . market_ticker , {
yesBid: data . yes_bid_uusdc / 1_000_000 ,
yesAsk: data . yes_ask_uusdc / 1_000_000 ,
noBid: data . no_bid_uusdc / 1_000_000 ,
noAsk: data . no_ask_uusdc / 1_000_000 ,
lastPrice: data . last_price_uusdc / 1_000_000 ,
volume: data . volume ,
openInterest: data . open_interest ,
});
// Update your UI
renderMarketData ( data . market_ticker , markets . get ( data . market_ticker ));
};
function renderMarketData ( ticker , data ) {
console . log ( ` ${ ticker } :` );
console . log ( ` YES: ${ data . yesBid } bid / ${ data . yesAsk } ask` );
console . log ( ` NO: ${ data . noBid } bid / ${ data . noAsk } ask` );
console . log ( ` Last: ${ data . lastPrice } , Volume: ${ data . volume } ` );
}
Use Cases
Live Price Feeds Display real-time bid/ask spreads for markets in an event
Trading Dashboards Build comprehensive market overviews with live data
Price Alerts Trigger notifications when prices reach certain thresholds
Market Analytics Track volume and liquidity changes in real-time