Action endpoints require the user to be a registered Turtle member.
complex settlement (for example Mellow and Lagoon). Standard instant vaults never reach a pending state. See Deposit modes for how to detect which kind you are dealing with.
Overview
POST /v1/actions/claim-deposit/{opportunityId}
POST /v1/actions/cancel-deposit/{opportunityId}
A pending deposit resolves exactly once. After the vault processes the queued funds, call claim-deposit to finalize the position; before processing completes, call cancel-deposit to return the funds to the user. Both endpoints take the same path parameter and body, and each returns an actionId and an ordered transactions array to sign and submit.
The pending-deposit state machine
| State | How it got here | What you can do |
|---|---|---|
| Pending | User deposited into a complex vault; the vault has queued the funds. | Wait for the vault to process, or cancel to recover funds now. |
| Processed | The vault finished processing the queued deposit. | Claim to finalize the position. |
| Claimed | The user claimed the processed deposit. | Done. The position is active. |
| Cancelled | The user cancelled before processing completed. | Done. Funds returned to the user. |
Detect a pending deposit
A deposit is pending only when the opportunity iscomplex. Read the deposit-steps type off the opportunity object before assuming a claim is needed.
Claim to finalize
Once the vault has processed the queued deposit, generate the claim transaction to finalize the position.POST /v1/actions/claim-deposit/{opportunityId}
Response Example
Cancel to abort
If the user would rather recover funds than wait for the vault to process the deposit, generate the cancel transaction. Funds are returned to the user.POST /v1/actions/cancel-deposit/{opportunityId}
Response Example
Shared parameters
Both endpoints take the same path parameter and body. Path ParametersThe opportunity holding the pending deposit. Get it from Get Opportunities.
The user’s EVM wallet address. Must belong to a registered Turtle member with a pending deposit in this opportunity.
Your distributor ID for attribution tracking.
Response Fields
Both endpoints return the same shape.Unique identifier for this action, returned for both claim and cancel.
Ordered array of transactions to sign and submit. Each element follows the Transaction Object shape rendered below; claim returns a single
claimDeposit transaction and cancel returns a single cancelDeposit transaction.Broadcast
Each endpoint returns a single transaction. Sign and submit 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.
Operational Notes
Only for complex vaults
Only for complex vaults
Claim and cancel apply only to opportunities with
complex settlement. Instant vaults complete on deposit and have nothing to claim or cancel.No amount needed
No amount needed
Neither endpoint takes a token or amount. The vault already holds the pending-deposit details keyed to the user’s address, so the request only needs
userAddress and distributorId.Claim and cancel are exclusive
Claim and cancel are exclusive
A pending deposit resolves once, either to claimed or cancelled. After the vault processes the deposit, claim finalizes it; before processing completes, cancel returns the funds.
Error Handling
User is not a Turtle member
User is not a Turtle member
Distributor not found
Distributor not found
Status: 404 Not FoundSolution: Verify your distributor ID is correct and active.
Opportunity not found
Opportunity not found
Related
Deposit
Generate the initial deposit that may go async.
Deposit modes
How to tell instant vaults from complex ones.

