> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sx.bet/llms.txt
> Use this file to discover all available pages before exploring further.

# Capital Efficiency

> How SX Bet's capital efficiency system reduces locked escrow by recognizing hedged positions.

SX Bet locks tokens in escrow when you place a bet, and releases them at settlement. Capital efficiency (CE) short-circuits that process: when your positions within a market group offset each other, the system calculates your true worst-case loss and returns any excess escrow to your wallet immediately — without waiting for the market to settle.

## 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

Use [`GET /trades/portfolio/refunds`](/api-reference/get-trades-refunds) to query refunds by `bettor`, `marketHash`, `baseToken`, or `fillOrderHash`. For real-time updates, subscribe to the [`ce_refunds:{bettor}`](/api-reference/centrifugo-ce-refund-events) channel.

Trade objects from [`GET /trades`](/api-reference/get-trades), [`GET /trades/orders`](/api-reference/get-trades-orders), and [`GET /trades/consolidated`](/api-reference/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 in `settledNetReturn`. When reconciling P\&L for a market where `marketHasRefunds` is `true`, add the refund amounts back in:

```
actual_return = settledNetReturn + sum(CE refunds for that market group)
```

## Related

<CardGroup cols={2}>
  <Card title="CE Refund Events →" icon="arrows-rotate" href="/api-reference/centrifugo-ce-refund-events">
    Real-time WebSocket channel for refund events.
  </Card>

  <Card title="GET /trades/portfolio/refunds →" icon="receipt" href="/api-reference/get-trades-refunds">
    Query CE refunds by bettor, market, or trade.
  </Card>
</CardGroup>
