# Order Types and Matching

### Order Types and Matching

The platform operates on a **limit-order basis**. Clients can **buy options to open positions** and **sell options to close positions**. All orders are **GTC (Good Till Canceled)**.

#### Order Types

**BBO (Best Bid Offer) Order**

* A limit order placed at the current **best available price**.
* If the market price changes while the order is being processed, the order is placed at the requested price as a limit order.
* Orders execute **for the available volume**. Any unfilled contracts remain in the order book as a limit order.

*Example – BTC Call (BBO Buy)*

* Instrument: `BTC-250926-115000-C`
* Current Order Book: **Bid 425 / Ask 428**

1. **Scenario A – No price change**
   * User places a **BBO buy order for 10 contracts at 428**.
   * Ask remains **428** with only **7 contracts available**.
   * Result: **7 contracts execute immediately at 428**, and the remaining **3 contracts rest in the order book as a limit order at 428**.
2. **Scenario B – Price change**
   * User places a **BBO buy order at 428**.
   * Ask moves to **431** during processing.
   * Result: A **limit order at 428** is placed in the order book for the full amount (pending fill).
3. **Scenario C – Price change**
   1. User places a **BBO buy order fro 10 cpntracts  at 428**.
   2. Ask moves to **420** during processing and 20 contracts available.&#x20;
   3. Result: 10 contracts are executed immediatley at 420.

**Close Order**

* Using the **Close button** submits a **sell BBO order** for the open position.
* If the market drops while processing, the order is placed at the requested price as a limit order.
* Orders execute **for the available volume**; any remaining contracts rest in the book.

*Example – BTC Call (Close)*

* Open Position: Long 0.05 contracts `BTC-250926-115000-C`
* Current Order Book: **Bid 422 / Ask 426**

1. **Scenario A – No price change**
   * User clicks **Close**.
   * Bid remains at **422**, with full size available.
   * Result: **All 0.05 contracts are sold immediately at 422**.
2. **Scenario B – Partial fill**
   * User clicks **Close** to sell 10 contracts at **Bid 422**.
   * Only **6 contracts are available** at 422.
   * Result: **6 contracts sell immediately at 422**, and the remaining **4 contracts rest in the order book at 422**.
3. **Scenario C – Price change**
   * User clicks **Close**.
   * Bid falls to **419** during processing.
   * Result: A **sell limit order at 422** is placed in the order book (pending fill).

**Limit Order**

* Placed directly in the order book at the **specific price** requested by the user.
* Remains active until matched or canceled.
* Supports **partial fills** — executed volume reduces the open amount, with the remainder staying in the book.

**Sell Limit Order (for Open Positions)**

* Lets users set a **target exit price** for their open position.
* Partial fills are possible if liquidity is less than the order size.

#### Matching Engine

* **Centralized Order Book**: All orders are placed in the book and matched by the engine.
* **Execution Rule**: Price-time priority (best price first, then earliest order).
* **Partial Fills**: Supported. Any unfilled contracts remain GTC in the book.
* **Order Book Visibility**: At (Phase 1), the order book is not displayed to clients, though all orders still rest and match in the book.


---

# Agent Instructions: 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.clickoptions.ai/trade/order-types-and-matching.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.
