How it works
Every market group has a maximum-loss (MXL) value tracked by the escrow contract. MXL represents the worst-case net loss across all your open positions in that group. When a new trade is filled, the system recalculates MXL for every party involved. If your MXL has decreased, the escrow adjusts down to match the new MXL level and releases the excess to your wallet on the spot. This applies to both makers and takers. Refunds are computed at fill time across all parties to the trade, not just the taker who triggered it.Example
You bet $100 on Team A at +100 odds. Your MXL is $100 — the most you can lose, so $100 is locked in escrow. Later you bet $100 on Team B at +100 odds in the same game. In any outcome one side always pays out, so your worst-case net loss is $0. The system recalculates MXL as $0 and immediately refunds all $200 from escrow.Tracking CE refunds
UseGET /trades/portfolio/refunds to query refunds by bettor, marketHash, baseToken, or fillOrderHash. For real-time updates, subscribe to the ce_refunds:{bettor} channel.
Trade objects from GET /trades, GET /trades/orders, and GET /trades/consolidated include a marketHasRefunds boolean. When true, one or more CE refunds have been issued for that market group.
P&L accounting
CE refunds are returned to your wallet before settlement, so they won’t appear insettledNetReturn. When reconciling P&L for a market where marketHasRefunds is true, add the refund amounts back in:
Related
CE Refund Events →
Real-time WebSocket channel for refund events.
GET /trades/portfolio/refunds →
Query CE refunds by bettor, market, or trade.
