Automate staking with Gelato Functions

Currently THALES staking rewards need to be claimed manually by users on a weekly basis or the weekly reward is forfeited. The rewards do not roll over to next week automatically!

With the 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: Sign In and top up your USDC (Polygon) balance for gas

Navigate to the Gelato 1Balance page: https://app.gelato.network/1balance

Connect your wallet to the dapp on the top right corner and sign the Sign In message on your wallet.

Make sure you have USDC on Polygon network in your connected wallet. It is important to note that native USDC is needed, the bridged version cannot be used for this.

In the input field of the 1Balance page, input the amount of USDC you wish to be used as a gas tank for your claim transactions.

Keep in mind that a claim transaction across supported networks varies between 0.05$ and 0.2$ executed per week.

After inputting USDC amount, click on the Deposit button and confirm the transaction.

Step 2: Create a new task on Gelato functions page

After depositing USDC in the gas tank, navigate to the Gelato Functions page: https://app.gelato.network/functions

Click on the Create task button.

In the create task page, choose the Time Interval option, put the time frequency as 7 Days, 0 Hours, 0 Minutes and 0 Seconds. Uncheck the Start Immediately button and set the start time at the time you see fit.

In the What to trigger box, pick Transaction. In the Network section, pick the network on which you are staking your THALES.

In the Contract Address input field, input the staking contract address of the network in which you are staking your THALES:

  • Optimism staking contract:

  • Arbitrum staking contract:

  • Base staking contract:

For the Function to be automated pick the claimRewardOnBehalf function.

In the address account field, input your address from which you are staking THALES.

As a final step, input how you want to name your task in Task Properties and then click on the Create Task button and confirm the transaction.

Step 3: Whitelist your task to claim on your behalf on the Thales.io staking dapp

Open your newly created task page from here: https://app.gelato.network/functions?type=tasks

Click on your task and from the task page, copy the Dedicated message sender address.

Now navigate to thales.io dapp > TOKEN > STAKING > PREFERENCES page using this link: https://www.thales.io/token/staking?tab=acc-preferences

Make sure your wallet is connected and connected to the network you are staking your THALES with.

In the third field called CLAIM ON BEHALF, input the Dedicated message sender address you previously copied from the Gelato task page.

After inputting the address, click ENABLE and confirm the transaction.

CONGRATULATIONS! You have now successfully automated your THALES staking reward claiming.

Last updated