In this section, you’ll learn how to request ready-to-use transaction data (bytecode) for depositing into a yield position.Documentation Index
Fetch the complete documentation index at: https://docs.deframe.io/llms.txt
Use this file to discover all available pages before exploring further.
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 |
|---|---|---|
| fromChainId or chainIdIn | Source chain ID. Use the strategy chain for same-chain swaps. Required when fromTokenAddress is provided. | 137 (Polygon) |
| 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 with a fromChainId matching the strategy chain, the API automatically prepends a same-chain swap from fromTokenAddress to the strategy’s underlying asset. The amount parameter refers to the amount of fromTokenAddress to swap, and crossChain.isCrossChain remains false.| Parameter | Description | Example |
|---|---|---|
| fromChainId or chainIdIn | Source chain ID for the funds being bridged before deposit | 1 (Ethereum) |
| fromTokenAddress | Source token address. Required when fromChainId or chainIdIn is provided. Must be a valid ERC-20 token on the source chain; returns FROM_TOKEN_NOT_SUPPORTED (400) if the address is not a valid ERC-20 contract on the specified chain. | 0xA0b86991c... (USDC on ETH) |
| Parameter | Description | Example |
|---|---|---|
| output | Response format: bytecode (default), userOperation, fireblocks, or instructions (Solana) | fireblocks |
| accountId | Fireblocks vault account ID. Required when output=fireblocks | 12 |
fromTokenAddress to swap first:
fromChainId differs from the strategy’s chain, the response also includes a quote object describing the bridge selection, the resolved tokens, and the expected/minimum output amount. The crossChain.isCrossChain flag is true.
The top-level
id is used for execution tracking — store it and pass it to GET /actions/:id to track the cross-chain deposit through completion (see Checking Cross-Chain Deposit Status below).The quote object describes which bridge was selected (bridge), the expected outputAmount, and the worst-case minimumOutputAmount (slippage floor). Display these to the user before they sign.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:Checking Cross-Chain Deposit Status
Cross-chain deposits are asynchronous: the source-chain bridge transaction is signed first, then the bridged funds are delivered and deposited on the destination chain. To track progress to completion, use theid returned in the bytecode response:
| Parameter | Description | Example |
|---|---|---|
| id | The id returned by GET /strategies/:id/bytecode | 6a04f2f75bf7233c6220b3ca |
| Status | Meaning |
|---|---|
INITIAL | Created, awaiting on-chain execution |
PENDING | At least one transaction broadcast; awaiting confirmations |
SUCCESS | All steps completed; funds are deposited |
FAILED | A step failed |
REFUND_REQUIRED | Bridged funds arrived but the deposit step failed; refund is needed |
REFUNDED | Refund completed |
EXPIRED | Quote expired before execution |
status reaches a terminal value (SUCCESS, FAILED, REFUNDED, or EXPIRED). The transactions array lists each on-chain hash as it is confirmed, so you can surface progress to the user as the bridge and the destination-chain deposit complete in sequence.
Same-chain deposits do not need this polling — the deposit completes inline with the user’s signed transaction. The
id is still returned for record-keeping and can be queried the same way.Webhook Notifications
As an alternative to polling, Deframe can push every status transition to a URL you control. The payload is identical toGET /actions/:id, so you can drive the same UI off either source.
Webhook URL configuration is currently provisioned manually — contact the Deframe team to register your
webhookURL (and any optional custom headers, e.g. an HMAC signature header). Self-service configuration via the admin panel is coming soon.| Field | Value |
|---|---|
| Method | POST |
| URL | Your webhookURL |
Content-Type | application/json |
| Custom headers | Any headers you configure with the team are sent on every request |
SUCCESS):
- A request fires for every status change, so you may receive multiple deliveries per deposit (
INITIAL→PENDING→SUCCESS). - Deframe expects a
2xxresponse. Non-2xxresponses are recorded but not automatically retried; reconcile withGET /actions/:idif you need at-least-once guarantees. - Respond as quickly as possible; do the heavy work asynchronously on your side.
Next Steps
Check Positions
Monitor your open yield positions
Withdraw
Learn how to withdraw from positions