Chain Pre Trade Check
by Tanod chainpeek in Onchain & crypto
chainpeek (Tanod) Uniswap V3 swap quoted at up to five sizes: price impact per size, best fee tier and pool, and the gap to the latest DEX candle close, on Ethereum or Base. Use when an agent is about to swap and needs the price impact at several sizes before choosing one.
POST https://tanod.dev/v1/chain/pre-trade-check
Last 30 days
Status and outage history · Atom feed
- Uptime
- 100%
- Response time
- 392 ms typical, 392 ms slowest 5%
- Last check
- 20 min ago
- Next check
- in 10 min
How to call it
POST https://tanod.dev/v1/chain/pre-trade-check
Each call costs $0.005 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
POST https://tanod.dev/v1/chain/pre-trade-check
content-type: application/json
{
"chain": "base",
"sizes": [
"1",
"10",
"100"
],
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chain | string | Yes | Chain to quote on (Uniswap V3): ethereum or base. One of: ethereum, base. |
fee_tiers | array of integer or null | No | Uniswap V3 fee tiers to consider (100, 500, 3000, 10000). Default: all four. Default: null. |
sizes | array of string | 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 | string | Yes | Token sold (0x + 40 hex). |
token_out | string | Yes | Token bought (0x + 40 hex). |
Example response
The provider's example. We can't check it without paying.
Example response, 39 lines
{
"block": 123,
"chain": "base",
"dex": "uniswap_v3",
"disclaimer": "On-chain spot quote from Uniswap V3 QuoterV2 at the latest…",
"note": "One Uniswap V3 QuoterV2 spot quote per size at the latest b…",
"reference": {
"as_of": "2026-10-08T11:31:57Z",
"available": true,
"candle_close": 2562.440508,
"candle_start": 1791459000,
"executable_price": 2560.1,
"interval": "5m",
"last_candle_partial": true,
"pair": "WETH/USDC"
},
"results": [
{
"amount_in": "1",
"amount_in_raw": "1000000000000000000",
"amount_out": "2560.1",
"amount_out_raw": "2560100000",
"effective_price": "2560.1",
"fee_tier": 500,
"gas_estimate": "90000",
"pool": "0xd0b53D9277642d899DF5C87A3966A349A798F224"
}
],
"token_in": {
"address": "0x4200000000000000000000000000000000000006",
"decimals": 18,
"symbol": "WETH"
},
"token_out": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"symbol": "USDC"
}
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.005.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://tanod.dev/v1/chain/pre-trade-check' \
-H 'content-type: application/json' \
--data-raw '{"chain":"base","sizes":["1","10","100"],"token_in":"0x4200000000000000000000000000000000000006","token_out":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://tanod.dev/v1/chain/pre-trade-check' \
-H 'content-type: application/json' \
--data-raw '{"chain":"base","sizes":["1","10","100"],"token_in":"0x4200000000000000000000000000000000000006","token_out":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.005 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.005" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.005 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Ftanod.dev%2Fv1%2Fchain%2Fpre-trade-check&method=POST
const res = await pay("https://tanod.dev/v1/chain/pre-trade-check", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"chain": "base",
"sizes": [
"1",
"10",
"100"
],
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}),
});
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.005 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.005"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.post(
"https://tanod.dev/v1/chain/pre-trade-check",
json={
"chain": "base",
"sizes": [
"1",
"10",
"100",
],
"token_in": "0x4200000000000000000000000000000000000006",
"token_out": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
},
)
print(res.status_code, res.text)Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 20 min ago | Passed | 402 | 392 ms | $0.005 |
| 10 h ago | Passed | 402 | 501 ms | $0.005 |