> For the complete documentation index, see [llms.txt](https://docs.position.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.position.exchange/products/trading-protocol/beginners-guide/close-position/close-market.md).

# Close Market

A market close is instant, and you close the position at the best available spot price.

Here’s the guideline to close a position by market order

**Step 1:** Choose the quantity you want to close

* Choose the percentage of quantity in your intention of closing (10%, 25%, 50%, 75%,100%).       &#x20;

<figure><img src="/files/ZymQem1jT9t7SFgJ3PxQ" alt=""><figcaption></figcaption></figure>

* The defaulted percentage is 100% which means closing the whole position. Otherwise, you can quickly choose other percentages of position quantity (10%, 25%, 50%, 75%), it just reduces the position.

{% hint style="info" %}

* If the quantity of market close plus the quantity of a limit close that you have had previously overwhelmed the quantity of the position, the system will cancel limit close order to execute the market close order.
* If the quantity of market close order is below the minimum quantity required corresponding to each pair, this order can not be executed. Filling a larger quantity can solve this issue.
* If the quantity of market close order is more than 100% of market dept which is informed in the order book,  this order can not be executed. Filling a smaller quantity can solve this issue.
  {% endhint %}

**Step 2:** Click **Market** button on the right side of the position.

<figure><img src="/files/dV8XRbXUxJX988yv6CsM" alt=""><figcaption></figcaption></figure>

**Step 3:** Confirm the action

* The system creates an order of closing with the quantity selected. Check the details in this pop-up before clicking **Confirm** button

<figure><img src="/files/qr9W8sYKJ2j7U8CCAM4T" alt=""><figcaption></figcaption></figure>

* If this pop-up interrupts your flow, please click “**Don't show this popup again**” to remove it the next time.
* Your wallet will ask you to confirm the action. Please confirm the transaction.

<figure><img src="/files/F5qTFnzcZ2QkNkMd2Rgc" alt=""><figcaption></figcaption></figure>

* Then, the system will work for a second.

<figure><img src="/files/3XuPwJftZP7EVLNGg3xT" alt=""><figcaption></figcaption></figure>

* Now, your transaction is completed.
* After matching orders on the order book, the system will update the position and transfer margin and PnL to your wallet.


---

# 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.position.exchange/products/trading-protocol/beginners-guide/close-position/close-market.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.
