↓ Skip to main content
All methods

stakepd.kalshi_data.KalshiClient.get_positions

★ Most used API key → DataFrame
Signature
client.get_positions(*, ticker=None, event_ticker=None, settlement_status="unsettled",
                     count_filter=None, max_results=None)

List your positions, one row per market.

Parameters

ticker:str, optional
Only this market.
event_ticker:str, optional
Only markets in this event.
settlement_status:{'unsettled', 'settled', 'all'}, default 'unsettled'
"unsettled" returns open positions.
count_filter:{'position', 'total_traded'} or list of them, optional
Leaves out rows where that value is zero. For example, count_filter="position" hides markets you’ve fully exited.
max_results:int, optional
Stop after this many rows. None (the default) fetches all of them, following Kalshi’s pages for you.

Returns

pandas.DataFrame
One row per market.
Main columns
ColumnTypeDescription
tickerstrMarket ticker
positionfloatContracts held. Positive = YES, negative = NO.
market_exposurefloatCost basis of the current position, in dollars
realized_pnlfloatRealised profit or loss, in dollars
fees_paidfloatFees paid, in dollars
total_tradedfloatTotal dollars traded in this market
last_updated_tsdatetime64[ns, UTC]Last change to the position

Raises

KalshiAuthError
If the client has no credentials. Raised before any request is sent.

See also

KalshiClient.get_event_positions
Positions added up per event.
KalshiClient.get_fills
List your fills, newest first.
KalshiClient.get_settlements
List markets you held when they settled, and what they paid out.

Examples
#

from stakepd import kalshi_data as kd

client = kd.KalshiClient.from_env()   # portfolio data needs an API key

Open positions with their side:

pos = client.get_positions(count_filter="position")
pos["side"] = pos.position.gt(0).map({True: "YES", False: "NO"})
print(pos[["ticker", "side", "position", "market_exposure", "realized_pnl"]])

This method is also covered, alongside the rest of the module, in the overview guide.