Farms are used to increase the liquidity of the exchange as well as reduce Liquidity Providers' impermanent loss.
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.
The sum of the APRs of the individual reward tokens will be the total APR of the Farm.
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).
- 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.
Using Depositfor, you don't have to maintain their own mapping of user addresses.
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.
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
We have implemented a harvest lock of 24 hours to avoid continuous selling of the farm tokens as well as too frequent compounding.