# How yield is generated

> How a supplied stock earns by borrowing a stablecoin against it and lending that stablecoin, and what makes the rate rise, fall or turn negative.

Source: https://app.tango.finance/docs/how-yield-is-generated

A supplied stock earns because the strategy borrows against it and lends what it borrows. The stock itself sits at money markets as collateral. The strategy borrows the network's stablecoin against it, lends that stablecoin where it earns more than it costs, and keeps the difference. Money markets also pay rewards for some of these positions. Both end up as more of the same stock.

> **Key points**
>
> - The strategy earns the spread: what its stablecoin lending earns, less what its borrowing costs.
> - Money-market reward programs add to that once their rewards are claimed and brought back.
> - A performance fee is taken from each harvest, before the profit buys more stock.
> - The rate moves with lending and borrowing rates, how much is borrowed, rewards and the stock's price. It can turn negative.

## The four steps

| Step | What happens |
| --- | --- |
| Supply collateral | Your stock is posted at a borrow venue, a money market that lends stablecoins against it |
| Borrow | The network's stablecoin is borrowed against that collateral |
| Lend | The stablecoin is lent to lending venues, other money markets that pay interest on it |
| Harvest | The profit is taken, the performance fee is paid, and the rest buys more of the stock |

The operator, the role that runs the strategy day to day, carries out each step. On tango.finance an automated curation service holds that role. See [Profiles and access control](https://app.tango.finance/docs/vault/roles.md#the-curation-service).

## Where the yield comes from

### The spread

The **spread** is what the stablecoin side earns less what it pays. Lending venues pay interest on what is lent. Borrow venues charge interest on what is owed. When lending pays more than borrowing costs, the stablecoin holdings grow faster than the debt, and the difference is profit.

The strategy borrows less than the borrow venue allows, to leave room for the stock's price to fall before the position reaches the venue's liquidation line. The curation service decides how much to borrow, and repays debt that costs more than lending earns. It borrows less while US stock markets are closed, when a price can move in one step at the open.

### Money-market rewards

Some money markets run reward programs that pay extra tokens to people who supply or borrow there, often through Merkl, a reward distribution service. The strategy can earn these on its collateral, its debt or its lending. Rewards are not counted until they are claimed, sold for the stablecoin and brought back. They are then harvested like any other profit. See [Reward claiming](https://app.tango.finance/docs/vault/rewards.md).

## What the performance fee takes

Each harvest pays a performance fee in the stablecoin, before the rest buys stock. Each stock's rate is shown on its page, and the contract caps it at 25%. There is no fee on deposits or withdrawals. See [Fees](https://app.tango.finance/docs/vault/fees.md).

## How the rates on a stock's page are measured

Each stock's page shows four rates, each as a yearly share of **Vault TVL**: the US dollar value of all of that stock supplied, including stock held idle. Borrowed stablecoins are not added to Vault TVL.

| Rate | What it measures |
| --- | --- |
| Lending APY | Yearly income on the stablecoin actually lent, before the performance fee |
| Borrowing APY | Yearly interest on the stablecoin actually borrowed, before rewards |
| Money Market APY | Lending income less borrowing interest, after the performance fee |
| Total APY | Money Market APY plus eligible money-market rewards, after the performance fee |

For example, suppose $10,000 of a stock is supplied, $3,000 is borrowed at 4% and lent at 6%. Lending earns $180 a year and borrowing costs $120, so the spread is $60, or 0.6% of Vault TVL before the fee. These numbers only illustrate the arithmetic; they are not any stock's rates.

## What makes the rate move

- Lending rates change as other people deposit into and borrow from the lending venues.
- Borrowing rates change with how much of the borrow venue's stablecoin is lent out. A rate can rise quickly when that market gets busy.
- How much is borrowed changes as the curation service borrows more or repays.
- Rates are a share of Vault TVL in dollars. When the stock's price rises, the same income is a smaller share.
- Reward programs start, change and end on the money markets' own schedules.
- Stock held idle earns nothing, so it lowers the rate across all supplied stock.

## When can the rate go negative?

The rate is negative whenever borrowing costs more than lending earns. Borrowing rates can spike faster than the curation service repays, and lending rates can fall at any time. A loss pays no performance fee, and it does not lower the stock per share. It comes out of the profit not yet harvested. If it uses all of that, the stablecoin side is short, and deposits and ordinary withdrawals stop until profit or a donation covers the gap. See [Withdrawals](https://app.tango.finance/docs/vault/withdrawals.md#when-the-stablecoin-book-is-short).
