Exit position
Create an exit action withPOST /v1/actions/exit. The API returns ordered unsigned transactions, submitted the same way as an enter action.
When to use
- Unstake tokens (for example, “Unstake my ETH from Lido”)
- Withdraw from a lending market or vault
- Remove liquidity
- Leave a position entirely or partially
Authentication and host
Send the project API key in thex-api-key header.
Step 1: Check the yield allows exits
status.exit is true. Read mechanics.cooldownPeriod ({ seconds }) for any waiting period, and mechanics.arguments.exit.fields[] for the arguments.
Step 2: Check the position (recommended)
type values are active, entering, exiting, withdrawable, claimable, and locked. Exit from active balances.
Step 3: Create the exit action
POST /v1/actions/exit. yieldId and address are required. Pass the fields the exit schema lists.
amount is a human-readable decimal string. amountRaw is the smallest-unit alternative; send one, not both. Other arguments, when the schema lists them:
Optionally call
POST /v1/actions/exit/simulate first to estimate gas.
The response is 201 with an ActionDto: id, intent: "exit", type, status, executionPattern, and transactions[].
Step 4: Sign and submit
Same asenter-position: process transactions[] in stepIndex order, sign each unsignedTransaction, then use one path per transaction.
POST /v1/transactions/{transactionId}/submitwith{ "signedTransaction": "..." }for yield.xyz to broadcast.PUT /v1/transactions/{transactionId}/submit-hashwith{ "hash": "0x..." }if you broadcast.
executionPattern is synchronous or batch on current actions. asynchronous is also a declared value, but current actions return synchronous or batch.
Step 5: Cooldowns and claiming
Many staking yields hold funds through a cooldown after the exit. The exiting amount shows as anexiting balance, then a withdrawable balance when it is ready. Claim it with manage-position using the pending action on that balance (for example CLAIM_UNSTAKED or WITHDRAW). Cooldown length is yield-specific: read mechanics.cooldownPeriod.
Track the action with GET /v1/actions/{actionId} until SUCCESS, FAILED, or CANCELED.
Errors
Edge cases
- Partial exits: Most yields accept an exact
amount. Check the exit schema. - Existing cooldowns: Some protocols allow further unstake requests during a cooldown; others do not. Read the
exitingbalances first. - Vault shares: Vault exits convert shares at the current price per share, which can differ from the deposit amount.
- Closed exits: If
status.exitisfalse, do not create the action.

