> 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/trading/how-orders-execute.md).

# How your orders execute

How your orders fill against Bybit's live order book — real depth, slippage, the ticket's impact estimate, fees, and mark-price liquidation.

Your orders are paper, but they fill against Bybit's live order book — the same prices and depth a real trader sees. So you get real slippage on size, and real fees when a room charges them. What isn't real: the money is simulated and your orders never reach the exchange, so they can't move the price or take real liquidity. You fill against a read-only copy of the book, and two traders can fill against the same depth.

## The order book

Each market shows the full ladder of bids and asks — the size resting at every price level, not just a single last price. When you place an order, CounterTrade fills it against a fresh snapshot of that ladder and records the exact levels it used, so every fill can be reproduced later.

## Market orders and slippage

A market order fills immediately, walking the book from the best price outward. A small order fills near the top; a large one eats through several levels and gets a worse average price — that's slippage. Your fill price is the size-weighted average of the levels it consumed.

Nothing caps how far a market order walks: it fills at whatever prices the depth sits until your whole size is filled or the book runs out. Your position is valued at the mark price, close to the middle of the book, so a deep fill opens at a loss before the market moves. To cap your price, use a limit order.

Two things can cut a market order short:

* If the book runs out of depth partway through, the filled part stands and the rest is cancelled — you'll see **Expired — market depth was exhausted.**
* If there's no depth to fill at all, it's rejected: **Order book has no depth to fill this market order.**

And if the book can't be read for a moment, the order is rejected with **Order book is temporarily unavailable. Try again.** rather than filling at a guessed price.

## Check the impact before you send

While you size a market order, the ticket shows **Est. avg fill**, the average price it would fill at, and **Price impact**, how far that average sits from the mid price. If the book can't hold your whole size, **Book fills** shows how much of it would fill.

If the book would run out, or the slippage would cost more than 5% of the order's margin, the ticket shows a warning — **Opens at a loss** or **The book runs out**, with the estimated loss against mid — and asks before it sends. Select the button that names your order, for example `Buy / Long — 0.5 BTC`, to send it, or **Back to the ticket**.

The estimate is a preview: the order fills against a fresh read of the book a moment later. With no current book to read, the ticket shows no estimate and sends without asking.

## Closing a position on a thin book

**Close** and **Close all** send a reduce-only market order per position, which fills into the book the same way. The confirmation estimates each close's average price and says when the book holds less than the position. If you confirm, the part that fills closes and the rest stays open, its take-profit and stop-loss still on it — close it again once the book has depth. **Keep open** backs out.

## Take-profit and stop-loss closes

When a take-profit or stop-loss fires, it sends a market close for what is left of the position at that moment. It never closes more than the size you set it for. It fills into the book like any market order, without asking first.

* If you close part of the position yourself just as the trigger fires, the trigger closes the rest, up to the stop's size, instead of failing.
* If you closed the whole position first, there is nothing left to close: the trigger is cancelled, and it never opens a position in the other direction.
* A trigger belongs to the position you set it on. If you close that position and open a new one on the same market while the trigger is firing, the trigger never touches the new position.
* If you cancel or replace a trigger while it is firing, the close it already sent still goes through, but the trigger doesn't come back for the rest.
* If the book runs out of depth partway through, the part that filled stands, as with any market order, but the trigger isn't spent. It stays on the position for the part it didn't close and fires again on the next price check while the price is still past your level. If the price moves back first, it waits for your level like before.

## Limit orders

A limit order that already crosses the market fills right away — you're the taker. Otherwise it rests at your price and fills when the market reaches it — you're the maker. Because a resting limit fills from the best available price outward, it can fill a little better than the price you set. A limit can fill in parts as depth arrives; the unfilled remainder keeps resting until it fills or you cancel it.

Resting limits are checked continuously and fill within a short delay of the market reaching them — close to, but not exactly, tick-by-tick exchange matching.

## Fees

A room can charge a trading fee, split into maker and taker: orders that fill on placement (market orders and immediately-crossing limits) pay the taker fee, and resting limits that fill later pay the maker fee. The fee is taken per fill and is fully deterministic. Many rooms run with no trading fee — a room's rules show what it charges.

## Mark price and liquidation

Your open positions are valued on Bybit's **mark price**, and that same mark decides liquidation: when your equity falls to a position's maintenance margin, the position is liquidated. CounterTrade only acts on a fresh mark — if the feed lags, liquidation waits for it to recover instead of firing on a stale price. See [Position liquidation](/docs/trading/liquidation.md) and [Full account liquidation](/docs/trading/liquidation.md) for what happens next.

Liquidations don't fill against the book: the position closes at the mark price. Positions still open when a battle ends close at the room's closing price — see [Battle rules and scoring](/docs/battles/battle-rules-and-scoring.md).

## Related

* [Place an order](/docs/trading/place-an-order.md)
* [Order types](/docs/trading/order-types.md)
* [PnL and ROI](/docs/trading/pnl-and-roi.md)
* [Leverage](/docs/trading/leverage.md)
