chainpeek: price a Uniswap V3 swap at up to five sizes: price impact, best fee tier and pool, gap to the candle
pre_trade_checkCheck a Uniswap V3 swap at up to five trade sizes before trading: view amount out, effective price, price impact versus smallest size, fee tier, pool, gas estimate, and candle gap.
Instructions
chainpeek: Check a Uniswap V3 swap at up to five sizes: price impact and candle gap. For one quote use get_swap_quote. Returns a Uniswap V3 swap quoted at each of up to five sizes, smallest first: amount_out, effective_price, price_impact_pct 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 reference_gap_pct 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
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 |