buy_token
Purchase any supported token on Solana, Sui, Ethereum, Base, Arbitrum, BSC, and more by swapping native funds through a DEX route.
Instructions
Buy a token on any supported chain (Solana, Sui, Ethereum, Base, Arbitrum, BSC, etc.) using the best DEX route.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex | No | Preferred DEX (raydium, orca, uniswap-v3, cetus, odos, etc.) | |
| chain | Yes | Chain: 'solana', 'sui', or ChainId number (1=ETH, 8453=Base, 42161=Arbitrum) | |
| amount | Yes | Amount of native token to spend, e.g. '0.1' for 0.1 SOL | |
| apiKey | No | GDEX API key for managed-custody buys (with sessionPrivateKey). | |
| referrer | No | Referral address | |
| slippage | No | Max slippage tolerance in percent. Default: 1 | |
| inputToken | No | Override input token address (default: native) | |
| priorityFee | No | Solana priority fee in SOL | |
| tokenAddress | Yes | Contract address of the token to buy | |
| walletAddress | No | Wallet address to trade from | |
| sessionPrivateKey | No | Managed-custody session private key (from sign-in). Required for EVM managed swaps — routes through the session-signed purchase_v2 flow. |