Skip to main content
Glama
dex-cex-spread

dex-cex-spread

by tordagaz-ops

Compare DEX and CEX price

compare_price
Read-only

Compare a token's DEX pool price against centralised exchange books in both directions, factoring taker fees and constant-product price impact, and find the trade size where impact erases the spread.

Instructions

One token, one size: the best pool price against every centralised book, both directions round (buy on the DEX and sell at the CEX bid, or the reverse), with the two taker fees and the constant-product price impact for that size charged before anything is called an opportunity. Also reports the size at which impact eats the whole edge, and the naive mid-to-mid spread side by side so the difference between the two numbers is visible.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "compare_price"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNoChain to look on, for example ethereum, solana, base, bsc, arbitrum. Guessed from the address shape when omitted.
queryNoTicker (PEPE) or contract address (0x… / a Solana mint).
venueNoRestrict the comparison to one centralised venue.
size_usdNoTrade size in dollars used for the price impact and the net edge.
cex_fee_bpsNoCentralised taker fee in basis points, per leg of the round trip.
dex_fee_bpsNoDEX fee in basis points. DexScreener does not publish the fee tier, so this is the caller's assumption and it is reported back.
min_depth_usdNoBelow this real pool depth a row is flagged thin: the spread is real but the pool cannot absorb a trade.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond readOnlyHint/openWorldHint, the description discloses the actual computation contract: both taker fees and constant-product price impact are charged before something is called an opportunity, and the breakeven size and naive mid-to-mid spread are reported alongside. That tells the agent the result is a net-of-cost figure and that a second, unadjusted number is present — meaningful context the annotations cannot supply.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single sentence, so it is front-loaded on the core comparison, but the wording is padded with editorialising — 'charged before anything is called an opportunity' and 'so the difference between the two numbers is visible' — where a shorter statement of the same contract would scan faster.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only, seven-parameter analysis tool with a full output schema and complete parameter documentation, the description covers the conceptual model (net edge vs naive spread, impact-adjusted) well. It needn't explain return values, and the remaining omissions (chain guessing, thin-depth flagging) are already carried by the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already explains chain, venue, size_usd, and both fee parameters. The description reinforces that fees are per leg and that impact is computed for the stated size, but adds no syntax or interpretation beyond what the structured fields give; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific comparison: a single token at a single size, best DEX pool price against every centralised book, in both directions. That is concrete enough for an agent to know what it returns, though it never names a sibling (scan_spreads, pool_liquidity) to sharpen the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied — the phrasing 'one token, one size' suggests a targeted arbitrage check at a specific notional rather than a broad scan, but the description never says when to prefer this over scan_spreads or combine it with pool_liquidity, and offers no exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.