YieldCreateExitAction generates unsigned withdrawal transaction calldata for a yield position.
Earn
YieldCreateExitAction
Generate unsigned withdrawal transaction calldata for a DeFi yield position
POST
YieldCreateExitAction generates unsigned withdrawal transaction calldata for a yield position.
Overview
YieldCreateExitAction returns the unsigned transaction payload needed to withdraw from a DeFi yield position. It is the counterpart to YieldCreateEnterAction.
Use this endpoint to build withdrawal UIs or construct exit calldata for Trails routes. For React apps, the composable action builders handle this automatically.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
earnMarketId | string | Yes | Market ID from YieldGetMarkets |
userWalletAddress | string | Yes | Address of the withdrawing wallet |
args | object | No | Market-specific arguments (e.g. amount, shares) |
Response
Returnspayload containing unsigned transaction data:
| Field | Description |
|---|---|
transactions | Array of transaction objects to execute |
transactions[].to | Contract address |
transactions[].data | ABI-encoded calldata |
transactions[].value | ETH value (for native token withdrawals) |
Examples
Withdraw from an Aave lending position
Withdraw a specific amount
Useargs to pass withdrawal parameters for markets that require them (e.g. partial withdrawals):
Common pattern: check balance then exit
See also
- YieldCreateEnterAction — Deposit into a position
- YieldGetAggregateBalances — Check existing positions before exiting
- YieldGetMarkets — Discover market IDs
Body
application/json
Response
OK
JSON object containing unsigned transaction payloads