[FTM] Value input for a yield harvesting function

I’d like to automate my yields harvesting and staking on Ripae finance. The contract link is below;

I understand from my previous transactions that I should be automating ‘withdraw’ function here. I’m not sure about how to figure out the pool ID ‘pid’ and ‘uint256 amount’ for the maximum yield amount accrued. The pool in this case is pFTM-FTM LP teller.

My transactions shows all the values were set to ‘00000…00’. So is zero-ing the amount section is interpreted as the max. amount here?

Also, I want to automate the PAE reward staking which would put all PAE in the balance. Should this amount value work as the same as the case of withdrawal above?

1 Like

Hello @vfactorial - I looked in the smart contract you posted above and it appears there is an access restriction in place that would prevent Gelato to automate this for you.

   // Withdraw LP tokens.
   function withdraw(uint256 _pid, uint256 _amount) public {
       address _sender = msg.sender;

Unless Ripae Finance were to add Gelato’s PokeMe address to their Whitelist of addresses that can call functions on their contracts it would not work. They could also redeploy new contracts with this capability in them to allow for these sorts of automations. Hope that is helpful and please do share if you have any other questions or managed to get this to work somehow! Cheers.

Weston :shaved_ice: