> For the complete documentation index, see [llms.txt](https://countertrade.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://countertrade.gitbook.io/docs/funds-and-settlement/settlement.md).

# Settlement

How final standings become on-chain payouts you claim yourself, what you can verify, and what you're trusting.

When a room ends, its final standings are turned into on-chain payouts. Settlement is that step: the results are computed, committed on-chain, and locked in as claimable prizes. It's how a battle result becomes real tokens you can claim.

## From standings to payouts

When the clock runs out, the room reaches **Ended**, no more orders execute, and the standings are final — ranked by ROI. CounterTrade then computes the payouts from the entry fees held in escrow for that room. Each participant's payout follows the room's format — see [Room formats](/docs/battles/room-formats.md).

The prize pool is the pooled entry fees minus the platform fee — currently 10% (see [Entry fees and escrow](/docs/funds-and-settlement/entry-fees-and-escrow.md)). Every payout is computed in whole token units, and the prizes plus the fee always add up to exactly what was collected — never more.

## Committed on-chain

The result isn't just announced — it's committed. Each participant's payout is recorded as one entry in a list, and a single fingerprint of that whole list (its **Merkle root**) is stored on-chain, along with CounterTrade's signature over it. The room then moves **Ended → Settled → Finalized**. There's no dispute step and no waiting window between them — finalizing follows settlement directly, and prize claims open once the room is **Finalized**.

## What you can verify

You don't have to take the payout on faith:

* **Your prize was fixed the moment the room settled.** When you claim, your wallet supplies a short cryptographic proof that your payout is part of the committed root; the contract checks that proof before paying. A number that isn't in the committed root can't be claimed, and the committed numbers can't be quietly changed afterward.
* **The pool is conserved.** The contract enforces that all prizes plus the platform fee add up to exactly the entry fees collected. It can't pay out more than the pool.
* **Results are frozen once submitted.** A settled room can't be re-settled or its numbers re-signed.
* **Only participants get paid.** A payout entry for a wallet that didn't join the room is rejected on-chain even if it were signed.

## What you're trusting

CounterTrade computes the final standings and PnL off-chain and signs the result. Anyone can relay that signed result on-chain, but only CounterTrade's signature is accepted. So there is one thing you trust us for: **ranking the room correctly.** There's no dispute process to formally contest a result.

What you don't have to trust us for: we can't pay someone who didn't play, and can't take more than the fee set for the room — the contract rejects all of that — and you can check your own prize against the committed on-chain record. To check a whole room's result yourself, see [Check a result](/docs/transparency/check-a-result.md). It's a verifiable settlement with a single, clearly-bounded trusted step, not an opaque payout.

## If settlement doesn't complete

Settlement has a deadline — a window after the room ends (about a day by default). If, for any reason, the result isn't submitted before that deadline, the room can be turned back into a **Cancelled** room by anyone, and every participant claims a full refund of their entry fee. So your money doesn't hinge on us settling on time — after the deadline it becomes claimable as a refund rather than left in limbo. An emergency pause of the escrow would delay this until it's unpaused.

## Claiming your prize

Payouts are pull-based: your prize isn't sent automatically. You claim it yourself, from the wallet you joined with, once the room is **Finalized** — until then it stays in escrow earmarked for you. Nothing about your paper trading changes at settlement; the paper balance was simulated and stays in the room. What settlement produces is a real, claimable payout of the entry-fee token. Give the **Ended → Settled → Finalized** sequence a moment after the room ends; if the claim isn't available yet, wait a few seconds and refresh.

## Related

* [Claims and refunds](/docs/funds-and-settlement/claims-and-refunds.md)
* [Entry fees and escrow](/docs/funds-and-settlement/entry-fees-and-escrow.md)
* [Battle lifecycle](/docs/battles/battle-lifecycle.md)
* [What is published for each room](/docs/transparency/what-is-published.md)
