Uniswap V4 Swap Quote logo

Catalog action EVM Onchain

Get a live Uniswap V4 swap quote and its fill-vs-spot price impact for a token pair and size, without executing or moving funds. Use it to check whether a buy/swap is feasible before building it.

At a Glance

FieldValue
Action IDv4-swap-quote
CategoryEVM Onchain
ConnectorNot required
Requires gasNo
Funds movementNone declared
Tagsblockchain, evm, dex, swap, defi, quote, read

Payload Schema

FieldTypeRequiredDescription
tokenInstringYesInput token address to sell. Use 0x0000000000000000000000000000000000000000 for native ETH.
tokenOutstringYesOutput token address to receive. Use 0x0000000000000000000000000000000000000000 for native ETH.
amountInstringYesExact input amount to price, in the token's smallest unit (wei).
chainIdnumberYesChain to quote on. V4 swaps are single-chain only.
maxHopsnumberNoMaximum number of pool hops the auto-router may use. Default: 2. Capped at 2 for v1.

Result Schema

FieldTypeRequiredDescription
amountOutstringYesQuoted output amount for the exact input, in the output token's smallest unit (wei). NOT slippage-adjusted.
priceImpactBpsnumberYesFill-vs-spot price impact of the best route, in basis points (1000 = 10%). 0 when the quote meets or beats the pool's spot price.
routearrayYesThe best route: 1 entry for a direct swap, 2 entries for a hub-token hop.

Examples

json
{ "type": "v4-swap-quote", "payload": { "tokenIn": "0x0000000000000000000000000000000000000000", "tokenOut": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amountIn": "300000000000000", "chainId": 8453 }, "children": []}

Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.