Settlements and payouts
A settlement is the final money-movement event for a set of contracts. Every settlement results in a realised profit or loss and the release of the corresponding position liability back into your available balance.
When Settlements Are Created
Section titled “When Settlements Are Created”Settlements are generated in two situations:
-
You close a position by trading. If you bought 10 contracts and then sell 5, those 5 contracts are settled against each other at the prices you paid and received. The remaining 5 stay open.
-
A market expires. When STX resolves a market, all outstanding contracts settle at
maxPrice(typically $100) for a win, or $0 for a loss.
Settlement Fields
Section titled “Settlement Fields”| Field | Description |
|---|---|
id |
Unique settlement ID |
type |
e.g. closed_long, closed_short, expired_won, expired_lost |
opening_trade_id |
The trade that opened the position |
closing_trade_id |
The trade (or market result) that closed it |
opening_price |
Price paid when the position was opened (cents) |
closing_price |
Price received when closed, or maxPrice/0 on expiry |
quantity |
Number of contracts settled |
fee |
Exchange fee charged on this settlement |
gross_pnl |
(closing_price − opening_price) × quantity |
realized_pnl |
gross_pnl − fee |
market_id |
Market the settlement belongs to |
account_id |
Account the settlement belongs to |
inserted_at |
ISO 8601 timestamp |
Example Settlement
Section titled “Example Settlement”A user sold 100 contracts at $10 (opening a short) and later bought 100 contracts at $20 (closing the short). The settlement looks like:
{ "id": "801d773e-fecc-418a-b377-155605595178", "type": "closed_short", "opening_trade_id": "17aa760d-50c0-4c1a-a5c6-fe4af4adb4bb", "closing_trade_id": "7f959093-6a30-4b48-9a59-d1e09f004340", "opening_price": 10, "closing_price": 20, "quantity": 100, "fee": 50, "gross_pnl": 1000, "realized_pnl": 950, "market_id": "687e9cdb-a391-4118-aa80-1122bb14779f", "account_id": "c1c3614c-32ae-4bea-bae4-fc3f52047790", "inserted_at": "2020-11-01T19:02:28.125460Z"}Gross P&L: $(20 − 10) × 100 = $1,000. After a $50 fee: $950 net realised P&L.
!!! note For a short position the sign convention is: selling contracts at a low price and buying them back at a higher price is a loss; buying back at a lower price is a profit. For a long position it is the reverse.
Querying Settlement History
Section titled “Querying Settlement History”Use the mySettlementsHistory query to
retrieve past settlements, or tradesForSettlement
to get the opening and closing trades for a specific settlement.
Real-Time Settlement Notifications
Section titled “Real-Time Settlement Notifications”Subscribe to the active_settlements channel to
receive settlement records the instant they are created. This is the most reliable way to
keep a running P&L in your integration — polling settlement history will always lag behind
the live state of the exchange.

