Skip to main content
Glama

arb.spread_matrix

Read-only

Use this tool before executing a cross-venue arbitrage trade to check whether a global reference price (Coinbase spot, CoinGecko fallback - not a specific exchange orderbook) and a DEX pool price diverge enough to be worth trading after an assumed flat gas cost. Returns gross/net spread percentages and an is_profitable boolean - note net_spread_pct does NOT subtract the DEX pool's own swap fee (see pool_fee_pct), CEX trading fees, or slippage, so a spread that clears the threshold before those costs may not clear it after. Do not use for DEX-only liquidity depth checks or contract security. Paid in USDC on Base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesTicker symbol, e.g. SUI, BTC, ETH.
networkNoGeckoTerminal network id, e.g. base, eth. Defaults to base.
pool_addressNoSpecific DEX pool contract address (optional if token_address is given).
token_addressNoToken contract address - the most liquid pool is auto-selected (optional if pool_address is given).
trade_size_usdNoHypothetical trade size in USD. Defaults to 1000.
min_spread_threshold_pctNoNet spread threshold (%) above which is_profitable is true. Defaults to 0.8.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noticeNo
symbolYes
networkYes
directionNo
data_sourceYes
generated_atYes
pool_addressNo
pool_fee_pctNoDEX pool's fee tier (e.g. 0.05 for 0.05%), parsed from the pool name. Informational only - net_spread_pct does not subtract it.
cex_price_usdNo
dex_price_usdNo
is_profitableYes
net_spread_pctNo
status_messageYes
trade_size_usdYes
gross_spread_pctNo
assumed_gas_cost_usdYes
min_spread_threshold_pctYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / pool_fee_pct
      Added value: +{
      +  "description": "DEX pool's fee tier (e.g. 0.05 for 0.05%), parsed from the pool name. Informational only - net_spread_pct does not subtract it.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already mark this read-only, and the description adds substantial behavioral context: reference price source, assumed flat gas cost, and a clear warning that net_spread_pct excludes DEX swap fees, CEX fees, and slippage. It also discloses payment in USDC on Base, which is beyond what annotations provide.

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

Conciseness5/5

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

Four sentences carry the use case, key outputs, critical caveat, exclusions, and payment details. The critical profitability caveat is placed prominently, and every sentence earns its place.

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

Completeness5/5

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

The description is complete for a read-only screening tool: it covers inputs, outputs, cost assumptions, fee exclusions, and payment, while the output schema removes the need to describe return values in prose.

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 baseline of 3 applies. The description clarifies the overall model but does not add new meaning to individual parameters beyond the schema's own descriptions.

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

Purpose5/5

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

The description states a specific purpose: checking whether global reference vs DEX pool price divergence is enough after gas costs, before executing a cross-venue arbitrage trade. It names the exact outputs (gross/net spread percentages, is_profitable) and distinguishes itself from DEX-only depth/contract checks.

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

Usage Guidelines5/5

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

It explicitly says when to use ('before executing a cross-venue arbitrage trade') and when not to use ('DEX-only liquidity depth checks or contract security'). The caveat about fees gives practical guidance on interpreting results correctly before acting.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources