> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getRewards

> Returns the rewards an owner has accrued in an Earn vault

## Function Signature

```typescript theme={"system"}
client.earn.getRewards(params: {
  vaultId: string;
  ownerAddress: string;
  traceContext?: TraceContext;
}): Promise<EarnVaultReward[]>
```

## Description

Returns the rewards an owner has accrued in an [Earn](https://www.dynamic.xyz/docs/earn/overview.md) vault. Rewards are a separate bonus some vaults pay in another token, and they sit unclaimed until claimed, unlike base yield, which shows up as `assets` growing.

Available as `client.earn` on `DynamicEvmWalletClient` and `DynamicSvmWalletClient`.

> [!NOTE]
>
> Rewards are supported only for vaults from some providers. For a vault from any other
> provider, the API rejects the request with an HTTP 400 error. See
> [Provider support](https://www.dynamic.xyz/docs/earn/overview.md#provider-support).

## Parameters

### Required Parameters

* **`vaultId`** (`string`): The vault identifier from [`listVaults`](https://www.dynamic.xyz/docs/node/reference/earn/list-vaults).
* **`ownerAddress`** (`string`): The wallet address that accrued the rewards.

### Optional Parameters

* **`traceContext`** (`TraceContext`): Trace context forwarded to the Dynamic API.

## Returns

* **`Promise<EarnVaultReward[]>`**: The accrued rewards. Empty when the owner has accrued nothing. Amounts are raw-unit strings.

## Example

```typescript theme={"system"}
import { authenticatedEvmClient } from './client';

const evmClient = await authenticatedEvmClient();

const rewards = await evmClient.earn.getRewards({
  vaultId: 'steakhouse-prime-usdc',
  ownerAddress: walletMetadata.accountAddress,
});

for (const reward of rewards) {
  console.log(`${reward.accrued} raw units of ${reward.tokenSymbol}`);
}
```

## Error Handling

Fails with an HTTP 403 error when Earn is not enabled for your environment, or an HTTP 400 error when the vault's provider does not support rewards.

## See Also

* [Earn](https://www.dynamic.xyz/docs/node/earn.md)
* [claimEarnRewards](https://www.dynamic.xyz/docs/node/reference/evm/claim-earn-rewards.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.