Overview
The Actions API handles the transactional lifecycle for deposits on Turtle Earn. The typical flow is: deposit → user signs & submits tx → attribute the tx hash → optionally verify tracking.All deposit action endpoints require the user to be a Turtle member. Make sure the user has completed the membership flow before calling these endpoints.
Create Deposit
Generate the transactions needed to deposit into an opportunity. The response contains an ordered list of transactions the user must sign and submit (e.g., approve + deposit).The unique identifier of the opportunity to deposit into. Get this from the Opportunities API.
The user’s EVM wallet address. Must belong to a registered Turtle member.
The address of the token being deposited. Must be a supported token on the opportunity’s chain. Cannot be the vault’s receipt token.
The deposit amount in the token’s smallest unit (wei). Must be greater than 0.
Your distributor ID for attribution tracking.
Deposit mode. Use
direct for direct deposits into the vault, or swap to use a DEX router when the input token differs from the vault’s deposit token.Slippage tolerance in basis points when using
swap mode. For example, 50 = 0.5% slippage.Optional referral code for deposit attribution.
Transaction Object
Each transaction in thetransactions array contains:
Transaction type:
approve, swap, or deposit.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 deposits; 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 deposit 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
Deposits disabled
Deposits disabled
Status Code: 400 Bad RequestSolution: This opportunity has temporarily disabled deposits. Try a different opportunity.
Unsupported token
Unsupported token
Status Code: 400 Bad RequestSolution: Use a supported deposit token. Check the opportunity’s
depositTokens array.Related Endpoints
- Attribute - Link an on-chain transaction hash to a tracked action
- Verify - Verify that a transaction contains valid Turtle tracking data
- Opportunities API - Discover available opportunities and their IDs
- Membership API - Register users before they can deposit
- Deposits API - Track deposits after they’re completed

