dex_tx_swap_prepare
Stage a swap session (server-side build only); returns swap_session_id. Does not sign or submit. Call after quote confirmed by user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Human-readable amount (e.g. '0.01') | |
| slippage | Yes | Slippage as decimal (0.01=1%, 0.1=10%) | |
| token_in | Yes | Source token address. Use '-' for native coin | |
| mcp_token | No | MCP session token obtained from login (dex_auth_google_login_poll or dex_auth_gate_login_poll). MUST be provided in every call to this tool after login; omitting it will result in 403 | |
| native_in | Yes | ⚠️ CRITICAL — Must be set correctly, wrong value causes transaction failure or fund loss. Simply check: is token_in a native/gas coin? If yes, set 1; if it's a contract token, set 0. Native coins: ETH, BNB, MATIC, AVAX, SOL — these are the chain's gas coins, native_in=1. Contract tokens: USDT, USDC, WETH, WBNB, DAI, etc. — these are ERC20/BEP20/SPL tokens, native_in=0. NOTE: BNB = native coin (native=1), WBNB = wrapped contract token (native=0). User saying 'BNB' means the native coin unless they explicitly say 'WBNB'. Same for ETH vs WETH, SOL vs WSOL. When native_in=1, token_in is auto-normalized to '-'. | |
| to_wallet | No | Destination chain receiving address. ONLY required for CROSS-CHAIN swaps where chain_id_in and chain_id_out belong to different address groups (e.g. EVM→Solana). Obtain from dex_wallet_get_addresses. Omit for single-chain swaps — defaults to user_wallet. | |
| token_out | Yes | Destination token address | |
| account_id | Yes | User account ID (UUID) | |
| native_out | Yes | ⚠️ CRITICAL — Must be set correctly, wrong value causes transaction failure or fund loss. Simply check: is token_out a native/gas coin? If yes, set 1; if it's a contract token, set 0. Native coins: ETH, BNB, MATIC, AVAX, SOL — these are the chain's gas coins, native_out=1. Contract tokens: USDT, USDC, WETH, WBNB, DAI, etc. — these are ERC20/BEP20/SPL tokens, native_out=0. NOTE: BNB = native coin (native=1), WBNB = wrapped contract token (native=0). User saying 'BNB' means the native coin unless they explicitly say 'WBNB'. Same for ETH vs WETH, SOL vs WSOL. When native_out=1, token_out is auto-normalized to '-'. CROSS-CHAIN EXAMPLE: USDT(BSC) → SOL(Solana): native_in=0 (USDT is contract token), native_out=1 (SOL is native coin). CROSS-CHAIN EXAMPLE: ETH(Ethereum) → USDT(BSC): native_in=1 (ETH is native coin), native_out=0 (USDT is contract token). | |
| chain_id_in | Yes | Source chain ID (e.g. 1=ETH, 56=BSC, 501=Solana) | |
| user_wallet | Yes | User's wallet address matching the SOURCE CHAIN. MUST be chain-specific: call dex_wallet_get_addresses(account_id) to get addresses, use addresses["EVM"] for EVM chains or addresses["SOL"] for Solana (chain_id=501). NEVER use an EVM address (0x...) for Solana or a Solana address for EVM chains. For cross-chain swaps this is the FROM (source) chain address. | |
| chain_id_out | Yes | Destination chain ID. Same as chain_id_in for single-chain swap |