Swap mode lets users deposit any supported input token into a vault even if it is not the vault’s native deposit token. The API routes the swap through a DEX automatically before depositing.Documentation Index
Fetch the complete documentation index at: https://docs.turtle.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Detecting availability
CheckswapDirectEnabled and swapRouteEnabled on the opportunity object to determine which modes are available.
| Scenario | swapDirectEnabled | swapRouteEnabled |
|---|---|---|
| Direct deposit only | true | false |
| Swap deposit only | false | true |
| Both modes available | true | true |
Using swap mode
Setmode to swap in your deposit request and provide the input token the user wants to deposit with.
slippageBps
TheslippageBps parameter controls the maximum acceptable slippage for the swap in basis points.
- Default:
50(0.5%) - Recommended range:
50to200(0.5% to 2%) - Increase for volatile pairs or low liquidity routes
- Maximum recommended is
200(2%)
The
GET /v1/route endpoint is deprecated and has been removed. Swap routing is handled automatically when mode=swap is set on the deposit request.
