pre_trade_check
chainpeek: Check a Uniswap V3 swap at up to five sizes: price impact and candle gap. For one quote use get_swap_quote. Returns a Uniswap V3 swap quoted at each of up to five sizes, smallest first: amount_out, effective_price, price_impact_pct against the smallest size, the best fee_tier and pool,...
This record as markdown: /tools/dev-tanod-tanod/pre-trade-check.md
What pre_trade_check does on Tanod
AI agents call pre_trade_check to retrieve information from Tanod without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
chain | string | Yes | Chain to quote on (Uniswap V3): ethereum or base. |
sizes | array | 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). |
fee_tiers | object | — | Uniswap V3 fee tiers to consider (100, 500, 3000, 10000). Default: all four. |
token_out | string | Yes | Token bought (0x + 40 hex). |
Parameters from the server's own tool schema.
Why pre_trade_check is rated Low
Even though pre_trade_check only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Attacks that exploit this kind of access
The rule that runs pre_trade_check safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Tanod, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For pre_trade_check, this is the rule to start with:
pre_trade_check is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Tanod, apply this rule, and every pre_trade_check call is checked against it from then on.
Questions about pre_trade_check
chainpeek: Check a Uniswap V3 swap at up to five sizes: price impact and candle gap. For one quote use get_swap_quote. Returns a Uniswap V3 swap quoted at each of up to five sizes, smallest first: amount_out, effective_price, price_impact_pct against the smallest size, the best fee_tier and pool, gas_estimate; plus a reference with the latest 5-minute candle close (WETH/USDC, cbBTC/USDC on Base) and reference_gap_pct to the smallest size's price. A size that cannot be quoted is an error row; none quotable is a 422 or 503 (not charged). Impact is against the smallest size, not the market. Single pool, exact input; not a firm price. Bad input is a 422 (not charged). Typically 1-3 s. Price: USD 0.005. Free: 10 chain reads per IP per UTC day. Docs: https://tanod.dev/learn/uniswap-quote-api.html. It is categorised as a Read tool in the Tanod MCP Server, which means it retrieves data without modifying state.
pre_trade_check accepts 5 parameters: chain, sizes, token_in, fee_tiers, token_out. Required: chain, sizes, token_in, token_out. The full parameter table on this page comes from the server's own tool schema.
Register the Tanod MCP server in PolicyLayer and add a rule for pre_trade_check: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Tanod. Nothing to install.
pre_trade_check is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the pre_trade_check rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for pre_trade_check. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
pre_trade_check is provided by the Tanod MCP server (https://tanod.dev/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Tanod, and thousands of servers like it.
This server
Across the catalogue