How It Works
Deposit lifecycle, Smart Routing Address behavior, fund location, status, and failure recovery.
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.
Every Earn deposit uses a Smart Routing Address (SRA), including same-chain deposits.
Participants
| Participant | Responsibility |
|---|---|
| Your application | Requests a quote, submits source-chain calls, stores the SRA, and tracks status |
| Owner | Funds and signs the deposit, receives the vault position, and authorizes recovery |
| Earn service | Resolves the vault and route, validates the target, reads capacity, and creates the SRA |
| SRA | Holds the route configuration and executes its stored destination actions |
| Relayer | Bridges funds when required and triggers destination execution |
| Vault protocol | Accepts the deposit and issues the resulting position to the owner |
Deposit sequence
Application request quote
Earn service validate target and create SRA
Owner fund SRA on source chain
Relayer bridge funds, if cross-chain
Relayer execute stored vault actions
Application track SRA statusQuote
The service:
- Resolves the funding token and destination vault.
- Selects the registered protocol adapter.
- Validates the target on-chain.
- Reads current deposit capacity.
- Creates an SRA containing the destination actions.
- Returns the source-chain calls and estimates.
For ERC-4626 targets, validation reads asset() and capacity through maxDeposit(owner). Aave validation checks the destination reserve and pool configuration.
Stored SRA actions cannot be changed after creation.
Funding
The owner submits every call in quote.transaction.calls or the equivalent quote.userOp batch. The final funding call transfers the source token to quote.sra.
The SDK does not submit this transaction.
Routing
For a cross-chain deposit, the relayer bridges funds to the SRA on the destination chain. A same-chain deposit skips the bridge but still waits for SRA execution.
The route can deliver the funding token directly or use an SRA-supported cross-token route when the vault asset differs.
Execution
The relayer executes the actions stored in the SRA:
- Approve the protocol target.
- Deposit or supply the amount received.
- Send the resulting vault shares or aTokens to the owner.
The destination actions use the amount available at execution rather than the quote's original estimate.
Status
Status is scoped to the SRA, not to an individual quote. Quotes with the same owner and routing configuration can resolve to the same SRA and therefore share status.
PENDING -> BRIDGING -> EXECUTING -> COMPLETED
-> FAILED
PENDING (no funds within 1 hour) -> ABANDONEDgetStatus derives the state from observed deposits, bridge transactions, and executions associated with the SRA.
Where funds are held
| Stage | Location |
|---|---|
| Before funding | Owner wallet |
| Funded, before bridge | SRA on the source chain |
| During bridge | Bridge protocol route addressed to the destination SRA |
| Bridged, before execution | SRA on the destination chain |
| After execution | Vault position held by the owner |
| Failed destination execution | SRA, until owner-authorized recovery |
ZeroDev operates the relayer. The relayer does not own funds held by the SRA. SRA funds move through stored actions or an owner-authorized withdrawal.
Quote expiry
expiresAt is approximately 60 seconds after quote creation. It is an estimate-validity timestamp, not an SRA expiration.
Funding after expiresAt is not rejected solely because the timestamp passed, but fees, received amount, shares, APY, and deposit capacity may have changed. Request a new quote when deposit parameters change or before refreshing estimates.
Slippage
slippage is set in basis points when requesting a quote. Default: 100 bps.
The SRA enforces the corresponding minimum output during execution. Cross-chain quotes also verify that the slippage budget covers route fees. If it does not, the request returns SLIPPAGE_TOO_LOW with details.minSlippageBps.
Failure after funding
If vault capacity changes or a destination call reverts, funds remain in the SRA for owner-authorized recovery. Tokens sent outside the configured route also require recovery.
If no funding arrives within one hour, status becomes ABANDONED. Late funds can still execute; start a new watcher to resume tracking. See Errors for quote and watcher failures.