cpu_swap
Convert ETH to $CPU or sell $CPU back to ETH via the game's Uniswap v4 pool. Specify the amount to spend and max slippage; the exact-input trade is submitted on-chain and waits for confirmation.
Instructions
Swap between native ETH and $CPU on the game token pool (Uniswap v4), in either direction: sell: "ETH" buys $CPU, sell: "CPU" sells it for ETH. amount is how much of the sold token to spend. Preview the result first with cpu_quote_swap. The swap is exact-input: you spend amount and receive at least the quoted output minus slippage (a percent, e.g. 0.5 = 0.5%). Selling $CPU auto-approves it (via Permit2) once before the first swap; the trade is submitted on-chain and this waits for confirmation. A 1% pool fee applies.
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": {
"sell": "<sell>",
"amount": "<amount>"
},
"name": "cpu_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sell | Yes | Token to spend: ETH (to buy $CPU) or CPU (to sell for ETH). | |
| amount | Yes | Amount of the `sell` token to spend, as a decimal string (e.g. "0.5"). 18 decimals. | |
| slippage | No | Max slippage as a percent (e.g. 0.5 = 0.5%); the floor on what you receive. Default 0.5. |