> For the complete documentation index, see [llms.txt](https://erc20-docs.particle.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://erc20-docs.particle.trade/logic/close-long.md).

# Close Long

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

Notes:

* Changing Open to Close, all "From"s are changed to "To"s;&#x20;
* `premiumFrom` in "Close Long" has the same length as the `premiumTo` in "Open Long". Also, since `tokenFromOwed` is capped at `premiumFrom`, the minimum `amountSpent` is `(collateralFrom - amountFromAdd)`.
