data.ton. See the Swap Quoting page for the full input parameters.
Native sentinel
tokenIn / tokenOut for native TON. Internally routed through pTON v2.
Request
| Param | Required | Notes |
|---|---|---|
chainId | ✓ | ton:mainnet (or ton:testnet) |
tokenIn / tokenOut | ✓ | Friendly EQ…/UQ… or raw 0:hex. Native = EQAA…M9c. |
amount or amountRaw | ✓ | Human-readable ("1.5") or nanoTon ("1500000000") |
walletAddress | ✓ | User’s TON v4r2 address |
slippage | – | % (0-100, default 1) |
feePercentage | – | Caller referral fee 0-99% (Mobula skims 20%) |
minFeesNative | – | Minimum caller referral fee in TON, e.g. 0.1. Applies on native TON input swaps with feeWallet. |
feeWallet | – | Required when feePercentage > 0 |
Response — data.ton
data.ton fields
| Field | Type | Description |
|---|---|---|
transaction | message | Back-compat single-message access. Equal to transactions[0] (the swap). Old SDKs still work — they just won’t deliver the fee messages. |
transactions | message[1..4] | Full envelope: [0] = swap, [1] = Mobula 0.1% fee, [2] = caller referral fee. v4r2 wallet contract supports up to 4 per signature. |
fees.mobulaFeeAmount | string nanoTon | Mobula’s slice (always-on 0.1% + 20% cut of referral). |
fees.referralFeeAmount | string nanoTon | Caller’s net (after Mobula’s cut). 0 when no referral. |
fees.swapAmount | string nanoTon | Enters the swap. mobula + referral + swap = amountIn. |
fees.mobulaFeeBps | int | Always 10 (= 0.1%) in production. |
fees.userFeeBps | int | feePercentage × 100. |
fees.platformCutBps | int | Always 2000 (= 20%) in production. |
| Field | Type | Description |
|---|---|---|
to | string | Friendly EQ/UQ form preferred, raw 0:hex accepted |
value | string | nanoTon, digit-only (bigint-safe) |
body | string | Inner message body BoC, base64 |
bounce | bool | true for jetton transfers (refund on failure) |
stateInit | string? | BoC base64 — set on first jetton-wallet deploy |
Signing
TonConnect (recommended)
Privy embedded (Solana key reused via shared Ed25519)
TON’s wallet v4r2 verifies signatures with the same Ed25519 primitive Solana uses — a Privy Solana embedded wallet covers TON natively, no new key.Mnemonic (server-side / scripts)
Seepackages/execution-engine/src/spot/ton/signAndBroadcast.ts for the canonical reference (uses @ton/crypto mnemonicToWalletKey + sign(hash, secretKey)).
Send
{ data: { transactionHash } } once toncenter /message accepts the BoC.
Supported DEXs
| DEX | Pool | Notes |
|---|---|---|
| Stonfi v2 | constant-product | Default for most pairs |
| Stonfi omni | omni-router | Multi-hop |
| DeDust v2 (volatile) | constant-product | Volatile pairs |
| DeDust v2 (stable) | curve-style | Stablecoin pairs |
| pTON v2 | wrapped-TON | Used internally for native TON in/out |
Limits
- Max 4 messages per signature (v4r2 wallet contract). Calldata builder enforces this.
- No EIP-155 chainId — pass
'ton:mainnet'verbatim. TonConnect’snetworkfield discriminates. - Address forms — both friendly (
EQ…/UQ…) and raw (0:<hex>) accepted on input.