Overview
For vaults with async deposits, a deposit may sit in a pending/queued state before the vault processes it. If the user wants to recover their funds instead of waiting for the vault to process them, the cancel-deposit endpoint generates the transaction to cancel the pending deposit.Deposit is pending
The user previously called deposit and the funds are queued, waiting to be processed.
Create cancel-deposit action
Call
POST /v1/actions/cancel-deposit/{opportunityId} to generate the cancellation transaction.This endpoint is only relevant for opportunities with async deposits (e.g., Mellow, Lagoon). For standard vaults, deposits are processed immediately and cannot be cancelled.
Create Cancel Deposit
Generate the transaction to cancel a pending async deposit. Like claim-deposit, this is a simplified request — the vault already knows which deposit to cancel based on the user’s address.The unique identifier of the opportunity with the pending deposit. Get this from the Opportunities API.
The user’s EVM wallet address. Must belong to a registered Turtle member and must have a pending deposit in this opportunity.
Your distributor ID for attribution tracking.
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
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
Related Endpoints
- Deposit - Generate the initial deposit transactions
- Claim Deposit - Claim a pending async deposit instead of cancelling
- Opportunities API - Discover available opportunities and their IDs

