> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# DAMM v1 Fee and APY Calculation

> How trading fees and APY are calculated in DAMM v1 pools, including the contribution of vault yield on top of swap fee earnings.

In order to enhance transparency for our LPs concerning the APY associated with their deposited assets, we compute and display various information, for example: Liquidity Provider Fee, Protocol Fee, 365d Yield/TVL, and LM rewards APR.

# Total Trading Fee

The amount of fees charged on each trade before the protocol fee is deducted.

# Protocol Fee

The amount of fees charged on each trade that goes to the protocol. Protocol Fee is a percentage of the total trading fee.

## Constant Product pools

* **Standard Pools:** **20%** Protocol Fee, **80%** LP Fee (0.25% trade fee)
* **Launch Pools:** **20%** Protocol Fee, **80%** LP Fee (customizable trade fee)

## Stable Swap pools

* **0%** Protocol Fee, **100%** LP Fee (0.01% trade fee)

## Swaps

Swap hosts can include a referral account in the swap transaction to receive a **Referral Fee** equal to **20%** of the protocol fee.

# Base APY

The base APY offered is subject to variation and is based on the prevailing trading activity and yield obtained from lending platforms. The calculation of APY is contingent on the increase in virtual price over a specific time period.

```math theme={"system"}
\text{base APY} = \left(\left(\frac{\text{Virtual Price 2}}{\text{Virtual Price 1}}\right)^{\frac{1 \text{ year}}{\text{Timeframe}}} - 1\right) \times 100
```

Where:

* **Virtual Price 2**: Latest Virtual Price value
* **Virtual Price 1**: Previous Virtual Price value in the last 24 Hours
* **Timeframe**: Time difference between Virtual Price 1 and Virtual Price 2 (in seconds)

> **Note**: The Virtual Price represents the value of your pool share and is determined by dividing the pool's total value by the number of LP tokens (VP = pool\_value / LP token). The pool's value rises as a result of a swap fee being charged on each trade or when assets deposited in lending pools generate lending yield. This increase in pool value corresponds to a rise in the Virtual Price.

# 365d Yield/TVL

The ratio of the aggregate swap fees accrued over a 1-year period to the total liquidity available in the pool represents the efficiency metric that informs LPs which pool generates the most trading fees. This data empowers LPs with valuable insights into pool performance.

```math theme={"system"}
\text{1 year fee/TVL} = \frac{\text{24 hour fee} \times 365}{\text{Total Liquidity of pool}}
```

Where:

* 24 hour fee: Swap fee generated in the last 24 hour in \$
* Total Liquidity of pool: Total value of the assets stored in the AMM pool in \$

# Liquidity Mining (LM) APR

This refers to the APR that is calculated based on the rewards provided by the team or partner protocols through Liquidity Mining (LM), such as ABR, LDO rewards, etc.

```math theme={"system"}
\text{LM APR} = \left(\left(1 + \frac{\text{Farm Reward per day}}{\text{Farm TVL}}\right)^{365} - 1\right) \times 100
```

Where:

* **Farm reward per day**: Token reward per day × token reward USD rate
* **Farm TVL**: (Pool LP staked / Pool LP supply) × Pool TVL
* **Pool TVL**: Pool token A × token A USD rate + Pool token B × token B USD rate
