# Withdrawals

> How holders take their stock back, from standard withdrawals out of idle stock to forced withdrawals that unwind positions in the same transaction, and what can still limit them.

Source: https://app.tango.finance/docs/vault/withdrawals

A withdrawal turns your shares back into the stock. Most supplied stock is posted as collateral, with debt against it, so paying a large withdrawal means releasing collateral and repaying debt first. There are two ways to leave. A standard withdrawal pays from stock held idle. A forced withdrawal pays more, by unwinding positions in the same transaction. Neither needs a request, a queue or anyone's approval. [Using a vault](https://app.tango.finance/docs/vault/overview.md) gives the short version.

> **Key points**
>
> - A standard withdrawal pays from idle stock only. It is the ERC-4626 `withdraw` or `redeem`, and pays at once.
> - A forced withdrawal pays beyond idle stock. In one transaction it releases collateral in the release order, repays the matching debt, and draws the stablecoin it needs from idle balances and lending venues.
> - Any holder can force a withdrawal. It needs no role and no request, and there is no queue or timelock on leaving.
> - It is still limited by what lending venues can pay out, by the health of each borrow venue, and, while the stablecoin book is short, by the holder paying their share of the gap.

## Standard withdrawals

`withdraw` and `redeem` are the standard ERC-4626 calls. They pay the stock from idle stock and nothing else. The most a holder can take this way is the smaller of their own stock and the idle stock, which `maxWithdraw` and `maxRedeem` report.

While the stablecoin book is in deficit, both report zero and standard withdrawals stop. See [When the stablecoin book is short](https://app.tango.finance/docs/vault/withdrawals.md#when-the-stablecoin-book-is-short).

## Forced withdrawals

A forced withdrawal, the contract's `forceWithdraw`, pays out more than idle stock covers. It works out the whole exit first, then burns the shares, and only then calls the money markets. Everything happens in one transaction: either all of it succeeds, or nothing moves.

### Who can call it

Any holder, for their own shares. Someone else can call it for a holder only with an allowance on that holder's shares, as with any ERC-20 token. No role is involved, and no role can refuse one holder's exit while allowing others.

`previewForceWithdraw` quotes the exit in the current block: the shares it burns, what it would ask the caller to pay, and what it would return in kind.

### What it unwinds, in order

1. It pays from idle stock first.
2. For the rest, it releases collateral from borrow venues in the release order, taking all it needs from one venue before the next.
3. At each venue, it repays debt in proportion to the collateral released, so the venue's loan-to-value stays where it was. Releasing all of a venue's collateral repays all of its debt.
4. It funds the repayment from idle default stablecoin, then from lending venues of the default stablecoin, in the lending order.
5. Anything still missing is asked of the caller, and paid back to them in kind, as idle stablecoins or lending venue shares.

If releasing in order would need more repayment than can be funded, as when the book is in deficit, the exit takes the same share of every venue's collateral instead.

After the exit, the contract checks that the holders who stay have at least as much stablecoin book per share as before. If not, the whole transaction is refused.

### What the caller may be asked to pay

Usually nothing. A forced withdrawal asks the caller for the default stablecoin in two cases:

- While the book is in deficit beyond rounding, the caller pays their share of the deficit.
- When idle stablecoin and lending venues cannot fund the repayment, the caller pays the rest, and receives it back in kind. In-kind payment is valued on the cautious side, so it is worth slightly less than what was paid.

The caller sets the most they will pay. The tango.finance app always sets it to zero. It sends a forced withdrawal only when it can be paid without asking anything, and otherwise shows how much can leave now. See [Withdraw in the app](https://app.tango.finance/docs/app/withdraw.md).

### What can still limit it

| Limit | What happens |
| --- | --- |
| Lending venues cannot pay out enough | The caller pays the difference and is paid back in kind, or takes a smaller exit |
| A borrow venue is past its liquidation line, or refuses withdrawals | An exit that reaches that venue fails, until the operator moves it to the back of the release order |
| The stablecoin book is in deficit | The caller pays their share of the deficit |
| A borrow venue cannot be read | Every deposit and withdrawal stops until the curator abandons that venue |
| The amount is more than idle stock plus all collateral | The exit is refused |

Holders cannot choose the release order. Keeping it sound is the operator's job. See [Borrow venue support](https://app.tango.finance/docs/vault/borrow-venues.md#the-release-order).

## Is there a request queue?

No. There are no withdrawal requests, no queue and no settlement step. A standard withdrawal and a forced withdrawal both pay in the transaction that asks for them. The deposit cap never limits withdrawals.

## When the stablecoin book is short

The stablecoin book is short when its debt exceeds its stablecoins and lending by more than rounding. That can follow a loss at a lending venue, a stablecoin losing value, a stale price, or a stretch of negative spread. While it lasts:

- Deposits stop, so new holders do not take on a loss that came before them.
- Standard withdrawals stop.
- Forced withdrawals still work, and each pays its share of the deficit.

Anyone can close a deficit by donating the default stablecoin. On tango.finance, the curation service donates to keep a cushion in the book. Leaving before a loss is counted can avoid it, and the holders who stay then carry it. See [Risks](https://app.tango.finance/docs/vault/risks.md#timing-between-holders).
