In this section, you’ll learn how to request ready-to-use transaction data (bytecode) for withdrawing from 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:
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 | withdraw |
| amount | Amount in token’s smallest unit | 10000000 |
| wallet | Wallet that owns the position | 0x1234... |
| Parameter | Description | Example |
|---|---|---|
| toChainId or chainIdOut | Destination chain ID for the withdrawn funds | 8453 (Base) |
| toTokenAddress | Destination token address. Required when toChainId or chainIdOut is provided. | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (USDC on Base) |
| Parameter | Description | Example |
|---|---|---|
| output | Response format: bytecode (default), userOperation, fireblocks, or instructions (Solana) | fireblocks |
| accountId | Fireblocks vault account ID. Required when output=fireblocks | 12 |
toChainId 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 withdrawal through completion (see Checking Cross-Chain Withdrawal 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). After the withdrawal completes, transfer funds out of the smart wallet to your Omnibus wallet or any other destination.
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 Withdrawal Status
Cross-chain withdrawals are asynchronous: the source-chain withdraw + bridge transaction is signed first, then the bridged funds are delivered 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 arrived on the destination chain |
FAILED | A step failed |
REFUND_REQUIRED | Funds withdrawn but the bridge 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.
Same-chain withdrawals do not need this polling — the withdraw 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 withdrawal (
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
View your remaining positions
New Deposit
Make a new deposit
Protocol Info
Check protocol information