> For the complete documentation index, see [llms.txt](https://docs.battle.fyi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.battle.fyi/the-game/how-battles-work.md).

# How Battles Work

A battle is a timed trading competition inside a lobby. Everyone starts with the same balance, trades the same assets at the same live prices, and gets ranked by return %.

## The flow

1. **Lobby opens.** Players join. The host (or auto-admin) sets the rules: starting balance, available assets, leverage tiers, round count, elimination rules.
2. **Countdown.** A timer counts down to round start. Everyone sees it.
3. **Round starts.** Trading is live. Open positions, close positions, use sabotage weapons. Prices are real-time from Pyth Network.
4. **Round ends.** All traders are ranked by return %. The bottom performers are eliminated (typically bottom 25%).
5. **Next round.** Survivors continue with their current balance. New round, same stakes.
6. **Final round.** Last traders standing compete for the win. Highest return % takes it.

## What carries between rounds

* Your balance (including realized P\&L from previous rounds)
* Your Trader Score progress
* Your credit balance (minus anything you spent on sabotage)

## What resets between rounds

* All open positions are closed at round end
* The leaderboard recalculates from current balances

## Lobby types

* **Public** -- anyone can join from the Arena
* **Private** -- invite code required
* **Sponsor-funded** -- credits provided by the event host, no cost to players

## Real-time everything

Prices, P\&L, leaderboard, sabotage effects, chat -- all update in real time via Supabase Realtime channels. No polling. No refresh needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.battle.fyi/the-game/how-battles-work.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
