Uniswap V3 spot quote

$0.002 per call · USDC via x402 · POST /api/dex-quote

Spot quote for swapping through a Uniswap V3 pool at the current tick. amountIn is in human units (not wei). zeroForOne=true sends token0 → token1; false sends token1 → token0. Send POST /api/dex-quote with the required fields poolAddress, amountIn and zeroForOne and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with network, poolAddress, amountIn, zeroForOne, fee and 3 more.

Returns amountOut net of the pool's fee tier. NOTE: this is a single-tick spot quote - slippage from depleting concentrated liquidity is NOT modeled. Use for indicative pricing; for production swaps quote against the Uniswap SDK.

Category: Crypto & onchain data · Tags: crypto uniswap dex v3 quote swap evm

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
poolAddressstringyes0x-prefixed Uniswap V3 pool address.
amountInnumberyesInput amount in human units (e.g. 1 WETH, not 1e18 wei).
zeroForOnebooleanyestrue: send token0 → receive token1. false: send token1 → receive token0.
networkstringnoethereum / base / polygon / arbitrum / optimism (default base).

Example request

curl -i -X POST https://agent402.tools/api/dex-quote \
  -H "Content-Type: application/json" \
  -d '{"poolAddress":"0xd0b53d9277642d899df5c87a3966a349a798f224","amountIn":1,"zeroForOne":true,"network":"base"}'

Without payment this returns HTTP 402 Payment Required with the exact price for dex-quote; any x402 v2 or MPP client pays it and retries.

Example response

{
  "network": "base",
  "poolAddress": "0xd0b53d9277642d899df5c87a3966a349a798f224",
  "amountIn": 1,
  "zeroForOne": true,
  "fee": 500,
  "spotPrice_1per0": 3500.05,
  "amountOut": 3498.3,
  "note": "spot quote at current tick - no multi-tick swap simulation"
}
FieldTypeAlways presentIn the example
networkstringyesbase
poolAddressstringyes0xd0b53d9277642d899df5c87a3966a349a798f224
amountInnumberyes1
zeroForOnebooleanyestrue
feenumberyes500
spotPrice_1per0numberyes3500.05
amountOutnumberyes3498.3
notestringyesspot quote at current tick - no multi-tick swap simulation

From an MCP client

catalog.call {
  "slug": "dex-quote",
  "params": {
    "poolAddress": "0xd0b53d9277642d899df5c87a3966a349a798f224",
    "amountIn": 1,
    "zeroForOne": true,
    "network": "base"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for dex-quote; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/dex-quote", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "poolAddress": "0xd0b53d9277642d899df5c87a3966a349a798f224",
    "amountIn": 1,
    "zeroForOne": true,
    "network": "base"
  }),
});

Related tools

Resolve Uniswap V3 pool address

$0.001 · POST /api/dex-pair

Look up the Uniswap V3 pool address for a token pair + fee tier on Ethereum, Base, Polygon, Arbitrum, or Optimism. Pass …

Read Uniswap V3 pool state

$0.002 · POST /api/dex-pool

Read on-chain state of a Uniswap V3 pool: token0/token1 addresses + decimals, fee tier, current sqrtPriceX96, tick, in-r…

DEX volume by protocol

$0.001 · POST /api/defi-dex-volume

Decentralized exchanges ranked by 24h spot trading volume from DefiLlama's free DEX overview: per-DEX 24h/7d/30d/1y/all-…

Solana swap quote (Jupiter)

$0.003 · POST /api/sol-swap-quote

Executable swap quote on Solana from Jupiter's aggregator: input and output mint, amount in base units, slippage in bps …

Known-address label lookup

FREE w/ compute · or $0.002 · POST /api/address-label

Label a known EVM address from a curated, committed dataset: major stablecoin + token contracts (the USDC and USDG contr…

Wallet token transfers (filtered)

$0.003 · POST /api/asset-transfers

Recent token transfers for a wallet on Base, Ethereum and other EVM chains, newest first. Filtered transfer log for an E…