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 |
|---|---|---|
| fromToken | Token address to swap from before depositing (same-chain). When provided, the response includes swap transaction(s) before the deposit bytecode. | 0xC02aaA39... (WETH) |
When
fromToken is provided, the API automatically prepends a swap from fromToken to the strategy’s underlying asset on the same chain. The amount parameter refers to the amount of fromToken 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) |
| output | Response format: “bytecode” or “userOperation” | bytecode (default) |
fromToken to swap first:
crossChainQuoteId is populated when isCrossChain is true and can be used to track cross-chain transaction status.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.