Overview
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: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
- Opportunities API - Discover available opportunities and their IDs

