# How your stock compounds

> How stablecoin profit is turned into more of the same stock, why your shares are counted in stock rather than dollars, and what Total APY includes.

Source: https://app.tango.finance/docs/how-your-stock-compounds

When you supply a stock, you receive shares. Each share is a claim on a part of all the stock supplied. The strategy's profit is earned in a stablecoin, but it is not paid out in that stablecoin. It buys more of the same stock, which stays with everyone else's. Each share then holds more stock than before, and that stock is posted as collateral and earns in turn.

> **Key points**
>
> - Share value is counted in stock: all the stock held, divided by the number of shares. No price is read to work it out.
> - A harvest swaps profit into the stock, so every share holds more stock. The new stock is posted as collateral and earns too.
> - Total APY is today's rate from money markets plus eligible rewards, after the performance fee. It is not a promise of future returns.
> - Share value can fall, for example when a money market liquidates part of the collateral.

## What a share is

Your shares are a standard ERC-20 token that your wallet holds. They come from a vault, the smart contract that holds the stock; [Using a vault](https://app.tango.finance/docs/vault/overview.md) explains what that means. The vault follows ERC-4626, the common standard for this kind of contract, so a share's value is always a number of units of the stock.

## How your share is counted

The stock and the stablecoins are counted separately, which keeps share value tied to the stock alone.

### The stock side

**Share value** is the stock held divided by the number of shares. The stock held is the stock kept idle, plus the collateral counted at each borrow venue. At each venue, the contract counts the lower of what it supplied and what the venue reports, so a liquidation shows as soon as the venue reports it.

### The stablecoin book

Everything else sits in a separate account, the **stablecoin book**: idle stablecoins plus lending, less debt, in units of the default stablecoin. Each position is valued on the cautious side. Lending counts at what redeeming it would return, other stablecoins count at no more than par, and anything that cannot be read or priced counts as zero.

A surplus in the book is profit a harvest may take. A deficit is a loss that share value does not show, so deposits and ordinary withdrawals stop while it lasts. See [Withdrawals](https://app.tango.finance/docs/vault/withdrawals.md#when-the-stablecoin-book-is-short).

## How a harvest adds stock

A harvest is the step that turns profit into stock:

1. The operator takes profit from the stablecoin book. It can take at most the book's surplus, with a 1% margin left over, so a harvest can never spend money that is owed.
2. The performance fee is paid to the fee recipient in the stablecoin.
3. The rest is swapped into the stock. The contract checks what came back against oracle prices, and refuses a harvest that loses more than its harvest tolerance, which the contract caps at 5%.
4. The stock bought is held idle. The number of shares does not change, so each share now holds more stock.

The curation service then posts that stock as collateral like any other, so it can be borrowed against and earn in the next round. That is the compounding: profit becomes stock, and the new stock earns as well. Each stock's page shows harvests in its Activity as "Add earnings".

## Why your shares are counted in stock

Counting in stock means your part grows only in the thing you supplied. A harvest makes each share worth more stock. A change in the stock's price does not change how much stock a share holds.

Your position's value in dollars still moves with the stock's price, exactly as if you held the stock. The strategy does not hedge the stock. The Share value tab on the stock's page charts stock per share over time.

## What Total APY includes

Total APY is shown on Home, in the Supply dialog and on each stock's page. It has two parts:

- Money Market APY is the spread between lending income and borrowing interest, after the performance fee.
- Rewards is the rate that eligible money-market reward programs add, after the performance fee.

Both are measured against Vault TVL, the dollar value of all of that stock supplied, including idle stock. Both use today's rates and positions, so Total APY changes all the time. See [How yield is generated](https://app.tango.finance/docs/how-yield-is-generated.md#how-the-rates-on-a-stocks-page-are-measured).

The stock's page also shows **Realized** rates for the last 7 and 30 days. Each one is the change in stock per share over that period, scaled to a year without compounding. A realized rate looks back. It is not a forecast.

## When can share value fall?

Share value falls when less collateral is counted than before:

- A borrow venue liquidates part of the position. The lower collateral counts from the moment the venue reports it.
- A borrow venue stops answering, and the curator removes it with its collateral written off. See [Borrow venue support](https://app.tango.finance/docs/vault/borrow-venues.md#a-venue-that-cannot-be-read).

After a liquidation, the debt the liquidator repaid leaves a surplus in the stablecoin book. The operator can use it to buy the stock back without a performance fee, through a step called a **rebuy**. A rebuy usually cannot restore everything a liquidation took, because liquidators keep a bonus. See [Health and liquidation](https://app.tango.finance/docs/vault/borrow-venues.md#health-and-liquidation).

## Does timing matter?

Yes. Profit belongs to whoever holds shares when it is harvested. If you withdraw before a harvest, you leave behind your part of the profit earned but not yet harvested. If you supply just before a harvest, you share in profit that was earned before you arrived. The curation service waits until a set share of the strategy's value has built up as profit, then harvests it in one step, so each step is the same size whatever the strategy's value.
