Skip to main content
Let users lend assets into third-party vaults on Base through the Base Earn API. Your backend requests unsigned transactions from the API; the user’s wallet approves and submits them. Base Earn never signs or holds funds.
The Base Earn API is in developer preview. Upshift Earn is available in early access. Morpho Earn is coming soon.

Demo

The demo above is mock only. If you want to see onchain demos on Vibenet, head to Base chain demos.

Choose a Vault

Call GET /lend/vaults?network=base and select the approved vault for your app by vaultId. Do not pick the first catalog result automatically. Read each vault’s withdrawalMode to choose the exit flow: Discovery, position reads, and deposits use the same endpoints for both providers. Sending an Upshift vault to /lend/withdraw, or a Morpho vault to the queued endpoints, returns 400.

Deposit and Withdraw

This Morpho example uses earn() and attribution from Call the API and execute() from Execute Calls in a Wallet. earn() runs on your backend; execute() runs in the user’s wallet. The Python and Go versions return each batch to the client, which submits it with execute(); the Go earn.Call helper adds builderCode to writes for you. Each write is a separate user action.
maxSlippageBps is required for withdrawals: an integer from 0 through 9999, where 50 means 0.5%. Use the tolerance the user chose. Deposits do not accept a slippage bound, so do not present estimated shares as a guaranteed minimum. For the Upshift deposit, queued withdrawal, and claim, see End-to-End Lend Examples. Persist the claim date confirmed from the mined request; estimatedClaimDate is only an estimate and can roll to the next UTC day.
Yield is variable and funds are exposed to protocol risk. Withdrawals depend on available liquidity and protocol conditions, and a position’s current value is not guaranteed withdrawal proceeds. Show the action, assets, and approvals before the user signs, wait for successful execution, and request fresh calls rather than replaying an old batch.

See Also

Base Earn API

Supported protocols, endpoints, and quick start.

Concepts

Withdrawal modes, atomic units, slippage bounds, and queued withdrawals.

End-to-End Lend Examples

Morpho and Upshift walkthroughs, plus testing guidance.

Integrate an Earn Product

Design a one-deposit earn experience on the same API.