# How does yield farming work?

The yield farming process involves user deposits and generating on-chain income through farming and exchanging rewards for the principal asset. Each time the yield farming process compounds rewards, a small fee is charged, which is distributed among participants, such as the harvest initiator, strategist, and incentive distribution contracts.

<figure><img src="https://2531183892-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7K7s3CmSNOkYzuomSKtN%2Fuploads%2FoAivxKf1pWFE5TRluT4l%2Ftelegram-cloud-document-2-5217904477410971241.jpg?alt=media&#x26;token=edf86c32-b1a9-4dd1-be1e-7545dd698615" alt=""><figcaption></figcaption></figure>

### 1. Users and Vaults:

* **Users:** Individuals who wish to earn yield on their crypto assets.
* **Vaults:** Smart contracts where users deposit their assets. Vaults are the primary entry and exit points for users’ funds.

### 2. Deposits and Withdrawals:

* Users deposit their crypto assets into the vaults.
* They can also withdraw their funds from the vaults whenever needed.

### 3. Strategy Implementation:

* The assets deposited in the vaults are then allocated to various Strategies. These strategies determine the best yield-generating opportunities available in the DeFi ecosystem.
* The strategies implement automated processes to optimize yield, including compound interest techniques.

### 4. Farming:

* The strategies typically deposit the assets into Farms. Farms are DeFi protocols where users can stake their assets to earn rewards.
* The farming process involves staking assets in liquidity pools or other yield-generating platforms.

### 5. Liquidity Pools:

* Assets are staked in Liquidity Pools, where they help provide liquidity to the DeFi ecosystem.
* In return for providing liquidity, users earn rewards. These rewards can be in the form of native tokens of the liquidity pool, trading fees, or other incentives.

### 6. Compounding Rewards:

* The rewards earned from liquidity pools are periodically withdrawn and redeposited into the vaults.
* This process of withdrawing rewards and reinvesting them back into the farming strategy compounds the yield, leading to exponential growth in earnings over time.

### 7. Revenue Distribution:

* The yield farming process generates revenue, a portion of which is taken as fees.
* These fees are handled by the Revenue Bridge, which manages the distribution of these fees among various participants, such as the harvest initiator, strategist, and incentive distribution contracts.

### 8. Fee Batch and Treasury:

* Collected fees are sent to the Fee Batch module.
* From there, stablecoin earnings are transferred to the Treasury to support platform sustainability and development.

### 9. Incentive Distribution:

* The remaining portion of the fees is distributed to liquidity pools and incentive mechanisms, such as DEXTR - $WETH Liquidity Pool.
* This incentivizes continued participation and growth of the platform.

### Key Components Explained

* **Vaults:** Smart contracts where user assets are held and managed.
* **Strategies:** Automated plans that determine how and where to allocate assets for maximum yield.
* **Farms:** DeFi protocols where assets are staked to earn rewards.
* **Liquidity Pools:** Pools where assets are deposited to provide liquidity and earn rewards.
* **Revenue Bridge:** Handles the conversion and distribution of fees collected from yield farming.
* **Fee Batch:** Aggregates fees and distributes them to the Treasury and liquidity pools.
* **Treasury:** Stores stablecoin earnings to support the platform.
