pre_trade_check
chainpeek: Check a Uniswap V3 swap at up to five sizes: price impact and candle gap. For one quote use get_swap_quote. Returns results: a Uniswap V3 swap quoted at each of up to five sizes, smallest first: amount out, effective price, price impact against the smallest size, the best fee tier and pool, gas estimate; plus a reference with the latest 5-minute candle close (WETH/USDC, cbBTC/USDC on Base) and its gap to the smallest size's price. A size that cannot be quoted is an error row; none quotable is a 422 or 503 (not charged). Impact is against the smallest size, not the market. Single pool, exact input; not a firm price. Bad input is a 422 (not charged). Typically 1-3 s. Price: USD 0.005. Free: 10 chain reads per IP per UTC day. Docs: https://tanod.dev/learn/uniswap-quote-api.html
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": {
"chain": "<chain>",
"token_in": "<token_in>",
"token_out": "<token_out>",
"sizes": "<sizes>"
},
"name": "pre_trade_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | Chain to quote on (Uniswap V3): ethereum or base. | |
| sizes | Yes | 1 to 5 amounts of token_in as positive decimal strings in token_in units, e.g. ["1", "10", "100"]. Distinct; answered smallest first. | |
| token_in | Yes | Token sold (0x + 40 hex). | |
| fee_tiers | No | Uniswap V3 fee tiers to consider (100, 500, 3000, 10000). Default: all four. | |
| token_out | Yes | Token bought (0x + 40 hex). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex | No | ||
| note | No | ||
| block | No | ||
| chain | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| results | No | ||
| token_in | No | ||
| reference | No | ||
| token_out | No | ||
| disclaimer | No |