Signatureclient.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| Column | Type | Description |
|---|
ticker, event_ticker | str | Market and event |
settled_time | datetime64[ns, UTC] | When it settled |
market_result | str | "yes", "no" or "scalar" |
yes_count, no_count | float | Contracts you held on each side |
yes_total_cost, no_total_cost | float | What you paid for them, in dollars |
revenue | float | Payout, in dollars (Kalshi sends cents; converted) |
value | float | Settlement value per contract, in dollars (converted from cents) |
fee_cost | float | Fees, in dollars |
Raises
KalshiAuthError- If the client has no credentials. Raised before any request is sent.
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.