Slippage & gas
Every swap message carries a minAmountOut that the DEX contract enforces. If the price moves too far between quote and settlement, the swap aborts and you only pay gas.
Slippage
Set the bound with slippageBps on /v1/quote and /v1/tx. Default is 100 (1%). The aggregator computes:
minAmountOut = expectedOut * (10000 - slippageBps) / 10000For each leg of a multi-leg route, the slippage is applied to that leg’s expectedOut, not to the total. Practically this means tighter control: a 1% slippage on a 90/10 split means each leg has its own 1% bound.
Picking a value
- 50 bps (0.5%): for liquid pairs (TON/USDT, TON/USDC) on small sizes.
- 100 bps (1%): a safe default for most user flows.
- 300 bps+ (3%+): required for low-liquidity jettons or large orders where the splitter spreads across pools with different depths.
If minAmountOut is too tight, you’ll see the swap revert on-chain and your input refunds — at the cost of gas.
Gas
Gas on TON is paid in TON, not in the input asset. Each DEX has a roughly fixed gas budget per swap; chop attaches enough to cover the worst case and lets the contract refund the rest.
| Operation | Gas attached | Typical actual |
|---|---|---|
| DeDust TON → Jetton (direct) | 0.25 TON | ~0.04 TON |
| DeDust Jetton → Jetton (direct) | 0.30 TON | ~0.06 TON |
| DeDust multi-hop (2 pools) | 0.45 TON | ~0.10 TON |
| StonFi v1/v2 swap | 0.21 TON | ~0.07 TON |
The totalGas field on a route is the sum of attached gas across legs. The wallet ends up paying significantly less in practice because each contract refunds excess.
How gas affects routing
When the aggregator decides whether to split, it compares the net output, not the gross output. A 2-leg split that gives you 0.001 USDT more but costs an extra 0.2 TON of gas is worse than the single-DEX option, and chop will pick single. See Routing & splitting for the exact formula.