PerpetualTokensFarm

INFO : PerpetualTokensFarm.sol is yielding smart contract that is enabling project to defend value of their token by giving users rewards in certain way. This contract has ability to have multiple epochs and each epoch can have different configuration. So you can maintain your token price for longer period of time with different params.

• Client comes to us to deploy PerpetualTokensFarm that has his token as stake token, based on amount that you deposit and time when you deposit your rewards gets calculated and you get rewards because you are hodlling clients token.

Config object for a farm accessible via GET request to TF API:

brew install jq && curl -X GET https://test-api.tokensfarm.com/farm/config?symbol=portx&type=lp&nonce=1 | jq .

From received JSON object it will be possible to use brew install jq && curl -X GET https://test-api.tokensfarm.com/farm/config?symbol=portx&type=lp&nonce=1 | jq .contracts.PerpetualTokensFarm

or

brew install jq && curl -X GET https://test-api.tokensfarm.com/farm/config?symbol=portx&type=lp&nonce=1 | jq .farmProxyAddress

and also

brew install jq && curl -X GET https://test-api.tokensfarm.com/farm/config?symbol=portx&type=lp&nonce=1 | jq .abi

for calling farm contract functions directly.

  • There are 2 types of PerpetualTokensFarm farm contracts

    • STAKING (reward and staking token are same or different) stake one and get same or other token as reward but also with liquidity pool being out of the game

    • LP (reward and staking token are different) stake one and get other token as reward but with liquidity pool being in game

  • Both types will have 4 modes in which will they operate

    • Regular one(warmup = 0 and cooldown = 0) where user can deposit and withdraw whenever he wants with certain penalty if early withdraw is allowed

    • Warmup on(warmup > 0 and cooldown = 0) where user will deposit and need to wait warmup period to expire in order to start earn any rewards and withdraw normally

    • Cooldown on(warmup = 0 and cooldown > 0) where user will deposit normally but they will need to schedule their withdrawal and once they initiate cooldown countdown, once that expires they can withdraw their rewards + assets

    • Warmup and Cooldown is on(warmup > 0 and cooldown > 0) where user will deposit and need to wait warmup period to expire in order to start earn any rewards and where users will need to schedule their withdrawal and once they initiate cooldown countdown, once that expires they can withdraw their rewards + assets

This is the flow of usage of this feature:

• First client comes to us and provide us this params :

uint256 _startTime,
uint256 _rewardPerSecond,
uint256 _totalBudget,
uint256 _minTimeToStake,
bool _isEarlyWithdrawAllowed,
uint256 _stakeFeePercent,
uint256 _rewardFeePercent,
uint256 _flatFeeAmountDeposit,
uint256 _flatFeeAmountWithdraw,
bool _isFlatFeeAllowed,
uint256 _penalty
address _rewardToken,
address _tokenStaked,
uint256 _warmup,
uint256 _coolDown

• Our developers are deploying the PerpetualTokensFarm.sol contract

• Getters are public so you can fetch them by directly calling functions from contract

• Setters are changing the state of the contract so we took precaution and implemented security system into our TokensFarmFactory.sol and this is the contract that is the owner of the PerpetualTokensFarm contract and only through that contract we can change the state of the farm

Last updated