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

# Earn Overview

> Put wallet balances to work with yield-generating vaults and lending markets from DeFi protocols

## Introduction

Dynamic has partnered with [Morpho](https://morpho.org/) to bring yield capabilities directly into your app. Earn also supports [Aave](https://aave.com/) lending markets on EVM chains and vaults on Solana. Your users can deposit stablecoins into a vault, withdraw at any time, and track their position in real time without leaving your app.

Each vault is served by a provider, which is the DeFi protocol that lends out the deposited funds. Every vault has a `vaultId` and a `provider` field, and all providers use the same Earn functions. A few features depend on what the provider offers, as described in [Provider support](#provider-support).

## What you can offer your users

* **Deposit and withdraw** assets into yield vaults with a seamless in-app experience
* **Earn yield** in the same asset your users deposit: deposit USDC, earn USDC
* **Track positions** with real-time holdings and accrued yield

## Supported chains

Earn vaults run on EVM chains and on Solana. Morpho and Aave vaults are EVM vaults, available on Ethereum, Base, Arbitrum, Optimism, Polygon, Monad, and Stable. Other vaults run on Solana. The chains a vault runs on depend on its provider, so read `chainId` and `chainName` from [`listYieldVaults`](https://docs.dynamic.xyz/docs/javascript/reference/client/list-yield-vaults) rather than assuming a vault exists on every chain.

Every Earn action needs a wallet account on the vault's chain family, so an EVM vault takes an EVM wallet account and a Solana vault takes a Solana wallet account. The API rejects a wallet account from the other chain family with an HTTP 400 error.

## Default vaults

These vaults are enabled by default and returned by [`listYieldVaults`](https://docs.dynamic.xyz/docs/javascript/reference/client/list-yield-vaults), which also returns each vault's live `netApy` and `tvlUsd`. These numbers change continuously, so the table omits them.

| Vault | Provider | Curator | Asset | Chain |
| - | - | - | - | - |
| `steakhouse-prime-usdc` | Morpho | Steakhouse Financial | USDC | Base |
| `gauntlet-usdc-prime` | Morpho | Gauntlet | USDC | Base |
| `galaxy-usdc-quality` | Morpho | Galaxy | USDC | Ethereum |
| `galaxy-usdt-quality` | Morpho | Galaxy | USDT | Ethereum |
| `galaxy-weth-quality` | Morpho | Galaxy | WETH | Ethereum |
| `hyperithm-usdc-apex` | Morpho | Hyperithm | USDC | Monad |
| `stableearn` | Morpho | Gauntlet | USDT0 | Stable |
| `aave-usdc-base` | Aave | Aave | USDC | Base |
| `aave-usdc-mainnet` | Aave | Aave | USDC | Ethereum |
| `kamino-usdc-steakhouse` | Kamino | Steakhouse Financial | USDC | Solana |

> [!NOTE]
>
> Other vaults can be enabled for your environment. [Contact us](https://www.dynamic.xyz/talk-to-us) to have one added.

## Key concepts

You don't need a DeFi background to build with Earn. These are the only ideas you need:

| Term | What it means for you |
| - | - |
| **Vault** | A position you can deposit into, backed by a DeFi protocol that lends out the deposited stablecoins. Each vault has an opaque `vaultId` you pass to every Earn function, and a `provider` field that names the protocol serving it. |
| **Shares** | An internal accounting balance the vault credits you when you deposit. Depending on the provider, your share count either stays fixed while `assets` grows or always equals `assets`. Either way, it's not something to show a user. |
| **Assets** | What your position is worth right now, in the underlying token (e.g. USDC). This is the number that grows as yield accrues. |
| **Base yield** | The vault's passive return. Nothing to claim: it shows up automatically as `assets` growing. |
| **Rewards** | A separate, optional bonus paid in another token (e.g. a campaign incentive). Unlike base yield, rewards sit unclaimed until you call [`claimYieldRewards`](https://docs.dynamic.xyz/docs/javascript/reference/client/claim-yield-rewards). Not every provider supports rewards. |

> [!TIP]
>
> Depending on the provider, a wallet's `shares` in a vault can stay fixed between deposits and withdrawals while only `assets` moves. Always display `assets`, never `shares`, when showing a user their balance or how much they've earned.

> [!WARNING]
>
> Your app should make clear to end users that yield is generated via a DeFi protocol independent from the wallet provider. Users keep full control of their assets and should explicitly direct any deposit or supply action.

## Provider support

Listing vaults, reading vault details, depositing, withdrawing, and reading a position work the same way for every provider. Earnings, performance, and rewards depend on what the provider reports or offers:

| Function | Morpho | Kamino | Aave |
| - | - | - | - |
| [`getYieldEarnings`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-earnings) | Yes | Yes, Solana mainnet only | Positions only, no PNL |
| [`getYieldPerformance`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-performance) | Yes | Yes, with no `returnOnCapital` | No |
| [`getYieldRewards`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-rewards) | Yes | Yes | No |
| [`claimYieldRewards`](https://docs.dynamic.xyz/docs/javascript/reference/client/claim-yield-rewards) | Yes | Yes, up to one transaction per reward farm | No |

* [`getYieldEarnings`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-earnings) covers one chain at a time and needs a wallet account on that chain's family: an EVM wallet account for Morpho and Aave positions, a Solana wallet account for Kamino positions. Its profit and loss fields are `null` for a provider that does not report a cost basis, and those positions add nothing to `totalPnlUsd`. `roe` is `null` for Kamino and Aave, which report no time-weighted return.
* [`getYieldPerformance`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-performance), [`getYieldRewards`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-rewards), and [`claimYieldRewards`](https://docs.dynamic.xyz/docs/javascript/reference/client/claim-yield-rewards) work only for the providers in the table. For a vault from any other provider, the call rejects with an HTTP 400 error.

Read each vault's `provider` field from [`listYieldVaults`](https://docs.dynamic.xyz/docs/javascript/reference/client/list-yield-vaults) or [`getYieldDetails`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-details) to decide which features to show for it.

## Solana vaults

Solana vaults use the same Earn functions as every other vault, but Solana changes a few behaviors that your UI needs to account for:

* **Several transactions per action.** A Solana deposit or withdrawal is split into up to three Solana transactions, such as the deposit itself and a step that stakes the deposited shares in the vault's farm. The SDK signs, sends, and confirms them one at a time, in order, so the user may approve more than one signature for a single action.
* **A short signing window.** All of an action's transactions are built against the same blockhash, which stays valid only briefly. If the user takes too long to approve, the remaining transactions expire and the action stops partway.
* **Partial completion.** When a later transaction fails or expires, the earlier ones have already confirmed on-chain. Read the wallet's position with [`getYieldPosition`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-position) before retrying, because repeating the whole action could apply the earlier steps twice.
* **No separate receiver.** Solana vaults credit shares and return tokens to the depositor's own accounts, so `receiverAddress` must be omitted or equal to the wallet's own address.
* **Network fees.** The user pays SOL network fees unless you opt in to gas sponsorship for the action by passing `sponsored: true`, which is available for Dynamic embedded wallets when [SVM gas sponsorship](https://docs.dynamic.xyz/docs/javascript/reference/solana/svm-gas-sponsorship.md) is enabled for your project. Unlike EVM vaults, Solana vault actions are never sponsored by default.
* **Positions include staked shares.** [`getYieldPosition`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-position) counts shares staked in the vault's farm, so the position stays the same size when the farm step runs.

For a hand-built integration that uses the Kamino SDK directly instead of the Earn functions, see the [Kamino yield vaults recipe](https://docs.dynamic.xyz/docs/recipes/integrations/yield/kamino.md).

## Using the Earn functions

This is the full lifecycle:

1. [`listYieldVaults`](https://docs.dynamic.xyz/docs/javascript/reference/client/list-yield-vaults): see which vaults are enabled for your environment.
2. [`getYieldDetails`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-details): get a specific vault's asset, decimals, and other metadata.
3. [`depositToYieldVault`](https://docs.dynamic.xyz/docs/javascript/reference/client/deposit-to-yield-vault): deposit a wallet's funds into a vault.
4. [`getYieldPosition`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-position): read a wallet's current `assets` balance in a vault. This is the number to show a user, and it grows on its own as yield accrues.
5. [`getYieldRewards`](https://docs.dynamic.xyz/docs/javascript/reference/client/get-yield-rewards) and [`claimYieldRewards`](https://docs.dynamic.xyz/docs/javascript/reference/client/claim-yield-rewards): check for and claim bonus token rewards, if the vault runs a campaign.
6. [`withdrawFromYieldVault`](https://docs.dynamic.xyz/docs/javascript/reference/client/withdraw-from-yield-vault): withdraw a wallet's position, in whole or in part.

Step 5 applies only to providers that support rewards, which today are Morpho and Kamino.

See each function's reference page for parameters, return types, and usage examples.

> [!NOTE]
>
> Do your own research when selecting a vault or lending market. APY is variable and not guaranteed. Review the protocol documentation and understand the risks before depositing funds.

> [!WARNING]
>
> Dynamic does not control DeFi vaults, lending markets, or the underlying protocols. Vault and market information is provided for reference only and may change or be inaccurate. Earnings are generated from third-party protocols and are not guaranteed. Using vaults and lending markets involves risk, including potential loss of funds. These materials are for general information purposes only and are not investment advice or a recommendation or solicitation to engage in any specific transaction. You are responsible for evaluating protocols and vaults at your own discretion. Dynamic does not provide investment, financial, legal, or tax advice.


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