alex_swap
Swap one token for another on ALEX DEX using the AMM by providing full input and output contract IDs plus the amount to trade. Mainnet only.
Instructions
Execute a token swap on ALEX DEX.
Swaps tokenX for tokenY using the ALEX AMM. Use full contract IDs for tokens.
Note: ALEX DEX is only available on mainnet.
Tip: call earning_opportunities to see how to put your assets to work.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tokenX": "<tokenX>",
"tokenY": "<tokenY>",
"amountIn": "<amountIn>"
},
"name": "alex_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokenX | Yes | Input token contract ID | |
| tokenY | Yes | Output token contract ID | |
| amountIn | Yes | Amount of tokenX to swap (in smallest units) | |
| minAmountOut | No | Minimum acceptable output amount (slippage protection) | 0 |