Read Uniswap V3 pool state
POST /api/dex-poolRead on-chain state of a Uniswap V3 pool: token0/token1 addresses + decimals, fee tier, current sqrtPriceX96, tick, in-range liquidity, and the decoded human-readable spot price (token1 per token0). Send POST /api/dex-pool with the required field poolAddress and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with network, poolAddress, token0, token1, fee and 4 more.
One $0.002 call replaces ~6 RPC roundtrips on the caller's side.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
poolAddress | string | yes | 0x-prefixed Uniswap V3 pool contract address. |
network | string | no | ethereum / base / polygon / arbitrum / optimism (default base). |
Example request
curl -i -X POST https://agent402.tools/api/dex-pool \
-H "Content-Type: application/json" \
-d '{"poolAddress":"0xd0b53d9277642d899df5c87a3966a349a798f224","network":"base"}'
Without payment this returns HTTP 402 Payment Required with the exact price for dex-pool; any x402 v2 or MPP client pays it and retries.
Example response
{
"network": "base",
"poolAddress": "0xd0b53d9277642d899df5c87a3966a349a798f224",
"token0": {
"address": "0x4200000000000000000000000000000000000006",
"decimals": 18
},
"token1": {
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"decimals": 6
},
"fee": 500,
"sqrtPriceX96": "1456834567890123456789012345",
"tick": 196543,
"liquidity": "1234567890123456789",
"spotPrice_1per0": 3500.05
}
| Field | Type | Always present | In the example |
|---|---|---|---|
network | string | yes | base |
poolAddress | string | yes | 0xd0b53d9277642d899df5c87a3966a349a798f224 |
token0 | object | yes | 2 fields: address, decimals |
token1 | object | yes | 2 fields: address, decimals |
fee | number | yes | 500 |
sqrtPriceX96 | string | yes | 1456834567890123456789012345 |
tick | number | yes | 196543 |
liquidity | string | yes | 1234567890123456789 |
spotPrice_1per0 | number | yes | 3500.05 |
From an MCP client
catalog.call {
"slug": "dex-pool",
"params": {
"poolAddress": "0xd0b53d9277642d899df5c87a3966a349a798f224",
"network": "base"
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for dex-pool; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
poolAddressis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/dex-pool returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
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-pool", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"poolAddress": "0xd0b53d9277642d899df5c87a3966a349a798f224",
"network": "base"
}),
});
Related tools
Resolve Uniswap V3 pool address
POST /api/dex-pairLook up the Uniswap V3 pool address for a token pair + fee tier on Ethereum, Base, Polygon, Arbitrum, or Optimism. Pass …
Uniswap V3 spot quote
POST /api/dex-quoteSpot quote for swapping through a Uniswap V3 pool at the current tick. amountIn is in human units (not wei). zeroForOne=…
Chain info snapshot
GET /api/chain-infoOne-call chain state snapshot: chain id, latest block number, and current gas price (wei + gwei) for Ethereum, Base, Pol…
Token price by contract address
GET /api/coin-price-by-contractLive price, market cap, 24h volume and 24h change for ERC-20 / SPL / other chain tokens looked up by CONTRACT ADDRESS on…
DEX volume by protocol
POST /api/defi-dex-volumeDecentralized exchanges ranked by 24h spot trading volume from DefiLlama's free DEX overview: per-DEX 24h/7d/30d/1y/all-…
Known-address label lookup
POST /api/address-labelLabel a known EVM address from a curated, committed dataset: major stablecoin + token contracts (the USDC and USDG contr…