# Manual Deleveraging When UI Actions Are Unavailable

> Markdown export of the Gearbox Protocol documentation page for agents and retrieval systems.

Canonical page: https://docs.gearbox.finance/core/manual-deleveraging-when-ui-actions-are-unavailable
Source file: content/core/manual-deleveraging-when-ui-actions-are-unavailable.mdx
Section router: https://docs.gearbox.finance/core/llms.txt
Section full export: https://docs.gearbox.finance/core/llms-full.txt

If the **Close** or **Swap** action is unavailable or fails, you can exit your position manually by following the steps below.


## Withdraw collateral

Withdrawing collateral sends the token to your wallet, where you can swap it freely using external liquidity sources outside of Gearbox.

>
Withdrawing collateral reduces your position’s **Health Factor**. A large withdrawal may push the position into liquidation risk. \
\
Always check the projected **Health Factor** before each withdrawal.


<details>

<summary>Withdraw collateral in the UI</summary>


![Figure](https://docs.gearbox.finance/assets/docs/core/manual-deleveraging-when-ui-actions-are-unavailable/01-withdraw-collateral.png)


</details>

>
If your current **Health Factor** does not allow for a safe withdrawal, repay part of your debt first using the Debt Token from your wallet (see **Step 3**).


## Swap collateral into the Debt Token

Swap the withdrawn collateral into the Debt Token using external liquidity sources.

Recommended options include:

* DEX aggregators
* Official liquidity venues provided by the collateral issuer


## Repay debt using Debt Token from your wallet

>
Repay the debt using the **same token the debt is denominated in**, directly from your wallet.


>
Check whether the updated **Health Factor** allows for further withdrawal.


<details>

<summary>Repay debt in the UI</summary>


![Figure](https://docs.gearbox.finance/assets/docs/core/manual-deleveraging-when-ui-actions-are-unavailable/02-repay-debt-using-debt-token-from-your-wallet.png)


</details>


## Repeat Steps 1-3 until your Credit Account reaches the desired state or is fully unwound
