Skip to main content
Glama

arb.spread_matrix

Check whether CEX and DEX prices diverge enough to cover gas costs, returning net spread and profitability for cross-venue arbitrage trades.

Instructions

CEX-DEX arbitrage spread calculator: checks whether a global reference
price (Coinbase spot, CoinGecko fallback - NOT a specific exchange
orderbook, despite internal naming) and a DEX pool price (GeckoTerminal)
diverge enough to be worth trading after an assumed flat gas cost. Returns
gross/net spread, direction, and is_profitable.

Use this before executing a cross-venue arbitrage trade, or for kimchi-style
premium checks on non-Korean venues (use market.kimchi_alert instead for the
Upbit-specific case). Does NOT account for CEX deposit/withdrawal
availability, trading fees, or slippage beyond trade_size_usd - always
re-verify with live quotes before executing. Requires exactly one of
pool_address or token_address; passing neither raises "invalid_input".

Args:
    symbol: Ticker symbol, e.g. "SUI", "BTC", "ETH".
    network: GeckoTerminal network id (default "base").
    trade_size_usd: Hypothetical trade size in USD (default 1000.0).
    min_spread_threshold_pct: Net spread threshold (%) above which
        is_profitable is true (default 0.8).
    pool_address: A specific DEX pool contract address.
    token_address: Token contract address (auto-picks the most liquid pool).
        One of pool_address or token_address is required.

Returns:
    On success: {"success": true, "gross_spread_pct", "net_spread_pct",
        "direction", "is_profitable", ...}
    On failure: {"success": false, "error": {"type", "message"}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
networkNobase
pool_addressNo
token_addressNo
trade_size_usdNo
min_spread_threshold_pctNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv1.0.3

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses the reference price source, the fact that it is not an exchange orderbook, the flat gas cost assumption, the exclusion of trading fees and slippage, and the exact error condition when neither pool_address nor token_address is provided. This is well beyond a basic summary.

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

Conciseness4/5

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

The description is well-organized with clear sections for behavior, usage, limitations, args, and returns. It is longer than average, but the complexity and lack of annotations justify the length. There is slight redundancy, such as the pool_address/token_address requirement stated both in the prose and in the args section, so it is not perfectly tight.

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?

For a tool with 6 parameters, no output schema, and no annotations, the description is remarkably complete. It explains input semantics, default behavior, error behavior, return shape, limitations, and sibling alternatives. An agent has enough context to decide whether to invoke it and how to interpret results correctly.

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

Parameters5/5

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

Schema coverage is 0%, but the description fully documents every parameter: symbol, network, trade_size_usd, min_spread_threshold_pct, pool_address, and token_address. It also explains the mutually exclusive requirement for pool_address/token_address and the token_address auto-picking behavior, which adds real meaning beyond the raw schema.

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 verb and resource: 'CEX-DEX arbitrage spread calculator'. It clearly explains what the tool computes, what price sources are used, and what outputs are returned. It also distinguishes itself from market.kimchi_alert by explicitly scoping the non-Upbit use case.

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?

Usage guidance is explicit: use before cross-venue arbitrage or for non-Korean kimchi premium checks, and use market.kimchi_alert for the Upbit-specific case. It also warns about limitations like fees, slippage, and the need to re-verify with live quotes, giving clear when-to-use and when-not-to-use context.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/parkyucheol-del/alphapipeline'

If you have feedback or need assistance with the MCP directory API, please join our Discord server