Skip to main content

claimYieldRewards

Claims a wallet’s accrued bonus rewards in an Earn vault, then signs and sends the transaction for you. You only pass a vaultId, and Dynamic resolves everything else needed to process the claim. This is separate from base yield, which never needs claiming. Rewards are an optional bonus some vaults pay out in addition to base yield, and they sit unclaimed until you call this function. This function currently supports vaults from these providers: Morpho and Kamino. For a vault from any other provider, such as an Aave vault, the call rejects because the API responds with an HTTP 400 error, so check the vault’s provider from getYieldDetails first. A Morpho claim is a single EVM transaction. A Kamino claim is an ordered sequence of Solana transactions, one for each of the vault’s reward farms that has something pending, so a user can be asked to approve more than one signature. claimYieldRewards signs, sends, and confirms each transaction before it starts the next, and onTransactionStepChange reports progress through the sequence. If a later transaction fails or expires, the earlier ones have already confirmed, so read getYieldRewards again before retrying. For a supported vault, the call rejects when there’s nothing claimable for this vault right now, either because no reward campaign is active or because everything has already been claimed. Check getYieldRewards first, and only show a claim action when it returns a non-zero accrued amount.

Usage

Parameters

Returns

Promise<{ transactionHash: string }> - The hash of the claim transaction. For a Solana vault, this is the signature of the last transaction in the sequence.
For an EVM vault, a resolved claimYieldRewards call means the claim transaction was sent, not that it finished. See Waiting for confirmation before showing a success state to the user.

Waiting for confirmation

For an EVM vault, transactionHash is returned as soon as the claim is broadcast to the network, and it can still fail or revert after that. Wait for a receipt before telling the user their claim succeeded:

Solana vaults

For a Solana vault, claimYieldRewards polls each transaction until it reaches the confirmed commitment level before it starts the next one, and it resolves only after the last transaction has confirmed. A resolved call therefore means every transaction in the sequence landed, although a confirmed transaction is not yet finalized. You do not need to wait for a receipt the way you do for an EVM vault.

Examples

Only offer claim when something is claimable

Follow a multi-transaction Solana claim

Supported Chains

claimYieldRewards supports EVM wallet accounts for EVM vaults and Solana wallet accounts for Solana vaults. Calling it with a wallet account from a chain family that does not implement the underlying executeYieldTransaction method throws a WalletProviderMethodUnavailableError. A wallet account from the other chain family than the vault’s is rejected with an HTTP 400 error.

React

This hides the button entirely when there’s nothing to claim, rather than showing it and reporting the resulting rejection as a normal outcome:
useClaimYieldRewards invalidates useGetYieldRewards on success, so rewards refetch automatically. That refetch can still briefly show the old amount, since the claim transaction may not be mined yet (see Waiting for confirmation).
Last modified on October 26, 2026