Skip to content

Positions and liability

The STX exchange wallet model is more nuanced than a traditional sportsbook. Rather than simply deducting a stake on bet placement and paying out on settlement, the exchange tracks several liability categories that change in real time as orders are placed, matched, and settled.


Field Description
available_balance Cash you can use to place new orders
buy_order_liability Risk tied up in unfilled buy orders
sell_order_liability Risk tied up in unfilled sell orders
position_premium_liability Risk from contracts you currently hold

Your total exposure at any moment is the sum of all liability fields. The available_balance decreases when you place an order and can increase as orders are filled.

Subscribe to the portfolio channel to receive live updates whenever any of these numbers change.


When you place an order the exchange immediately reserves the maximum possible loss — this is your order liability.

  • Buy order: price × quantity. A limit buy of 10 contracts at $45 incurs $450 of order liability, reducing available_balance by $450.
  • Sell order: (maxPrice − price) × quantity. A limit sell of 10 contracts at $36 on a $100 market incurs $(100 − 36) × 10 = $640 of order liability.

When a trade executes on your order, order liability converts to position liability — the maximum loss on the contracts you now hold.

Importantly, this conversion often increases your available balance, because you filled at a better price than your limit. For example:

  • You place a limit buy for 10 contracts at $45 → order liability: $450, available balance decreases by $450.
  • Five contracts fill at $43 → position liability for the 5 filled: $215. Remaining order liability for the 5 unfilled: $225. Total: $440.
  • Your available balance increases by $10 (the $5 saving × 2 contracts that filled below limit).

Placing an order on the opposite side of an existing position does not add new liability — it hedges the existing one.

Example: You hold a long position of 10 contracts bought at $45 ($450 position liability). You place a sell order for 5 contracts at $60.

  • The sell order does not change your available balance because your total risk is unchanged.
  • When the sell fills, a settlement is generated: 5 × ($60 − $45) = $75 gross profit added to available balance.
  • Position liability drops to $225 (5 remaining contracts × $45).
  • Your maximum possible loss is now $225 − $75 = $150 net, because you have locked in a $75 profit regardless of the final result.

When a market resolves, all open contracts settle at either maxPrice (typically $100) or $0:

  • Won: position liability is released and you receive maxPrice × quantity. Net gain is (maxPrice − avgPrice) × quantity.
  • Lost: contracts settle at $0. The position liability is released, but you receive nothing back — your maximum loss on the position was already reserved.

All transactions are fully capitalised. There is no margin or leverage.


Channel What it delivers
portfolio Available balance and liability totals
active_positions Per-market position summary, including unrealised P&L
active_trades Individual trade confirmations
active_settlements Settlement records as they are created