# ZeroDev Earn (/onramp/earn)

> For the complete documentation index, see [llms.txt](/llms.txt)



<Callout type="warn" title="Beta">
  ZeroDev Earn is an experimental product offered in beta. It supports your
  integration with third-party protocols. ZeroDev does not provide these
  protocols or the services they offer, does not custody assets, and does not
  execute or control transactions; any transactions are solely between you (or
  your end users) and the applicable third-party protocol. Any APY, rewards,
  or other amounts are provided by such protocols, not ZeroDev, and all data
  is supplied by third parties for informational purposes only. Use involves
  significant risk, including smart contract failures, market volatility,
  illiquidity, lockup, and loss of principal. ZeroDev is not liable for any
  losses arising from use of the product or the third-party protocols it
  surfaces. You are responsible for ensuring your end users understand these
  risks and for any disclosures required by applicable law. Do your own
  independent research and proceed at your own risk.
</Callout>

[`@zerodev/earn`](https://www.npmjs.com/package/@zerodev/earn) turns an intent like "deposit this USDC into a vault on another chain" into a quote: a [Smart Routing Address](/onramp/smart-routing-address) (SRA) to fund, plus the ready-to-sign source-chain calls. The user signs on the source chain. A relayer bridges when necessary and runs the deposit on the destination chain.

The SDK does not hold keys or submit transactions. Your application requests a quote, sends the returned calls with its wallet client, and tracks the SRA until the deposit completes.

```ts
const quote = await earn.morpho.deposit({
  owner: account.address,
  amount: "100",
  token: TOKENS.USDC,
  srcChainId: 8453, // Base
  into: vault,      // Vault on Arbitrum
});
```

## Deposit lifecycle [#deposit-lifecycle]

1. Your application selects a vault and requests a quote.
2. The server validates the vault, reads its current deposit capacity, and creates an SRA containing the destination actions.
3. The owner submits the source-chain calls returned in `quote.transaction` or `quote.userOp`.
4. The relayer bridges the funds when the source and destination chains differ, then executes the vault deposit.
5. Your application tracks the SRA with `earn.watchStatus` or `earn.getStatus`.

Same-chain deposits use the same flow without the bridge step.

## Supported operations [#supported-operations]

| Operation                            | Methods                                                           | Notes                                                                             |
| ------------------------------------ | ----------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| Deposit into Aave V3                 | `earn.aave.deposit`                                               | Supplies an Aave reserve                                                          |
| Deposit into Morpho, Fluid, or Yearn | `earn.morpho.deposit`, `earn.fluid.deposit`, `earn.yearn.deposit` | `into` accepts a discovered vault or raw contract address                         |
| Deposit into another ERC-4626 vault  | `earn.erc4626.deposit`, `earn.depositIntoVault`                   | Generic or explicitly selected protocol                                           |
| Discover vaults                      | `earn.listVaults`, `earn.getVault`                                | Listings come from vaults.fyi and are filtered for supported protocols and assets |
| Track a deposit                      | `earn.watchStatus`, `earn.getStatus`                              | Status is scoped to the SRA                                                       |
| Withdraw a vault position            | `earn.withdrawFromVault`                                          | Same-chain; vault must be known to vaults.fyi                                     |
| Recover funds from an SRA            | `earn.getWithdrawCalls`                                           | Requires the SRA owner to sign                                                    |

See [Supported protocols and vaults](/onramp/earn/supported-vaults) for protocol-specific methods, accepted targets, chains, tokens, and constraints.

## Start integrating [#start-integrating]

* [Quickstart](/onramp/earn/quickstart): build and track an EOA-funded deposit
* [Supported protocols and vaults](/onramp/earn/supported-vaults): methods, chains, tokens, and constraints
* [Usage](/onramp/earn/usage): deposits, smart accounts, withdrawals, and recovery
* [How it works](/onramp/earn/how-it-works): lifecycle, custody model, and failure behavior
* [Reference](/onramp/earn/reference): methods, types, defaults, and errors
* [Earn demo](https://earn-demo.zerodev.app): try the deposit flow
* [ZeroDev examples repository](https://github.com/zerodevapp/zerodev-examples): EOA, Kernel, Aave, withdrawal, and recovery examples in the `earn` directory
