> For the complete documentation index, see [llms.txt](https://logx-1.gitbook.io/logx-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://logx-1.gitbook.io/logx-docs/logx-perp-dex/technical-overview/close-decrease-a-market-position.md).

# Close/Decrease a Market position

In order to close an existing position:

1. Call OrderManager.createDecreasePosition with&#x20;

* `_collateralToken: address of the collateral token for the position.`
* `_indexToken: address of the index token of the position.`
* `_collateralDelta: keep this as 0 if you do not want to adjust the leverage for the position.`
* `_sizeDelta: the USD value of the change in position size.`
* `_isLong: whether the position is long or short`
* `_receiver: the address to receive the withdrawn tokens`
* `_acceptablePrice: price at which you want your position request to be executed`
* `_executionFee: can be set to OrderManager.minExecutionFeeMarketOrder`

2. After this transaction, a request to close your position will be created, and a keeper will execute your request.
3. Once the request is executed, the funds are transferred to \_receiver of the position request.

Note that for both createIncreasePosition and createDecreasePosition, send the equivalent amount of native token in msg.value as specified in \_executionFee, or else your request won’t be entertained.
