# AlphaPipeline CEX-DEX Arbitrage Spread Calculator

> AlphaPipeline CEX-DEX Arbitrage Spread Calculator is a paid API for AI agents from alphapipeline-eu.onrender.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-10).

Compares a global CEX reference price (Coinbase spot or CoinGecko fallback) against a DEX pool price to return gross/net spread, trade direction, and an is_profitable flag adjusted for estimated gas costs.

## Facts

- Endpoint: GET https://alphapipeline-eu.onrender.com/v1/arb/spread-matrix?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/alphapipeline-cex-dex-arbitrage-spread-calculator-1f54c659
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z7Hig2b4SfaeAs2sMTNDS

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability alphapipeline-cex-dex-arbitrage-spread-calculator-1f54c659
```

Example prompt: Check if there's a profitable arbitrage spread right now for ETH between Coinbase and the most liquid Base DEX pool — use a $5000 hypothetical trade size and flag it profitable only if the net spread exceeds 1%.

## When to prefer this

Use this endpoint when you need a quick, single-call CEX-DEX spread calculation for a specific token without building your own price aggregation pipeline. It is ideal for trading bots and agents that need an is_profitable signal with gas-adjusted net spread rather than raw price data alone. Prefer it over raw DEX data queries when you want a structured, flag-ready arb signal on Base network tokens. It is especially useful when Coinbase is the natural CEX reference and GeckoTerminal is the DEX data source.

## Known failure modes

- Symbol not found on Coinbase or CoinGecko — returns error with status_message indicating missing reference price
- No liquid DEX pool found for token on specified network — returns null pool data with descriptive status_message
- Invalid pool_address or token_address provided — API may return an error or empty result
- Network ID not recognized by GeckoTerminal — defaults to Base or returns an error
- Temporary upstream outage from Coinbase/CoinGecko/GeckoTerminal — may return stale or failed data with notice field populated
- Payment failure via x402/USDC — request blocked before reaching computation

## How this service works

CEX-DEX arbitrage spread calculator - compares a global reference price (Coinbase spot, CoinGecko fallback) against a DEX pool price and returns gross/net spread and an is_profitable flag after an assumed gas cost. Paid in USDC on Base.

## Output

Returns a JSON object containing: the token symbol and network, CEX reference price and DEX pool price, gross spread percentage, net spread percentage (after gas), is_profitable boolean, trade direction (buy CEX/sell DEX or vice versa), assumed gas cost in USD, pool address and fee percentage, data source used (Coinbase or CoinGecko), and UTC/KST timestamps.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "symbol"
     ],
     "properties": {
      "symbol": {
       "type": "string",
       "description": "Ticker symbol, e.g. SUI, BTC, ETH."
      },
      "network": {
       "type": "string",
       "description": "GeckoTerminal network id, e.g. base, eth. Defaults to base."
      },
      "pool_address": {
       "type": "string",
       "description": "Specific DEX pool contract address (optional if token_address is given)."
      },
      "token_address": {
       "type": "string",
       "description": "Token contract address - the most liquid pool is auto-selected (optional if pool_address is given)."
      },
      "trade_size_usd": {
       "type": "number",
       "description": "Hypothetical trade size in USD. Defaults to 1000."
      },
      "min_spread_threshold_pct": {
       "type": "number",
       "description": "Net spread threshold (%) above which is_profitable is true. Defaults to 0.8."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "title": "ArbSpreadResponse",
     "required": [
      "generated_at",
      "symbol",
      "network",
      "status_message",
      "is_profitable",
      "trade_size_usd",
      "assumed_gas_cost_usd",
      "min_spread_threshold_pct",
      "data_source"
     ],
     "properties": {
      "notice": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Notice",
       "default": null
      },
      "symbol": {
       "type": "string",
       "title": "Symbol"
      },
      "network": {
       "type": "string",
       "title": "Network"
      },
      "direction": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Direction",
       "default": null
      },
      "data_source": {
    
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/alphapipeline-cex-dex-arbitrage-spread-calculator-1f54c659/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from alphapipeline-eu.onrender.com](https://www.zero.xyz/host/alphapipeline-eu.onrender.com/llms.txt)
