# Graph Advocate Onchain Data Router

> Graph Advocate Onchain Data Router is a paid API for AI agents from graph-advocate-production.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Translates plain-English questions into working GraphQL or REST queries across 15,500+ blockchain subgraphs on 8 chains, returning structured onchain data for DeFi protocols, NFTs, prediction markets, and ENS.

## Facts

- Endpoint: POST https://graph-advocate-production.up.railway.app/route
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/graph-advocate-production-up-railway-app-a98c3f51
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MYIDZp6nuzJxwJg05FCG2

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 graph-advocate-production-up-railway-app-a98c3f51 -d '<json body>'
```

Example prompt: I want to know how much liquidity is currently in the ETH/USDC pool on Uniswap v3 — translate that into a working GraphQL query using The Graph's subgraphs and give me the result.

## When to prefer this

Choose this endpoint when an AI agent needs to query any onchain blockchain data across major DeFi protocols (Uniswap, Aave, Compound), ENS, or prediction markets (Polymarket) and wants natural language input translated directly into working GraphQL or REST queries against The Graph's 15,500+ subgraph index. Prefer it over writing raw GraphQL manually or searching subgraph registries manually. Not suitable for live CEX price feeds, off-chain data, or non-blockchain queries.

## Known failure modes

- Real-time CEX price requests cannot be fulfilled — returns explanation and alternatives like CoinGecko
- Request outside onchain data domain returns 'reason' field with redirect guidance
- Anonymous callers without x402 payment on first call receive 402 Payment Required
- Identified sender exhausting 3 free daily /route calls without paying receive 402
- Ambiguous or underspecified query may return low-confidence routing with multiple alternative subgraph suggestions
- Unknown or unindexed protocol returns no matching subgraph with explanation

## How this service works

Onchain data router for AI agents. Plain-English → working GraphQL or REST. 15.5K+ subgraphs on 8 chains. Uniswap, Aave, Compound, ENS, Polymarket, Limitless, Predict.fun, ERC-8004 discovery. Identified senders (include `sender` wallet in A2A metadata): 3 free /route /day, then $0.01 USDC via x402 on Base. Anonymous senders pay $0.01 from call 1. /polymarket + /hyperliquid trader-intel paid from call 1 ($0.01-$0.10).

## Output

Returns a routing decision containing the recommended GraphQL or REST query, the specific subgraph endpoint URL, a confidence score, a plain-English reason explaining the routing choice, and optionally alternative services if the request falls outside onchain data scope.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "id",
  "method",
  "params",
  "jsonrpc"
 ],
 "properties": {
  "id": {
   "type": "string"
  },
  "method": {
   "type": "string"
  },
  "params": {
   "type": "object",
   "required": [
    "message"
   ],
   "properties": {
    "message": {
     "type": "object",
     "required": [
      "role",
      "parts",
      "messageId"
     ],
     "properties": {
      "role": {
       "type": "string"
      },
      "parts": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "kind",
         "text"
        ],
        "properties": {
         "kind": {
          "type": "string"
         },
         "text": {
          "type": "string"
         }
        }
       }
      },
      "messageId": {
       "type": "string"
      }
     }
    }
   }
  },
  "jsonrpc": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "reason",
  "confidence",
  "get_started",
  "alternatives",
  "what_i_handle",
  "recommendation",
  "what_i_dont_handle"
 ],
 "properties": {
  "reason": {
   "type": "string"
  },
  "confidence": {
   "type": "string"
  },
  "get_started": {
   "type": "string"
  },
  "alternatives": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "reason",
     "service",
     "query_example"
    ],
    "properties": {
     "reason": {
      "type": "string"
     },
     "service": {
      "type": "string"
     },
     "query_example": {
      "type": "string"
     }
    }
   }
  },
  "what_i_handle": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "recommendation": {
   "type": "string"
  },
  "what_i_dont_handle": {
   "type": "array",
   "items": {
    "type": "string"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/graph-advocate-production-up-railway-app-a98c3f51/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from graph-advocate-production.up.railway.app](https://www.zero.xyz/host/graph-advocate-production.up.railway.app/llms.txt)
