Requires an API key via the
X-API-Key header. See API Keys. Overview
POST /v1/actions/withdraw/{opportunityId}
The withdraw endpoint generates transactions to redeem shares from a vault/opportunity. The typical flow is:
All action endpoints require the user to be a Turtle member. Make sure the user has completed the membership flow before calling these endpoints.
Create Withdraw
Generate the transactions needed to withdraw from an opportunity. The response contains an ordered list of transactions the user must sign and submit (e.g., approve + withdraw).The unique identifier of the opportunity to withdraw from. Get this from the Opportunities API.
The user’s EVM wallet address. Must belong to a registered Turtle member.
The number of shares to redeem in the smallest unit. Must be greater than 0.
Your distributor ID for attribution tracking.
The address of the token to receive after withdrawal. Required for some providers (e.g., Midas, Mellow, Veda). If not provided, the vault’s default withdraw token is used.
Slippage tolerance in basis points. For example,
50 = 0.5% slippage. Only applied to opportunities that require it.Transaction Object
Each transaction in thetransactions array contains:
Transaction type, e.g.
approve, deposit, withdraw, claimDeposit, cancelDeposit.The raw transaction data to sign and submit.
Target contract address.
Encoded calldata (hex string with
0x prefix).Value in wei. Usually
"0" for token interactions; non-zero for native token deposits.Estimated gas limit.
Chain ID for the transaction.
Human-readable description of what this transaction does.
Optional metadata for swap transactions, including provider info, amount out, gas estimate, and route details.
Complete Example
Here’s a full withdraw flow from start to finish:Operational Notes
Amount is in shares, in the smallest unit
Amount is in shares, in the smallest unit
Submit transactions in order
Submit transactions in order
The
transactions array is ordered. A withdrawal typically returns an approve then a withdraw. Confirm each before broadcasting the next.tokenOut is required for some providers
tokenOut is required for some providers
tokenOut sets the token the user receives. It is required for some providers (e.g., Midas, Mellow, Veda). If not provided, the vault’s default withdraw token is used.slippageBps applies where required
slippageBps applies where required
slippageBps is the slippage tolerance in basis points (50 = 0.5%). It is only applied to opportunities that require it.Membership is required
Membership is required
The user must be a registered Turtle member. Complete the membership flow first.
Error Handling
User is not a Turtle member
User is not a Turtle member
Distributor not found
Distributor not found
Status Code: 404 Not FoundSolution: Verify your distributor ID is correct and active.
Opportunity not found
Opportunity not found
Invalid tokenOut address
Invalid tokenOut address
Status Code: 400 Bad RequestSolution: Provide a valid EVM address for the
tokenOut field.Related Endpoints
- Deposit - Generate deposit transactions
- Get Opportunities - Discover available opportunities and their IDs

