buy_token
Purchase a token with a chain's native currency from a managed GDEX wallet; returns a requestId to track with wait_for_trade. For USDC payments, use usdc_buy.
Instructions
Buy a token with the chain's native token from the managed GDEX wallet (session-signed purchase_v2). Chains: Ethereum 1, Optimism 10, BSC 56, Sonic 146, Fraxtal 252, Robinhood 4663, Base 8453, Arbitrum 42161, Solana. Returns a requestId; follow it with wait_for_trade. To pay with USDC use usdc_buy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex | No | Not supported: the backend picks the route. Rejected when set. | |
| chain | Yes | Chain: 'solana', 'base', or a chain id (8453=Base, 42161=Arbitrum) | |
| amount | Yes | Native token to spend, e.g. '0.1' for 0.1 SOL; converted exactly to native decimals | |
| apiKey | No | GDEX API key used to encrypt the signed trade | |
| referrer | No | Not supported by purchase_v2/sell_v2. Rejected when set. | |
| slippage | No | Slippage percent, Solana and Sui only (sent as bps, max 50). Rejected on EVM, where the account's stored slippage applies. Omit to use the stored setting. | |
| accountRef | No | Connected account from gdex_connect. Supplies session key, wallet address, API key and session data so no secret is passed in chat | |
| inputToken | No | Omit, or the chain's native token. Anything else is rejected (use usdc_buy for USDC). | |
| priorityFee | No | Solana priority fee in lamports (integer, max 50000000 = 0.05 SOL). Solana only. | |
| tokenAddress | Yes | Contract address (mint on Solana) of the token to buy | |
| walletAddress | No | Control wallet address (the GDEX userId) | |
| sessionPrivateKey | No | Session private key from sign-in |