> For the complete documentation index, see [llms.txt](https://docs.vigilan.market/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vigilan.market/vigilan-market/trading-and-order-management.md).

# Trading and Order Management

#### The order book

The order book contains bids to buy and asks to sell. The spread is the difference between the best bid and best ask. Depth is the quantity available at different prices.

| Order type                 | Behavior                                             | Main consideration                              |
| -------------------------- | ---------------------------------------------------- | ----------------------------------------------- |
| Market order, when offered | Trades against available orders at executable prices | Final price and filled size depend on liquidity |
| Limit order                | Trades only at your limit price or better            | May remain unfilled or fill only partly         |

A large order may trade at several price levels. Review the order summary and distinguish a share count from a USDT spending amount.

#### Matching and settlement

Orders are matched off-chain and settled through on-chain contracts. Matching and settlement are distinct: a trade is not final merely because the matching engine has found another order.

An individual settlement is atomic. The associated token and collateral transfers either execute together or do not execute. One order can fill through multiple settlements.

#### Common order states

| State            | Meaning                                           |
| ---------------- | ------------------------------------------------- |
| Open             | Waiting for execution                             |
| Partially filled | Some quantity has executed                        |
| Filled           | The requested quantity has executed               |
| Cancelled        | The remaining order has been cancelled            |
| Expired          | The order is no longer valid under its time limit |

For a partially filled order, check the status of the remainder. It may remain open or be cancelled according to the order type. Cancelling an unfilled remainder does not reverse trades that have already settled.

#### Exiting early

You can seek an early exit by selling your shares while trading is available. The position closes only to the extent that your sell order executes.

Realized trading profit or loss equals sale proceeds minus the cost of the shares sold and applicable costs. An early sale also reduces the payout you could receive at resolution.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.vigilan.market/vigilan-market/trading-and-order-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
