> ## Documentation Index
> Fetch the complete documentation index at: https://kimia-labs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Closing a position

> Getting your money back out.

Press **Close** on the position's row. Kimia unwinds both sides for you, and no
signing prompt appears.

## What happens

1. The short closes first.
2. Only once it has closed is the spot sold.
3. On Hyperliquid, margin freed from the short is swept back to your spot balance.

That order is deliberate. If the second step fails, you are left holding spot, which
you can sell at any time, never a lone short.

**With Kimia spot**, Kimia sells the tokens inside your vault and sends the USDC from
the sale to your Solana master. USDC you had deposited but not spent stays in the
vault. This needs your vault authorization for that token to be current. If it has
expired, the close is refused before anything moves. **Reauthorize** it on the Vault
tab and close again.

## Closing everything

On the **Portfolio** page, the pairs list has **Close all pairs**. Press it, then
press **Confirm close N pairs** to go ahead. Pairs close one at a time, and one
failing does not stop the rest.

## Selling the spot side on its own

The **Spot Holdings** tab has a **Sell** button on each holding. It sells the spot
side only.

When the holding is part of an open pair, selling it removes the hedge. What remains
is a short, which loses money if the price rises. If you do this by accident, close
the pair too.

There is no button to close only the short. Use **Close** on the pair.

## The dust that gets left behind

You will usually be left with a very small amount of the asset, worth a fraction of a
dollar. It shows under **Spot Holdings**.

Exchanges charge spot fees in the asset you receive, and only accept order sizes in
fixed increments, so selling every last unit is impossible. On Hyperliquid, dust
under one dollar is converted automatically once a day.

Kimia refuses to open positions on assets where this remainder would be larger than
one dollar.

## How long it takes

Both sides close within seconds under normal conditions. The pair moves to
**Closed Pairs** on the Portfolio page straight away. Its prices and funding can take
a few minutes to fill in.

From there you can open a new position, or withdraw. See
[Withdraw](https://kimia-labs.mintlify.site/getting-started/withdraw.md).

## If a close fails partway

Kimia tells you which:

| Message | What it means |
| - | - |
| Position closed | Both sides are done |
| Partly closed, spot still held | The short closed but the spot did not sell. Sell it from **Spot Holdings** |
| Couldn't close | Nothing moved. Try again |

A "partly closed" message can also appear when both sides closed but a follow-up step,
such as sweeping margin back to spot, did not. If **Spot Holdings** is empty, the pair
is fully closed.

Closing still works when market data is stale, and when opening has been paused.

If closing keeps failing, see [Troubleshooting](https://kimia-labs.mintlify.site/safety/troubleshooting.md). You can also
close at Hyperliquid directly with your exported Ethereum master key, and withdraw
vault funds directly with your exported Solana master key. Neither depends on Kimia.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.