# Limit Order

<details>

<summary><strong>What is a Limit Order?</strong></summary>

A limit order is an order to buy or sell securities at a specific or more favorable price. If the market price doesn't match the specified price, the order won't be executed until the market price reaches the specified level. A limit order can be executed fully or partially. In the case of partial execution, only the portion that matches the counter-offer in terms of price and volume will be executed.\
\
![](https://2114663421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6XhXi6a2IHN3LW0c8Af%2Fuploads%2FYV7ONFKpEdFg0xubBhqm%2FScreenshot%202024-10-16%20at%201.05.14%E2%80%AFPM.png?alt=media\&token=810bef40-747f-42d0-ab64-92e053138336)

</details>

<details>

<summary><strong>How to open a Limit Order</strong></summary>

1. **Connect Wallet and Mint Tokens**

* Ensure you have connected your wallet and minted the necessary tokens. If not, please refer to the sections on [downloading and connecting a wallet](https://docs.v12.trade/trade/getting-started-as-a-trader/wallet-setup), and [minting test assets](https://docs.v12.trade/trade/getting-started-as-a-trader/deposit-assets-using-testnet-faucet).

2. **Choose the Market**

* Select the market where you want to exchange your tokens. For example, BTC-USDC, as shown in the screenshot.

3. **Select Order Type**

* Choose the type of order you want to create. In this tutorial, we will be using a **Limit Order**. Ensure that the "Limit" option is selected from the order type dropdown.

<img src="https://content.gitbook.com/content/K6XhXi6a2IHN3LW0c8Af/blobs/zMv9wXgEmWGgnUHporo9/image.png" alt="" data-size="original">

4. **Decide to Buy or Sell**

* Decide whether you want to buy or sell the base token. This can be done using the buy/sell switcher on the right side of the interface. Select "Buy" if you want to purchase the base token, or "Sell" if you want to sell it.

5. **Specify the Amount**

* Enter the amount of the base token you wish to exchange. You can manually input the amount or use the **MAX** button for a quick fill of the maximum available amount. Alternatively, you can use the slider to specify a percentage of your available funds.
  * **Important:** If you are providing ETH, ensure you leave enough for the transaction cost.

6. **Review Order Details**

* Check the order details, including the order size, price, and total amount. Make sure everything is correct before proceeding.

7. **Sign and Send Transaction**

* After reviewing your order, sign the transaction using your connected wallet and send it to the blockchain.

8. **Order Confirmation**

* Once the transaction is successfully processed, your order will be created and displayed in the order book.

</details>

<details>

<summary><strong>Types of Limit Orders</strong></summary>

1. **Good Till Cancelled (GTC):** A limit order that remains active until executed or canceled. Often supported by API for long-term position holding.
2. **Immediate or Cancel (IOC):** A limit order that must be executed immediately and fully or partially. The unfilled portion is canceled. Currently available via the SDK.
3. **Fill or Kill (FOK):** A limit order that must be executed fully and immediately. If not possible, the order is fully canceled. Currently available via the SDK.

</details>


---

# 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.v12.trade/trade/getting-started-as-a-trader/creating-orders/order-book/limit-order.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.
