# Yield Farming

Yield Farming allows users to earn reward tokens by staking user LP positions (in NFT form).&#x20;

When user stake the position, the liquidity in the user position will be transferred to farming pool position and used to calculate the LP shares over the TVL of the pool. By doing so, the position cannot be manipulated by supplying to an out-of-range etc as the amounts in the liquidity are used to calculate the shares and utilised as the liquidity of the pools.&#x20;

The ways of providing liquidity in DerpDEX:

* **Add Liquidity**

{% content-ref url="../getting-started/add-liquidity" %}
[add-liquidity](https://derpdex.gitbook.io/home/getting-started/add-liquidity)
{% endcontent-ref %}

* Zap-to-Earn

{% content-ref url="zap-to-earn" %}
[zap-to-earn](https://derpdex.gitbook.io/home/products/zap-to-earn)
{% endcontent-ref %}

### Rewards

Reward tokens from yield farming could be multiple tokens. This is the benefits of the yield farming in DerpDEX, which working partnership with other project to incentivise DerpDEX LP.&#x20;

### APR Calculation

**Base APR**: LP trading fees based on the pool fee tier

**Farm APR**: Reward emission from farming pool

**totalShares**: Total Value Lock of the pool

**xDERP allocated**: Amount of xDERP allocated

**durationRemaining**: Remaining duration of reward emission

**total xDERP allocated**: Total allocation of the xDERP for the pool

**maxDuration**: Maximum duration of the reward emission

**userShares**: LP shares of the user position

**multiplier**: Multiplier of the reward emission

$$
Farm APR = \dfrac{(totalShares \* xDERP allocated \* durationRemaining)}{ (totalxDERPAllocated \* maxDuration)}
$$

#### Multiplier Calculation

$$
Multiplier = \dfrac{farmAPR + userShares}{userShares}
$$
