Farms
Farms are used to increase the liquidity of the exchange as well as reduce Liquidity Providers' impermanent loss.
PolyDEX has two types of Farms.
Core Farms - Core Farms are used to gain liquidity of frequently used tokens such as ETH, BTC, MATIC and Stablecoins.
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.
The sum of the APRs of the individual reward tokens will be the total APR of the Farm.
Deposit For
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:
The YA(Yield Aggregator) has a USDC-USDT farm which give XYZ token.
They can pass this LP on to PolyDEX's farm while passing the users address.
The user would be earning both XYZ and CNT tokens.
Using Depositfor, you don't have to maintain their own mapping of user addresses.
Withdraw For
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.
Users can revoke access from the handler at any point by using the following function.
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.
Last updated