The Base Earn API is in developer preview. Upshift Earn is available in early access. Morpho Earn is coming soon.
Demo
Choose a Vault
CallGET /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 usesearn() 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.
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.