↓ Skip to main content
All methods

stakepd.kalshi_data.KalshiClient.get_settlements

API key → DataFrame
Signature
client.get_settlements(*, ticker=None, event_ticker=None, start=None, end=None,
                       max_results=None)

List markets you held when they settled, and what they paid out.

Times accept a str, datetime, date, pandas.Timestamp or Unix seconds. See Time arguments.

Parameters

ticker:str, optional
Only this market.
event_ticker:str, optional
Only markets in this event.
start, end:time, optional
Only settlements within this window.
max_results:int, optional
Stop after this many settlements. None (the default) fetches all of them, following Kalshi’s pages for you.

Returns

pandas.DataFrame
One row per settled market.
Main columns
ColumnTypeDescription
ticker, event_tickerstrMarket and event
settled_timedatetime64[ns, UTC]When it settled
market_resultstr"yes", "no" or "scalar"
yes_count, no_countfloatContracts you held on each side
yes_total_cost, no_total_costfloatWhat you paid for them, in dollars
revenuefloatPayout, in dollars (Kalshi sends cents; converted)
valuefloatSettlement value per contract, in dollars (converted from cents)
fee_costfloatFees, in dollars

Raises

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

See also

KalshiClient.get_positions
List your positions, one row per market.
KalshiClient.get_fills
List your fills, newest first.

Examples
#

from stakepd import kalshi_data as kd

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

Profit and loss per settled market:

s = client.get_settlements()
s["pnl"] = s.revenue - s.yes_total_cost - s.no_total_cost - s.fee_cost
print(s[["ticker", "market_result", "pnl"]].sort_values("pnl"))
print("Total P&L:", round(s.pnl.sum(), 2))

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