Prerequisites: Make sure you’ve reviewed how to check protocol info first.
Protocol-Specific Approach
Use this when you want to work with a specific yield protocol. Request Transaction Data Fetch specific protocol information using:| Parameter | Description | Example |
|---|---|---|
| action | Type of operation | lend |
| amount | Amount in token’s smallest unit | 10000000 |
| wallet | Wallet that will own the position | 0x1234... |
| Parameter | Description | Example |
|---|---|---|
| fromTokenAddress | Token address to swap from before depositing (same-chain). When provided, the response includes swap transaction(s) before the deposit bytecode. | 0xC02aaA39... (WETH) |
When
fromTokenAddress is provided, the API automatically prepends a swap from fromTokenAddress to the strategy’s underlying asset on the same chain. The amount parameter refers to the amount of fromTokenAddress to swap. The response metadata will have isSameChainSwap: true.| Parameter | Description | Example |
|---|---|---|
| fromChainId | Source chain ID (for cross-chain deposits) | 1 (Ethereum) |
| fromTokenAddress | Source token address (required if fromChainId) | 0xA0b86991c... (USDC on ETH) |
| toTokenAddress | Destination token address (for cross-chain) | 0x2791Bca1f... (USDC on Polygon) |
| Parameter | Description | Example |
|---|---|---|
| output | Response format: bytecode (default), userOperation, fireblocks, or instructions (Solana) | fireblocks |
| accountId | Fireblocks vault account ID. Required when output=fireblocks | 12 |
fromToken to swap first:
crossChainQuoteId is populated when isCrossChain is true and can be used to track cross-chain transaction status.output=fireblocks and pass your vault accountId. The wallet parameter must be a smart wallet previously provisioned via POST /fireblocks-smart-account (see Fireblocks Integration).
transactionData.transactionRequest payload can be submitted directly to the Fireblocks Transactions API (POST /v1/transactions) — no further encoding required. The Earn Owner vault must be configured as the signer (see Fireblocks Integration).
To let the system automatically select the best protocol, use
GET /yield/ to retrieve ranked recommendations, then pass
the chosen strategyId into the Protocol-Specific approach above.
See the API Reference for the full yield endpoint schema.
Executing the Transaction
Once you have the bytecode, you can execute it using your wallet provider:Next Steps
Check Positions
Monitor your open yield positions
Withdraw
Learn how to withdraw from positions