The Base Earn API is in developer preview. Upshift Earn (cbXRP) is available in early access. Morpho Earn (USDC) is coming soon.
Demo
Design the Experience
1
Show a curated catalog
Build your list from
GET /lend/vaults, filtered to the vaults your app has approved. Show each vault’s name, asset, and provider. For Upshift, also show depositsPaused, withdrawalsPaused, and the waiting period from redemptionLagSeconds.2
Take one deposit
The user enters an amount and approves one batch from
POST /lend/deposit. The batch may include a token approval; execute every call in order.3
Show redeemable value
Read
GET /lend/positions after each confirmed action. Display assets, the current value of the user’s shares, rather than a fixed return. For Upshift, assetsAfterFee is the value net of the current withdrawal fee.4
Set exit expectations
Read
withdrawalMode before the user commits. Morpho (synchronous) withdraws in one step. Upshift (queued) needs a request, a waiting period, and a claim, so show the expected claim date and the queued amount until it is claimed.Build the Portfolio View
This example joins the catalog with the user’s positions for a portfolio screen. It usesearn() from Call the API in TypeScript, Python, or Go (earn.Call, which returns raw JSON); deposits and withdrawals follow Integrate Lending and End-to-End Lend Examples.
decimals from discovery. Upshift shares already in the redemption queue are not included in positions, so track queued withdrawals with GET /lend/redemptions.
See Also
Base Earn API
Supported protocols, endpoints, and quick start.
Concepts
Vaults, shares, withdrawal modes, and queued withdrawals.
Base Earn API FAQ
Custody, accounts, fees, and withdrawal questions.
Integrate Lending
Deposit and withdraw through the same API.