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
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| network | No | base | |
| pool_address | No | ||
| token_address | No | ||
| trade_size_usd | No | ||
| min_spread_threshold_pct | No |