> For the complete documentation index, see [llms.txt](https://docs.cryption.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cryption.network/products/farms.md).

# Farms

PolyDEX has two types of Farms.

1. **Core Farms** - Core Farms are used to gain liquidity of frequently used tokens such as ETH, BTC, MATIC and Stablecoins.
2. **Multi Reward Farms** - These are special type of farms which are designed to distribute multiple reward tokens for staking only one. So you stake one token, you get back multiple rewards.

{% hint style="info" %}
The sum of the APRs of the individual reward tokens will be the total APR of the Farm.
{% endhint %}

### Deposit For

```
function depositFor(uint256 _amount, address _user) public
```

Developers can call this function to deposit LP tokens on the users behalf. This allows Yield Aggregators to gain access to double the rewards. (Yeild aggregator's token and CNT).

For Example:

1. The YA(Yield Aggregator) has a USDC-USDT farm which give XYZ token.
2. They can pass this LP on to PolyDEX's farm while passing the users address.
3. The user would be earning both XYZ and CNT tokens.

{% hint style="info" %}
Using Depositfor, you don't have to maintain their own mapping of user addresses.
{% endhint %}

### Withdraw For

```
function withdrawFor(uint256 _amount, address _user) public
```

Withdraw can be used  by a yield aggregator to gain access to their users farm tokens allowing for compounding or whatever the contract wants to do with it.

This function will also allow Cryption Network to upgrade its Farms in a seem-less and permissioned way.

#### Whitelisting an address for Withdraw For

We cannot just let anyone withdraw/harvest someone else's rewards or stake.

The user needs to give permission to the "handler" before the smart contract is allowed to handle the users funds.

```
function whitelistHandler(address _handler) external
```

Users can revoke access from the handler at any point by using the following function.

```
function removeWhitelistedHandler(address _handler) external 
```

### Harvest Lock

We have implemented a harvest lock of 24 hours to avoid continuous selling of the farm tokens as well as too frequent compounding.
