# Lending venue support

> What a lending venue is, how venues are added, ordered and removed, how lending is valued, and how forced withdrawals draw on the lending venues.

Source: https://app.tango.finance/docs/vault/lending-venues

A lending venue is where the borrowed stablecoin is put to work. It is a money market for one stablecoin, such as a Morpho vault, that pays interest to the people who deposit there. The strategy can lend to several at once. Lending venues matter twice: they earn the income side of the spread, and they are where a forced withdrawal finds the stablecoin to repay debt.

> **Key points**
>
> - A lending venue is any ERC-4626 vault whose asset is one of the registered stablecoins. Up to eight can be registered.
> - The curator adds a venue behind its delay. The operator removes a venue once none of its shares are held, without delay.
> - Each lending position is valued at what redeeming it would return, and at zero if the venue cannot be read.
> - Forced withdrawals draw on lending venues in the lending order, which the operator sets.

## What a lending venue is

The contract accepts any ERC-4626 vault whose asset is a registered stablecoin. ERC-4626 is the standard interface for this kind of contract: you deposit an asset and receive shares that grow as the venue earns interest. The contract that holds supplied stock, explained in [Using a vault](https://app.tango.finance/docs/vault/overview.md), refuses to register a venue that is its own stock, a registered stablecoin, its swapper, a borrow venue or a borrow venue's protocol.

The operator lends idle stablecoin to a venue, and redeems shares to bring stablecoin back. The contract checks both directions:

- A loan is refused if the shares the venue mints are worth less than the stablecoin it took, beyond rounding.
- A redemption is refused if the venue pays less than its own quote for the shares, beyond rounding.

Only shares received this way are counted. Shares sent to the contract directly are not.

## Adding and removing a venue

| Change | Who | Delay |
| --- | --- | --- |
| Add a lending venue | Curator | The curator's delay, at least three days |
| Remove a lending venue | Operator | None, but only when none of its shares are held |
| Set the lending order | Operator | None |

A new venue joins at the end of the lending order. See [Timelocks](https://app.tango.finance/docs/vault/timelocks.md).

## The lending order

The lending order is a list of every registered lending venue, once each. A forced withdrawal draws the default stablecoin from venues in this order. When it has to pay a holder back in kind, it also hands over venue shares in this order. The operator sets the order, and can change it at any time without delay.

On tango.finance the automated service does not change the lending order.

## How lending positions are valued

Each lending position counts in the stablecoin book at what redeeming its shares would return now, converted to the default stablecoin at no more than par. If a venue's views fail, its position counts as zero until they answer again. That can put the book into deficit, which stops deposits and ordinary withdrawals.

A loss at a lending venue shows in the book only once the venue's share price shows it. See [Risks](https://app.tango.finance/docs/vault/risks.md#borrow-and-lending-venue-risk).

## How forced withdrawals draw on lending venues

When a forced withdrawal repays debt, it uses idle default stablecoin first. Then it draws from lending venues of the default stablecoin, in the lending order, taking no more than the repayment needs.

- Some venues always report that nothing can be withdrawn, as a Morpho Vault V2 does. The contract tries them anyway, up to what its shares there are worth.
- It passes over a venue whose withdrawal would cost the remaining holders more than rounding, for example one that charges a withdrawal fee.
- If a venue refuses the draw when the transaction runs, the caller pays that amount in the default stablecoin instead and receives the venue's shares, as long as it stays within the most the caller allowed.

The tango.finance app sets that most to zero, so a draw a venue refuses stops the withdrawal, and the app shows a smaller amount you can take now. See [Withdrawals](https://app.tango.finance/docs/vault/withdrawals.md#what-the-caller-may-be-asked-to-pay).

## How the curation service uses lending venues

On tango.finance, the curation service decides where to lend within the venues the curator has registered:

- It lends only where a venue earns more than the borrowing costs, with a margin.
- It limits how much of the lending sits at any one venue.
- It leaves a venue whose share price has fallen, and moves out of one whose withdrawals are getting tight.
- It moves part of the lending to a venue that pays more, a step at a time.

The Allocation tab on each stock's page shows how the stablecoin is spread across venues.
