> For the complete documentation index, see [llms.txt](https://docs.deltaprime.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.deltaprime.io/prime-brokerage-account/taking-profit/withdrawing-and-withdrawal-guard.md).

# Withdrawing & Withdrawal Guard

### Withdrawal guard

The [Withdrawal Guard](/protocol/security/withdrawal-guard.md) is one of DeltaPrime's main safety features, protecting depositor funds against known and unknown attacks. You can read more about the background of the withdrawal guard in [here](/protocol/security/withdrawal-guard.md). This segment discusses what to do if the withdrawal guard prevents withdrawing.

#### The origin

> Not all 'borrowed' is covered by its 'balance'. Update missing balance(s) to withdraw. Read more.

When you get this message, it might help to see visually what this entails. If you were confused and pressed "Read more", you ended up here. Welcome! Here is what it means and how you solve it in order to withdraw:

Imagine you have 1000 USDC in your Prime Account with 300 borrowed USDt deposited in a farm:

<figure><img src="/files/SkdfJFtqBbzcX8yqt85u" alt=""><figcaption><p>There is 1000 USDC in the Prime Account, and $300 borrowed USDT farming. Withdrawing is unavailable right now.</p></figcaption></figure>

If you try to withdraw any USDC, the withdrawal guard will prevent this. The following error message will be shown.

<figure><img src="/files/LNrDQ5YgCRPFJTU1fteU" alt=""><figcaption><p>The Borrowed 300 USDT is not in the Balance. The withdrawal guard locked withdrawing.</p></figcaption></figure>

This happens because some assets have borrowed value larger than the balance. While USDC is covered, with a Balance (1000) larger than Borrowed (0), for USDT, this is not the case. USDT's Balance (0) is smaller than Borrowed (300).&#x20;

#### How to solve this

To unlock withdrawing, the Balance must be larger than the Borrowed for every borrowed asset. In this case, only USDT has been borrowed, so that asset needs to cover its Balance value by at least its Borrowed value.

There are two ways to solve this.

* Withdraw farmed or LP positions to increase the balance.
* Swap any other asset to the borrowed asset to increase the balance.

In this example, we swap 301 USDC for 301 USDT. This brings our balances to the following values:

<figure><img src="/files/tKyq6G6BGCKN14HPnk7e" alt=""><figcaption><p>Now, all borrowed values are covered by all balances.</p></figcaption></figure>

After the swap, we have USDC assets with a Balance (699) bigger than Borrowed (0), and we have USDT assets with Balance (301) bigger than Borrowed (300).&#x20;

Success! Withdrawing is now unlocked.&#x20;

<figure><img src="/files/wtzgJLMMuktKo0PEhTAV" alt=""><figcaption><p>Where we could not withdraw any USDC before, we can now withdraw all of our USDC if we want to.</p></figcaption></figure>


---

# 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:

```
GET https://docs.deltaprime.io/prime-brokerage-account/taking-profit/withdrawing-and-withdrawal-guard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
