Build MC↔MG Swap Transaction
build_amm_swap_txBuild a two-step plan to swap MEGACHAD↔MEGAGOONER through MegaChadLP: ERC20.transfer(pair, amountIn) → pair.swap(amountAIn, amountBIn, to). MegaChadLP has no on-chain minOut — verify your received balance after the swap. Slippage is computed off-chain and surfaced as minOut.
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": {
"from": "<from>",
"amount": "<amount>",
"recipient": "<recipient>"
},
"name": "build_amm_swap_tx"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | Input token | |
| amount | Yes | Input amount in human units (e.g. "1000") | |
| recipient | Yes | Receive address (0x...) | |
| slippageBps | No | Slippage tolerance in bps (default 200 = 2%) |