Skip to main content
The Earn component opens a market selector so users can deposit into yield protocols (Aave, Morpho, Yearn, and others) from any chain or funding source.
Earn currently supports open market selection only. Pre-configured deposits and contract calldata deposits are not yet available. For programmable deposits today, use composable actions with market IDs.

Basic usage

import { Earn } from "0xtrails";

<Earn apiKey="YOUR_API_KEY" />

Props reference

PropTypeRequiredDescription
apiKeystringYesYour API key
onEarnStartfunctionNoCalled when the user begins
onEarnSuccessfunctionNoCalled on completion
onEarnErrorfunctionNoCalled on failure
For appearance and wallet options, see SDK configuration.