Yield rewards

How to claim vETH and vUSD yield rewards accumulated by your project's smart contracts

vETH and vUSD rewards are distributed through rewarder contracts.

Read on to learn how to claim vETH and vUSD from those contracts.

Step 1. Query Proof for a given address

Call the rewards claim API under https://token-rewards-api.zkevm.cronos.org/claim/<walletaddress>/<tokenaddress>.

You need to replace <walletaddress> with the account address for which you are claiming for, in the URLs listed below:

Example response:

Response explained:

  • pending_amount: The amount of the token in wei that the address has earned, but cannot be claimed yet.

  • claimable_amount: The amount of the token in that the address has earned, is ready to claim and has not been claimed yet

  • earliest_expiration_time: When the first unclaimed rewards will expire

  • next_claimable_time: When the pending_amount will become claimable

  • claim: the data needed to claim rewards from the rewarder contract

    • recipient: The address that will receive the rewards, this is the same as the provided wallet address in the URL.

    • total_earned: the amount that has been tracked in the rewarder contract. The rewarder contract keeps track of the amount that is already claimed.

    • total_expired: the amount that has already been expired.

    • merkle_proof: The merkle proof needed to claim rewards

Step 2. Claim the rewards using the proof

There are 2 rewarder contracts, one for each token:

Once you have obtained all the necessary claim information from the claim API, use the <walletaddress> account to call the claim method on the rewarder contract for the given token:

function claim(address _recipient, uint256 _reward, uint256 _expired, bytes32[] calldata _proof)

Parameters explained:

  • _recipient: Recipient that will receive the rewards, should be the same as returned in the claim object by the claim API

  • _reward: the total_earned as returned by the claim API

  • _expired: the total_expired as returned by the claim API

  • _proof: the merkle_proof as returned by the claim API

If the call is successful, the unclaimed rewards are transferred from the rewarder contract to the _recipient.

Make sure that the _recipient can access the rewards transferred to them.

Important note for app developers

If your app is designed in such way that rewards are accumulated by a smart contract address, this smart contract can probably not call the claim function.

In that case, please contact Cronos Labs for assistance.

Last updated