Uniswap Swap Quote logo

Catalog action EVM Onchain

Get a live Uniswap swap quote across V2/V3/V4 pools for a token pair and size, without executing or moving funds. Routes through the same hosted Uniswap Trading API as uniswap-swap, so a plan-time quote and the runtime swap can never disagree on whether a route exists. Use it to check whether a buy/swap is feasible before building it.

At a Glance

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

Payload Schema

FieldTypeRequiredDescription
tokenInstringYesInput token address to price. Use 0x0000000000000000000000000000000000000000 for native ETH.
tokenOutstringYesOutput token address to price. Use 0x0000000000000000000000000000000000000000 for native ETH.
amountInstringYesExact input amount to price, in the token's smallest unit (wei).
chainIdnumberYesChain to quote on. Uniswap Trading API routing is single-chain only.

Result Schema

FieldTypeRequiredDescription
amountOutstringYesQuoted output amount for the exact input, in the output token's smallest unit (wei). "0" when noRoute is true.
routearrayYesRoute steps the Trading API's best quote used — passed through as-is from the API response, since its shape varies by routing engine and pool version (v2/v3/v4). Empty when noRoute is true.
routingstringYesRouting engine the Trading API used for the best quote (e.g. "CLASSIC"). "NONE" when noRoute is true.
noRoutebooleanYesTrue when the Trading API found no route for this pair/size on any pool version. Read this instead of treating a caught error as the block signal — matches how the caddie feasibility gate consumes this action.
tokenOutSymbolstring | nullNoDisplay symbol of tokenOut — lets a consumer render the quoted amount without a second lookup. Null when the metadata lookup fails, or when noRoute is true.
tokenOutDecimalsnumber | nullNoDecimals of tokenOut, pairs with tokenOutSymbol. Null when the metadata lookup fails, or when noRoute is true.
priceImpactBpsnumber | nullNoFill-vs-spot price impact in basis points (positive = worse/loss), from the Trading API's percent priceImpact × 100. Null when noRoute is true, or when the quote omitted a numeric price impact. The caddie swap-feasibility gate reads this to classify the swap.

Examples

json
{ "type": "uniswap-swap-quote", "payload": { "tokenIn": "0x0000000000000000000000000000000000000000", "tokenOut": "0x6330D8C3178a418788dF01a47479c0ce7CCF450b", "amountIn": "300000000000000", "chainId": 4663 }, "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.