πŸ€–
Automate Staking Rewards Claiming using Gelato - Guide
Currently THALES staking rewards need to be claimed manually on a weekly basis or the weekly reward is forfeited and returned to the treasury.
With the recent implementation of claimOnBehalf method in the THALES staking contract, it is finally possible for individual stakers to explore automating their award claiming and thus improve their UX significantly.
This page will guide you through the steps of setting up a Gelato weekly task for auto-claiming your weekly staking rewards.

Step 1: Whitelist Gelato contract for the claimOnBehalf method

To allow Gelato automation to trigger the reward claim on your behalf, you have to whitelist the relevant Gelato contract address.
Navigate to the THALES token Staking page: https://thalesmarket.io/token?tab=staking​
Make sure your wallet used for staking THALES is connected to the dapp.
Click on the ENABLE/DISABLE CLAIM ON BEHALFbutton.
After the "Claim on behalf" pop-up window opens, in the address input field make sure to input the following Gelato contract address:

​
➑
​0x340759c8346A1E6Ed92035FB8B6ec57cE1D82c2c​
β¬…
​

After inputting the Gelato contract address, click on the Enable button and confirm the transaction.

Step 2: Create a new automation task on Gelato dapp

Navigate to the Gelato dapp: https://app.gelato.network/​
Connect your wallet to the dapp and make sure you are connected to the Optimism network.
Before you are able to create a task, you need to fund your Gelato account with ETH that is needed as gas for the claim transactions that you are trying to automate.
​
Click on the Funds button on the top left of the page, input the amount of ETH you wish to fund the contract with, click on the Deposit button and confirm the transaction.
When it comes to choosing the amount of ETH sufficient for funding the contract, keep in mind that it should probably never spend more than ~$0.50 worth of ETH per week of claiming.
Now that you funded your account, it is time to create the automated task itself.
Go back to the Gelato dapp home page and click on the Create Task button.
In the New Task page, input the following THALES staking contract address in the the Contract address input field:
After inputting the contract address, choose the claimRewardOnBehalf function and input your wallet address that you use for staking THALES in the (address account) input field.
After inputting your staking address in (address account), a card for choosing a frequency of execution should appear below it.
Since THALES staking rewards are claimable from a weekly snapshot, the Interval should be chosen to be 7 days+0 hours+0 min.
By default, the claiming will execute from the moment you create a task and will continue using that timestamp for every week. If you want to input a different day and time of the week for when the claiming executes on a weekly basis, you can do so by unchecking the Start immediately checkbox and choosing a day using Start time date and time picker.
On the next card called Pay With choose Gelato Balance (should be chosen as default already).
And finally, give your automated task a name of your choice in the Task name input field, after which a Create Task button should become visible.

Click on the Create Task button and you succefully automated your weekly claiming of THALES staking rewards!
πŸ₯³
​

​
​
Copy link
On this page
Step 1: Whitelist Gelato contract for the claimOnBehalf method
0x340759c8346A1E6Ed92035FB8B6ec57cE1D82c2c
Step 2: Create a new automation task on Gelato dapp
0xC392133eEa695603B51a5d5de73655d571c2CE51
Click on the Create Task button and you succefully automated your weekly claiming of THALES staking rewards!