quote_swap
Quote an exact-in swap. side=buy spends USDC for the coin, side=sell spends the coin for USDC. Amounts are human units (USDC for buys, coins for sells). USDC-paired coins are quoted on their v4 pool; v3 coins (paired with a registry-approved token, gold first) through both hops of their route (USDC to the pair, the pair to the coin). Quotes are at the rate of the moment, net of the coin's fees, anti-snipe and large-trade fees included. Pass your referrer address: 5% of the swap fee accrues to it on-chain. Use the SAME referrer here and in prepare_swap; nothing binds them for you.
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": {
"coin": "<coin>",
"side": "<side>",
"amount": "<amount>"
},
"name": "quote_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | The ubi.fun coin's contract address (0x...) | |
| side | Yes | buy spends USDC for the coin; sell spends the coin for USDC | |
| amount | Yes | The exact input in human units: USDC for a buy, coins for a sell (for example "25" or "1000.5") | |
| referrer | No | Address that gets 5% of the swap fee on-chain; pass the same one to prepare_swap |