# Agent card Source: https://docs.graphadvocate.com/agent-card A2A discovery metadata — machine-readable agent identity for other agents to call Graph Advocate. ## Well-known endpoint ``` GET /.well-known/agent-card.json ``` Returns the A2A protocol agent card: skills, endpoints, authentication, and capabilities — so other agents can discover and call Graph Advocate without a human in the loop. ```bash theme={null} curl https://graphadvocate.com/.well-known/agent-card.json ``` ## ERC-8004 Graph Advocate is registered on the ERC-8004 identity registry: | Field | Value | | - | - | | Agent ID | `#734` | | Chain | Arbitrum | | ENS | `graphadvocate.eth` | | A2A endpoint | `https://graphadvocate.com/` | | MCP endpoint | `https://graphadvocate.com/mcp` | | x402 support | Yes | | Registry lookup | [a2aregistry.org/agent/afd9b3bb-413c-41cf-9874-6361ea309e32](https://a2aregistry.org) | ## Discoverable on Graph Advocate is indexed across the agent-economy discovery layer: | Registry | Link | | - | - | | **Agentic Market** (Coinbase's browsable UI) | [agentic.market/services/graphadvocate-com](https://agentic.market/services/graphadvocate-com) | | **CDP x402 Bazaar** (merchant endpoint) | [discovery/merchant?payTo=...](https://api.cdp.coinbase.com/platform/v2/x402/discovery/merchant?payTo=0x0FF5A6ecef783BBA35463ec2F8403B9B5e9e7C86) | | **CDP x402 Bazaar** (semantic search) | [discovery/search?query=graph+advocate](https://api.cdp.coinbase.com/platform/v2/x402/discovery/search?query=graph+advocate) | | x402scan | [www.x402scan.com](https://www.x402scan.com) | | 8004scan (Base) | [agents/base/41034](https://www.8004scan.io/agents/base/41034) | | 8004scan (Arbitrum) | [agents/arbitrum/734](https://www.8004scan.io/agents/arbitrum/734) | | Ampersend | [agent/8453:41034](https://app.ampersend.ai/discover/agent/8453:41034) | | Agentverse | [agentverse.ai](https://agentverse.ai) | | ClawHub | [paulieb14/graph-advocate](https://clawhub.ai/paulieb14/graph-advocate) | CDP Bazaar listing was triggered by the first successful settle through the CDP facilitator — there's no separate registration step. See the [x402 Bazaar docs](https://docs.cdp.coinbase.com/x402/bazaar) for how indexing works. # Agent reputation score Source: https://docs.graphadvocate.com/agent-score Composite 0-100 reputation score for any Base wallet. Combines ERC-8004 identity, USDC settlement velocity, and on-chain feedback registry events into one auditable score with full signal breakdown. Buyer agents call this to decide whether to integrate with, pay, or trust a peer agent. `POST /agent/score` is the buyer-agent's "should I trust this peer" call. Hand it any Base wallet and get back a single 0-100 score plus a verdict and per-signal point breakdown. All three input axes are derived from immutable on-chain data — no listing operator can fake them. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /agent/score` | \$0.02 | `{ score, max_score, tier, verdict, awarded_points, signals, window_days, cache_hit }` | Per-call payment in USDC on Base via x402. **Cached 24h** per `(wallet, days)` — repeat queries on the same wallet are effectively free. ## Why this exists CDP Bazaar's `l30DaysTotalCalls` field is operator-reported and frequently inaccurate (we've seen 1,000+ "calls" on endpoints that return 404). 8004scan tells you who's registered but not whether they're being paid. This endpoint combines three ground-truth axes so a buyer agent gets one number instead of having to pull three sources and a verdict. ## The three signal axes (100 pts total) ### Identity (30 pts) — verifiable on-chain | Signal | Points | Source | | - | -: | - | | ERC-8004 registered on Base | 15 | Agent0 Base subgraph | | Registration age > 7 days | 5 | `createdAt` field | | IPFS metadata valid | 5 | `agentURI` resolves to valid JSON | | Declares x402 support | 5 | `x402Support: true` in metadata | ### Activity (40 pts) — USDC settlement velocity | Signal | Points | Source | | - | -: | - | | Received any USDC in window | 10 | Base USDC Transfer event scan | | ≥3 distinct senders | 10 | unique `from` addresses | | ≥10 distinct senders | 5 | unique `from` addresses | | Active in last 7 days | 10 | most recent Transfer timestamp | | Active in last 24 hours | 5 | most recent Transfer timestamp | ### Reputation (30 pts) — ERC-8004 feedback + validation registries | Signal | Points | Source | | - | -: | - | | At least 1 feedback event | 10 | Aggregated across all of owner's agents | | ≥3 distinct feedback clients | 10 | unique `clientAddress` count | | Positive avg feedback value | 5 | `value` field, non-revoked only | | At least 1 validation event | 5 | Aggregated across all agents | ## Hard 8004 gate **Without an ERC-8004 registration on Base, the score is 0 regardless of settlement activity.** This is what filters out burn addresses (the null address received \$494M USDC from 14k transactions in calibration but isn't an agent), the USDC contract itself, and CEX hot wallets. Settlement signals alone can't distinguish agents from sinks; registration is the only ground-truth that this wallet self-identifies as an addressable agent. ## Owner-level aggregation Operators often run multiple registered agents (test, staging, production). Reputation accrues on whichever one users actually hit. We query **all** agents owned by the wallet and aggregate feedback + validation events across the set — so an operator who registered 12 agents and got feedback on agent #51123 gets credit even if the latest agent #55656 has none of its own. ## Tiers | Score | Tier | Verdict shape | | - | - | - | | 80-100 | `active_verified` | Registered, paid, with feedback or validations | | 60-79 | `active` | Registered + paid in window | | 40-59 | `registered_or_settling` | Either side, partial signal | | 20-39 | `dormant_low_signal` | Registered but minimal activity | | 0-19 | `no_evidence` | No registration or no signals at all | ## Request body ```json theme={null} { "wallet": "0x575267eED09c338FAE5716A486A7B58A5749A292", "days": 90 } ``` `days` is the USDC settlement scan window (1-365, default 90). 30d misses sparse-traffic real adoption rhythms; 90d catches them. ## Response shape ```json theme={null} { "wallet": "0x575267eED09c338FAE5716A486A7B58A5749A292", "score": 65, "max_score": 100, "tier": "active", "verdict": "[active] ERC-8004 registered (75d old, agent #41034) — metadata valid — received $4.66 USDC from 2 distinct sender(s) in 90d (9 tx) — last paid call 2.6d ago — 1 feedback event(s) from 1 distinct client(s), avg value 85.0.", "awarded_points": { "erc8004_registered": 15, "erc8004_age_gt_7d": 5, "ipfs_metadata_valid": 5, "ipfs_declares_x402": 5, "received_any_30d": 10, "active_last_7d": 10, "any_feedback": 10, "positive_avg_feedback": 5 }, "signals": { "erc8004_registered": true, "erc8004_agent_id": "41034", "erc8004_agent_count_for_owner": 1, "erc8004_age_days": 75.2, "ipfs_metadata_valid": true, "ipfs_declares_x402": true, "feedback_count": 1, "distinct_feedback_clients": 1, "avg_feedback_value": 85.0, "validation_count": 0, "usdc_received_30d_usdc": 4.66, "distinct_senders_30d": 2, "tx_count_30d": 9, "last_received_age_sec": 225600 }, "window_days": 90, "cache_hit": false, "computed_at_ts": 1779000000 } ``` When the result is cached, `cache_hit: true` and a `cache_age_sec` field appears. ## Example calls ```bash theme={null} # Score Graph Advocate itself — known-good "active" example curl -X POST https://graphadvocate.com/agent/score \ -H "Content-Type: application/json" \ -d '{"wallet":"0x575267eED09c338FAE5716A486A7B58A5749A292"}' # Score a peer with a tighter scan window curl -X POST https://graphadvocate.com/agent/score \ -H "Content-Type: application/json" \ -d '{"wallet":"0xe69f9cc5e073b4a41d9e888a91159d0706161f18","days":30}' ``` Both require a `PAYMENT-SIGNATURE` header (x402 v2) or `X-PAYMENT` (v1) carrying a signed EIP-3009 authorization for \$0.02 USDC. Most x402 SDKs handle the sign + retry automatically — discover via `GET /.well-known/x402`. ## Use cases * **Pre-integration check.** Before subscribing to or paying a peer agent, get its reputation score in one call. * **Orchestrator tiebreaker.** When 3 agents claim the same capability, score them and pick the highest. * **Compliance audit.** Given a transaction recipient, is this a legitimate registered agent or a shell? * **Bazaar filtering.** Cross-reference CDP Bazaar listings against actual on-chain score; drop unverified entries. ## What the score does NOT cover This is an **on-chain activity + identity** score, not a quality-of-output score. The score won't tell you whether the agent reasons well, how often it succeeds at its declared tasks, or how it behaves under adversarial input. Those need active probing — a separate product class. Use this score as the first filter, then test the survivors directly. # Natural-language SQL over x402 settlements Source: https://docs.graphadvocate.com/ask Ask any question about Base x402 payment activity in plain English. DuckDB + Anthropic Sonnet runs the SQL against a 132M-row Cloudflare R2 parquet warehouse and returns the answer plus the SQL trace so your agent can verify the path. `POST /ask` is a paid natural-language query interface over the entire history of x402 settlements on Base. Your agent asks a question — top recipients, daily volume, facilitator share, a specific address's activity — and gets back a single answer plus the exact SQL that produced it. No subgraph schema to learn, no SQL to write, no hallucination to babysit. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /ask` | \$0.05 | `{ answer, sql_trace[], model, upstream_ms }` — natural-language answer plus every query that ran. | Per-call payment in USDC on Base via x402. ## Why derived over raw The same dataset is queryable directly via the x402 Base subgraph on The Graph Network, but at row-level only — you'd write GraphQL paginate, aggregate client-side, and reason about the numbers yourself. `/ask` collapses that loop into a single call: the agent describes the question, Sonnet writes the SQL, DuckDB runs it against the parquet warehouse, and the answer comes back with every SQL step in `sql_trace` so the caller can audit the data path before trusting the number. For agents that need a single derived signal ("did volume inflect last week?", "who's the largest recipient?") this is the cheapest end-to-end path. ## Request body ```json theme={null} { "question": "your question, up to 1000 characters" } ``` ## Response shape ```json theme={null} { "question": "...", "answer": "Daily settlement count rose from a weekly average of 1.2k in early May 2026 to a peak of 8.4k on 2026-05-22, a ~7x inflection...", "sql_trace": [ { "sql": "SELECT day, total_count, median_amount_usdc FROM daily_stats WHERE day >= '2025-05-01' ORDER BY day", "rows": 388, "ms": 412 } ], "model": "claude-sonnet-4-6", "upstream_ms": 2840, "dataset": "base-x402-settlements via x402-watch.vercel.app", "generated_at": "2026-06-04T18:23:11Z" } ``` The `sql_trace` array is the receipt — every query the model ran is recorded, so the agent can verify the answer was derived from a real read (not a hallucination) and which slice of the data was actually inspected. ## What the model can query Two virtual tables are exposed: | Table | Granularity | Use for | | - | - | - | | `settlements` | Row-level — one row per x402 payment, \~132M rows | Specific addresses, transaction lookups, fine-grained windows. | | `daily_stats` | One row per day, May 2025 → Jun 2026 (\~388 days) | Trends, time-series, volume curves. Fast — the model picks this first when the question is daily-grain. | The model is steered to choose `daily_stats` for trend questions (cheap) and `settlements` for row-level or address-specific questions (expensive but precise), and to add a `block_number` predicate for parquet file pruning when reading raw rows. ## Sample: ask in English ```bash theme={null} curl -X POST 'https://graphadvocate.com/ask' \ -H 'Content-Type: application/json' \ -d '{"question": "What were the top 10 x402 recipients by USDC volume in the last 30 days on Base?"}' ``` Returns a ranked answer plus the SQL that produced it. Use the answer to act; keep `sql_trace` for your audit log. ## Sample: trend question ```bash theme={null} curl -X POST 'https://graphadvocate.com/ask' \ -H 'Content-Type: application/json' \ -d '{"question": "When did daily x402 settlement count inflect upward between May 2025 and June 2026?"}' ``` The model will pick `daily_stats`, return the inflection point with a date, and show you the single aggregate query in `sql_trace`. ## Errors | Code | Meaning | Action | | - | - | - | | `400 invalid_question` | Body missing `question` field. | Send `{ "question": "..." }`. | | `400 question_too_long` | Over 1000 characters. | Tighten the question. | | `504 upstream_timeout` | DuckDB query exceeded 60s. | Retry; tighten the question; the response includes `retry_after_seconds`. | | `502 upstream_unavailable` | Backend error. | Retry after `retry_after_seconds`. | ## Free tier There is no free tier for `/ask`. To inspect routing without paying, send the plain-English question to `POST /` (A2A JSON-RPC) — Graph Advocate will name `/ask` as the right endpoint and hand back the exact paid curl, without charging. ```bash theme={null} curl -X POST 'https://graphadvocate.com/' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "message/send", "params": {"message": {"parts": [{"text": "top x402 recipients last 7 days"}]}} }' ``` # Live Bazaar Source: https://docs.graphadvocate.com/bazaar-active Which x402 services are *actually paid* and *actually verified* right now — joined from 4 live sources nobody else joins. ## The question nobody else answers CDP's Bazaar has 15k+ listings with no activity signal. The x402 Base subgraph has real-time settlements with no metadata. 8004scan has multi-chain agent identity. Join them and suddenly you can ask: **"Which agents are paid, working, and verified — right now?"** > [card] x402 Base subgraph > > Every on-chain USDC settlement on Base. [`Cb56epg3EvQ6JRpPfknbkM54QxpzTvLa7mwKNQQfUyoj`](https://thegraph.com/explorer/subgraphs/Cb56epg3EvQ6JRpPfknbkM54QxpzTvLa7mwKNQQfUyoj) > [card] agent0 8004 (Base) > > ERC-8004 registrations on Base. [`43s9hQRurMGjuYnC1r2ZwS6xSQktbFyXMPMqGKUFJojb`](https://thegraph.com/explorer/subgraphs/43s9hQRurMGjuYnC1r2ZwS6xSQktbFyXMPMqGKUFJojb) > [card] 8004scan fallback > > Multi-chain agents (Arbitrum, BSC, Celo) registered on ERC-8004. > [card] CDP x402 Bazaar > > Service metadata: descriptions, pricing, output schemas. ## Try it ```bash theme={null} curl "https://graphadvocate.com/bazaar/active?hours=24&limit=5" ``` ```json Sample theme={null} { "source": "x402-base + agent0-base 8004 + CDP Bazaar (triple join)", "window_hours": 24, "active_recipients_in_window": 51, "erc8004_verified_in_top": 1, "results": [ { "resource": "https://mpp.hyreagent.fun", "pay_to": "0xb5998e11e666fd1e7f3b8e8d9122a755eec1e9b7", "recent_payments": 58, "recent_volume_usdc": 0.365, "erc8004_agent": { "agent_id": "44453", "name": "Hyre Agent", "x402_support": true, "mcp_endpoint": "...", "a2a_endpoint": "..." } } ] } ``` ## Query parameters | Param | Default | Description | | - | - | - | | `hours` | `24` | Activity window, max 168 (one week) | | `limit` | `15` | Max results, capped at 50 | | `q` | — | Optional keyword filter (resource URL + description) | ## Ranking 1. **ERC-8004-verified agents first** — if you're registered, you surface above unknowns 2. **Highest payment count** in the window 3. **Highest USDC volume** 4. Deduped by `payTo` wallet so one marketplace doesn't crowd out everyone else ## Why this matters The CDP Bazaar tells you what *exists*. This endpoint tells you what *works*. For agents shopping for services, or for humans building the next agent marketplace, the gap between "listed" and "actually paid" is everything. > [!TIP] > > First request after cache expiry takes \~10s (warms the 8004scan multi-chain lookup). Subsequent requests return in under a second. # GET /bazaar/search Source: https://docs.graphadvocate.com/bazaar-search Keyword search over the full CDP x402 Bazaar (15,000+ paid services). ## Request ``` GET /bazaar/search?q=weather&max_price=0.01&network=base&limit=10 ``` | Param | Required | Notes | | - | - | - | | `q` | Yes | Keyword query (match over resource URL + description + output schema) | | `max_price` | No | Max price in USDC as float (e.g. `0.01`) | | `network` | No | CAIP-2 network filter (e.g. `base`, `eip155:8453`) | | `limit` | No | Default 10, max 25 | ## Response ```json theme={null} { "source": "CDP x402 Bazaar", "total_indexed": 15945, "query": "weather", "results": [ { "resource": "https://openweather-coral.vercel.app/weather/current", "price_usdc": 0.002, "network": "base", "pay_to": "0x...", "scheme": "exact", "description": "Current weather by lat/lon", "mime_type": "application/json", "match_score": 4 } ] } ``` Results are ranked by keyword match count across resource, description, and output schema fields. # GET /claw/scout Source: https://docs.graphadvocate.com/claw-scout Scans Claw Earn marketplace for tasks matching Graph Advocate's skills. ## Request ``` GET /claw/scout?refresh=1 ``` | Param | Default | Notes | | - | - | - | | `refresh` | `0` | Force-refresh the 60s cache | ## Response ```json theme={null} { "source": "Claw Earn (aiagentstore.ai)", "scanned_at": 1776732549, "total_open_tasks": 6, "matched_tasks": 0, "results": [], "note": "Tasks Graph Advocate could solve with subgraph routing + GraphQL generation." } ``` ## What it matches Tasks whose title / description / category / tags include any of: `subgraph`, `graphql`, `the graph`, `indexer`, `onchain data`, `token balance`, `wallet analysis`, `tvl`, `dex data`, `substreams`, etc. ## Read-only Scout never stakes, claims, or transacts. It's a discovery layer only — you decide whether to manually claim a matched task via Claw Earn's own UI. # Examples Source: https://docs.graphadvocate.com/examples Realistic Graph Advocate queries and the responses they produce. ## "Uniswap V3 pools on Base" ```bash theme={null} curl -X POST https://graphadvocate.com/ \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":"1","method":"message/send","params":{"message":{"messageId":"q","role":"user","parts":[{"kind":"text","text":"Uniswap V3 pools on Base"}]}}}' ``` Returns routing to the `UniV3-Base` subgraph (40.7M queries / 30d, 0.97 reliability), a ready-to-run GraphQL query over `pools`, factory stats, and the curl to execute it against the Graph gateway. ## "Wallet balance for vitalik.eth" Routes to `token-api` with tool `getV1EvmBalances` and pre-filled `network: mainnet`, `address: 0xd8dA6BF26964aF9D7eeD9e03E53415D37aA96045`. ## "Aave V3 liquidation risk" Routes to `graph-aave-mcp` (40 tools, cross-chain liquidation risk as a first-class capability), with a suggested tool call like `get_cross_chain_liquidation_risk`. ## "Polymarket open interest" Routes to `graph-polymarket-mcp` with `get_global_open_interest` or `get_market_open_interest` depending on scope. ## "Raw event logs for contract X" Routes to `substreams` with a hint about `.spkg` packages and real-time block data. ## Onchain data discovery ### "Find me an x402 service for sentiment analysis" Auto-triggers `_search_x402_bazaar` against the CDP discovery index. Returns top-N matching paid services with price, network, and payTo. ### "Which x402 services are active on Base right now?" Calls the triple-join view (x402 subgraph + 8004 + Bazaar) and returns the live activity-ranked list. # Hyperliquid trader intelligence Source: https://docs.graphadvocate.com/hyperliquid Skill-score any Hyperliquid perps trader, evaluate vaults, and screen top traders of a coin — all derived from on-chain ledger events via The Graph's Hyperliquid Token API. Five paid x402 endpoints that turn raw Hyperliquid fills, positions, and vault flows into agent-ready intelligence. Every score is derived — never returned by the upstream — so your agent can decide instead of parse. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /hyperliquid/score` | \$0.02 | Composite `skill_score` (0–100), classification (`sharp` / `neutral` / `retail`), liquidation rate, funding burn, profit factor, sample-size confidence | | `POST /hyperliquid/pnl` | \$0.05 | Everything `/score` returns + open positions + last 10 fills | | `POST /hyperliquid/screen` | \$0.05 | Top N traders of a coin, each one scored. Use for "who are the sharps on HYPE right now?" | | `POST /hyperliquid/vault` | \$0.10 | Vault evaluator: leader's own trading skill, top-depositor concentration, redemption pressure, distribution rate | | `POST /hyperliquid/risk` | \$0.02 | Counterparty risk: liquidation rate, funding burn, outflow flag — for agents about to take the other side of a trade | | `POST /hyperliquid/fills` | \$0.02 | Recent perp fill stream for a coin, with a bid/ask flow summary (N capped at 10) | Per-call payment in USDC on Base via x402. No subscription, no API key, no rate limit beyond the facilitator. ## Why derived over raw Raw Hyperliquid endpoints return fills, positions, and vault ledger events. Useful — but every consuming agent then has to re-implement the same normalisations: PnL as bps of volume, liquidation rate as fraction of fills, funding paid normalised to volume, confidence shrinkage for small samples. Graph Advocate does it once, exposes the answer. The scoring formula (see [`hyperliquid_intel.py`](https://github.com/PaulieB14/graph-advocate/blob/main/hyperliquid_intel.py) for source): * **40%** profitability — PnL as bps of volume, clamped at ±100 bps * **40%** risk control — liquidation rate, 1 bp loss per liquidation * **20%** efficiency — profit factor (PnL / fees), normalised * Confidence-weighted by `log10(transactions) / 6` — so a 50-trade wallet's score gets shrunk toward neutral `sharp` ≥ 70, `retail` ≤ 35, anything in between is `neutral`. Under 100 trades returns `insufficient_data` regardless of score. ## Sample: score a trader ```bash theme={null} curl -X POST 'https://graphadvocate.com/hyperliquid/score' \ -H 'Content-Type: application/json' \ -d '{"user": "0x2fc3195efbf91ad90854bc3c02fe739895c23460"}' ``` Response: ```json theme={null} { "user": "0x2fc3195efbf91ad90854bc3c02fe739895c23460", "skill_score": 78.4, "classification": "sharp", "sharpe_like": 0.0214, "pnl_bps_of_volume": 42.1, "liquidation_count": 1, "liquidation_rate_bps": 0.8, "funding_paid_per_volume_bps": 3.2, "profit_factor": 4.18, "sample_size_trades": 1247, "coins_traded": 14, "confidence": 0.52, "realized_pnl_usdc": 184230.55, "total_volume_usdc": 43712044.10, "total_fees_usdc": 44081.20, "first_trade": "2025-11-04T22:17:33Z", "last_trade": "2026-05-17T19:08:11Z" } ``` ## Sample: screen the sharps on a coin ```bash theme={null} curl -X POST 'https://graphadvocate.com/hyperliquid/screen' \ -H 'Content-Type: application/json' \ -d '{"coin": "HYPE", "n": 10}' ``` Returns ranked top-N traders by volume on that coin, each one scored against their full Hyperliquid history (not just this coin). The `sharp_count` / `retail_count` headline tells you whether smart money is currently the dominant side. ## Sample: vault evaluator ```bash theme={null} curl -X POST 'https://graphadvocate.com/hyperliquid/vault' \ -H 'Content-Type: application/json' \ -d '{"vault": "0xdfc24b077bc1425ad1dea75bcb6f8158e10df303"}' ``` Returns a composite `vault_score` plus the leader's individual skill score, top-5 depositors with stake share, redemption ratio, and a `last_activity_at` timestamp so you know whether the vault is still live or stale. ## Coin identifiers * Core perps: bare symbol — `BTC`, `ETH`, `HYPE`, `SOL` * Spot pairs: `@N` form — `@107` * Builder DEX markets: `dex:symbol` — `xyz:SP500`, `xyz:BRENTOIL`, `cash:TSLA` The same set the upstream Hyperliquid Token API uses. Call [`/v1/hyperliquid/markets`](https://thegraph.market) to enumerate live coins. ## Free tier There is no free tier for these endpoints — they each fan out 2–10 upstream calls and synthesise the result. If you want to inspect the routing for free, send a plain-English question to `POST /` (A2A JSON-RPC) and Graph Advocate will recommend the right `hyperliquid/*` endpoint without charging. ```bash theme={null} curl -X POST 'https://graphadvocate.com/' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "message/send", "params": {"message": {"parts": [{"text": "score Hyperliquid trader 0x2fc3...3460"}]}} }' ``` The recommendation comes back with the exact curl command to run for paid execution. # Graph Advocate Source: https://docs.graphadvocate.com/index Ask any blockchain data question in plain English. Get back the right subgraph, a ready-to-run GraphQL query, and — when possible — the live answer. Paid per call in USDC on Base via x402. > [!NOTE] > > **ERC-8004 #734** · `graphadvocate.eth` · Live on Base · Free 10/day then \$0.01 USDC ## What it is Graph Advocate is the **routing agent for onchain data**. One endpoint that speaks A2A JSON-RPC, MCP SSE, and x402 payments — so any agent, human, or LLM can ask a plain-English question and get the right subgraph + a ready-to-run query. > [card] Routes 15,500+ subgraphs > > Plain-English query → the right subgraph + a GraphQL query ready to fire at the Graph gateway. > [card] Pays per call, no API keys > > x402-native. Free 10/day, then \$0.01 USDC on Base. No sign-up, no billing page — your agent wallet IS the billing relationship. > [card] Triple-subgraph discovery > > Joins x402 Base subgraph + agent0 ERC-8004 + 8004scan + CDP Bazaar to surface services that are *actually paid* right now. > [card] A2A, MCP, ERC-8004 > > Speaks every agent standard. One endpoint, every client. ## See it work ```bash One free call theme={null} curl -X POST https://graph-advocate-production.up.railway.app/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc":"2.0","id":"1","method":"message/send", "params":{"message":{"messageId":"q","role":"user", "parts":[{"kind":"text","text":"Uniswap V3 pools on Base"}]}} }' ``` ```json Response (truncated) theme={null} { "recommendation": "subgraph-registry", "confidence": "high", "query_ready": { "tool": "execute_query_by_subgraph_id", "args": { "subgraph_id": "HMuAwufqZ1YCRmzL2SfHTVkzZovC9VL2UAKhjvRqKiR1", "gql": "{ pools(first: 10, orderBy: totalValueLockedUSD) { ... } }" } }, "execution_result": { "data": { "pools": [ ... ] } } } ``` ## Start here > [card] [Quickstart](/quickstart) > > 30 seconds from zero to a routing response. > [card] [Live Bazaar](/bazaar-active) > > Which x402 services are actually paid right now? > [card] [Agent card](/agent-card) > > A2A discovery metadata for agent-to-agent calls. # Kalshi derived signals Source: https://docs.graphadvocate.com/kalshi Three paid endpoints — consensus trend, cross-source spread, and live-sports edge. JOINs and derived scores passthrough APIs can't replicate, on top of Kalshi's fully public REST. Three x402 endpoints for **US-regulated prediction-market intelligence**. Kalshi's REST API is fully public — but the value here is in the *derivation*: slopes, cross-source JOINs, and momentum-vs-market signals an agent would otherwise have to compute itself. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /kalshi/consensus-trend` | \$0.05 | Slope-per-hour over 24h + 3d, acceleration signal, volatility band, days-to-resolve — derived from Kalshi's *unique* `forecast_history` | | `POST /kalshi-polymarket/spread` | \$0.05 | Cross-source spread between Kalshi and Polymarket on the same topic, with arbitrage direction. **JOIN that single-source passthrough APIs structurally can't return** | | `POST /kalshi/sports-live-edge` | \$0.05 | Play-by-play momentum vs market candle reaction → latency-arb signal for live Football / Basketball / Soccer / Hockey / Baseball / WNBA markets | Per-call payment in USDC on Base via x402. No subscription, no API key, no free tier. ## Why derived over raw Kalshi exposes \~50 public no-auth endpoints across 10,821 series (Entertainment 2,445 · Sports 2,172 · Politics 1,986 · Elections 1,404 · Economics 563 · Financials 516 · …). An agent can read them directly — but every consuming agent then re-implements the same math: * Fit a slope through `forecast_history` points to detect regime change * Match Kalshi events against Polymarket equivalents by keyword + price proximity * Compute momentum from play-by-play events and compare to market reaction lag Graph Advocate does it once, exposes the answer. The cross-source `/spread` endpoint in particular is the **defensible play**: passthrough APIs return one source at a time and can't JOIN — so the cross-venue arbitrage signal stays valuable even as more upstream sources come online. ## Sample: consensus trend for an event ```bash theme={null} curl -X POST 'https://graphadvocate.com/kalshi/consensus-trend' \ -H 'Content-Type: application/json' \ -d '{"event": "KXELONMARS-99"}' ``` Response (truncated): ```json theme={null} { "kalshi_event_ticker": "KXELONMARS-99", "event_title": "Will Elon Musk visit Mars in his lifetime?", "category": "World", "consensus_probability_now": 0.18, "slope_per_hour_24h": -0.0004, "slope_per_hour_3d": -0.0001, "acceleration_signal": -0.0003, "interpretation": "accelerating-down", "volatility_24h_stdev": 0.012, "days_to_resolve": 3287.4, "markets_in_event": 1, "history_points_analyzed": 142, "kalshi_source": "https://api.elections.kalshi.com/trade-api/v2/events/KXELONMARS-99/forecast_history", "agent_note": "Forecast history is Kalshi's published consensus probability over time. Use slope+acceleration to detect regime changes before they're priced in. Pair with /kalshi-polymarket/spread for cross-source arbitrage." } ``` **How to use it.** A positive `acceleration_signal` means the slope is *steepening upward* — the market is converging on YES faster than it was 3 days ago. Negative means the opposite. `interpretation` collapses the signal into one of `accelerating-up`, `accelerating-down`, `stable`, or `insufficient-history` so an agent can branch without parsing. ## Sample: cross-source spread ```bash theme={null} curl -X POST 'https://graphadvocate.com/kalshi-polymarket/spread' \ -H 'Content-Type: application/json' \ -d '{"topic": "fed rate", "limit": 5}' ``` Response: ```json theme={null} { "topic_keyword": "fed rate", "kalshi_candidates": 3, "polymarket_candidates": 2, "pairs": [ { "kalshi_ticker": "KXFED-25DEC-CUT25", "kalshi_yes_mid": 0.62, "polymarket_market_slug": "fed-rate-cut-december", "polymarket_yes_mid": 0.58, "spread_yes_kalshi_minus_poly": 0.04, "spread_bps": 400, "arbitrage_direction": "long-poly-short-kalshi" } ], "agent_note": "Spread > 200bps in either direction is a candidate arbitrage; verify the two markets actually resolve on the same condition before sizing. Cross-source data single-source APIs can't return in one call.", "sources": { "kalshi": "https://api.elections.kalshi.com/trade-api/v2", "polymarket": "token-api proxy" } } ``` **Important:** the pairing uses keyword overlap + price-proximity scoring. **You must verify the two markets actually resolve on the same on-chain condition before sizing** — otherwise the "arbitrage" is just basis risk. ## Sample: live sports edge ```bash theme={null} curl -X POST 'https://graphadvocate.com/kalshi/sports-live-edge' \ -H 'Content-Type: application/json' \ -d '{ "milestone": "", "market": "" }' ``` The `milestone` is Kalshi's identifier for a specific live game; `market` is an optional ticker for the market whose candlesticks you want compared against the play-by-play. Response includes `momentum_score_last_5_events`, `market_reaction_pct_last_hour`, and a `latency_arbitrage_signal` of one of `upside-lag-likely`, `downside-lag-likely`, `market-tracking-stats`, or `null` (insufficient data). **How to use it.** When `momentum_score` is strongly one-way (≥0.6 or ≤0.2) but `market_reaction_pct` is near zero, the market hasn't fully priced the play-by-play yet — latency-arb window. Verify orderbook depth before sizing — low liquidity will eat the edge. ## How it differs from `/polymarket/*` and `/hyperliquid/*` These three Kalshi endpoints are **derived signals** on top of a *fully public* upstream — different model than the polymarket/hyperliquid trader-intelligence endpoints which proxy through gated data sources. Kalshi's API is free for anyone to read; Graph Advocate's value here is in the math: * `/polymarket/risk` — wallet-type detection (binary signal from on-chain probe) * `/hyperliquid/risk` — liquidation rate + funding burn (derived from per-trade ledger) * `/kalshi/consensus-trend` — slope of Kalshi's *unique* forecast percentile history * `/kalshi-polymarket/spread` — JOIN that no single-source API can return * `/kalshi/sports-live-edge` — momentum-vs-market reaction lag If you want to inspect the routing for free, send a plain-English question to `POST /` (A2A JSON-RPC) and Graph Advocate will name the right `kalshi/*` endpoint and hand back the exact paid curl — without charging. ## Source [`kalshi.py`](https://github.com/PaulieB14/graph-advocate/blob/main/kalshi.py) — the three derivation functions and how they fetch from Kalshi's public REST and Polymarket data sources. # MCP packages Source: https://docs.graphadvocate.com/mcp-packages Six protocol-specific MCP servers Graph Advocate routes to. All free, all npx-installable, all reading The Graph directly — no Graph Advocate call required. Graph Advocate routes to **six protocol-specific MCP servers**. Every one is free, installs with `npx`, and reads The Graph directly with your own API key. You do not need to call Graph Advocate to use them — routing you *to* them is the point. > [!NOTE] > > These are alternatives, never the primary answer. Each is a thin wrapper around subgraphs and REST APIs an agent can call directly. The MCP packages the calls with friendly tool names and saves you writing the GraphQL — that is the whole value, and it is a real one. ## The packages | Package | Covers | Install | | - | - | - | | `graph-aave-mcp` | Aave V2/V3/V4 — 40+ tools, including cross-chain liquidation risk | `npx graph-aave-mcp` | | `graph-uniswap-mcp` | Uniswap V2/V3/V4 — 8 tools over 13 subgraphs, 6 chains | `npx -y graph-uniswap-mcp` | | `graph-polymarket-mcp` | Polymarket — 35 tools, live CLOB + on-chain analytics + CLOB V2 builder attribution | `npx graph-polymarket-mcp` | | `graph-lending-mcp` | Cross-protocol lending via Messari standardized subgraphs | `npx graph-lending-mcp` | | `graph-limitless-mcp` | Limitless prediction markets on Base | `npx graph-limitless-mcp` | Most need a free Graph API key from [thegraph.com/studio](https://thegraph.com/studio/) in `GRAPH_API_KEY`. > [!NOTE] > > **Retired packages.** `predictfun-mcp` (2026-08-05), `substreams-search-mcp` (2026-08-11) and > `create-substreams-sink-sql` (2026-08-17) were unpublished from npm — their `npx` commands 404. > Use the underlying surfaces instead: the [Predict.fun REST API](https://dev.predict.fun/) > (testnet `api-testnet.predict.fun/v1/markets` is keyless), the public Substreams registry > `GET substreams.dev/v1/registry/packages?query=`, and `substreams sink postgres|clickhouse` > from the Substreams CLI. ## Uniswap ```bash theme={null} GRAPH_API_KEY=your_key npx -y graph-uniswap-mcp ``` Eight tools across **13 subgraphs** — V2, V3 and V4 on Ethereum, Base, Arbitrum, Polygon, Optimism and BSC. Subgraph-ID addressed and schema-adaptive, so a subgraph version bump does not break it. Good for: *"Top Uniswap V3 pools on Base by volume"*, *"Compare WETH/USDC liquidity across V2, V3 and V4"*. For **derived** Uniswap answers — pre-trade liquidity checks, spot-vs-perp basis, per-wallet accumulation — see [Uniswap pre-trade & flow](/uniswap). Those are paid endpoints because they assemble something the raw subgraph does not contain. The basis JOIN in particular has no MCP equivalent: it spans two venues. ## Aave ```bash theme={null} GRAPH_API_KEY=your_key npx graph-aave-mcp ``` 40+ tools over Aave V2, V3 and V4, including cross-chain liquidation risk and V4 hub/spoke topology. Good for: *"Top Aave V3 markets by TVL on Ethereum"*, *"Recent Aave liquidations above \$50K"*. ## Polymarket ```bash theme={null} npx graph-polymarket-mcp ``` 35 tools spanning the Gamma and CLOB REST APIs and the Polymarket subgraphs — live prices, order books, trader P\&L, UMA resolution status. As of v2.1.1 it also covers **CLOB V2 builder attribution**, which answers "which frontend routed this flow" — a question no V1 contract emits the data for. ## Lending, Limitless, Predict.fun `graph-lending-mcp` compares protocols through Messari's standardized schema, so Aave and Compound become directly comparable. `graph-limitless-mcp` covers Limitless on Base. `predictfun-mcp` covers Predict.fun on BNB Chain and needs no key at all. ## Machine-readable Every package above is declared in Graph Advocate's capability catalog with its install command, auth requirement and example prompts: ```bash theme={null} curl -s https://graphadvocate.com/agents/capabilities.json \ | jq '.capabilities[] | select(.interface | test("MCP"))' ``` That endpoint is the source of truth — this page is generated from the same metadata. # Narrative vs on-chain flow Source: https://docs.graphadvocate.com/narrative One paid endpoint that JOINs social momentum with on-chain flow acceleration. Finds tokens loud on social but quiet on-chain — and the inverse, which a social feed structurally cannot see. One x402 endpoint for **narrative-versus-flow divergence**. Social feeds tell you what is being talked about. Subgraphs tell you what is being traded. Neither can tell you where those two disagree — that is the JOIN Graph Advocate assembles. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /narrative/divergence` | \$0.05 | Trending tokens ranked by the gap between social momentum and on-chain flow acceleration, with sentiment shift, resolved contract address, and every unresolvable symbol reported by reason | Per-call payment in USDC on Base via x402. No subscription, no API key, no free tier. ## The two readings **Overhyped** — high social rank, low flow rank. The talk is running ahead of the money. **Under the radar** — real on-chain flow with little social attention. This is the direction a purely social feed *structurally cannot produce*, because the signal is the absence of tweets. ## Why acceleration, not volume The on-chain half is deliberately **not** absolute volume. Ranking tokens by USD volume ranks them by size: LINK beats a small token every day of the week, and that says nothing about whether anything is happening. Instead each token's last 2 days of volume is compared against **its own prior 8-day baseline**. That parallels how social momentum is itself a velocity, and it means a $50k token accelerating 4× outranks a $500M token drifting sideways — which is the entire point. ## Sample request ```bash theme={null} curl -X POST 'https://graphadvocate.com/narrative/divergence' \ -H 'Content-Type: application/json' \ -d '{"chain": "ethereum", "limit": 10}' ``` Response (abridged): ```json theme={null} { "chain": "ethereum", "cohort_size": 12, "social_source": "cache", "sentiment_shift_source": "live", "ranked": [ { "symbol": "ICP", "token_address": "0x054b8f99d15cc5b35a42a926635977d62692f25b", "divergence": -90.9, "reading": "under_the_radar", "social_rank": 9.1, "flow_rank": 100.0, "flow_acceleration": 1.95, "sentiment_shift": { "shift": -1.04, "divergence_note": "sentiment souring while on-chain flow accelerates" }, "thin_sample": false } ], "unresolved": [ { "symbol": "XLM", "reason": "non_evm_asset", "coingecko_id": "stellar" } ], "unresolved_count": 12 } ``` ## What it refuses to guess Social feeds emit **ticker symbols**, not contract addresses, and tickers are actively squatted. Uniswap V3 on Ethereum carries five tokens called "Morpho Token" and roughly fifteen claiming `LINK`. Worse, some impostors are genuinely liquid: `DOGE` resolves on-chain to *"Department Of Government Efficiency"* with over 100,000 transactions, so no liquidity threshold can separate it from the real thing. Resolution therefore goes through CoinGecko's market-cap-ranked registry, which answers both questions authoritatively: which address is canonical, and whether an EVM contract exists at all. Dogecoin's Ethereum entry is correctly absent, so the memecoin is never substituted for it. Anything that cannot be resolved is returned in `unresolved` with a reason — never dropped: | `reason` | Meaning | | - | - | | `non_evm_asset` | The ticker's top claimant has no contract on this chain (SOL, XLM, ADA, DOGE) | | `below_activity_floor` | Best claimant is a ticker squatter, not the real token | | `canonical_token_not_in_subgraph` | The canonical address trades elsewhere, not on this Uniswap deployment | | `stale_day_data` | The token has effectively stopped trading — absent flow, not low flow | A caller comparing counts will always be able to reconcile them. A confident wrong answer is worse than a stated gap. ## Freshness `social_source` and `sentiment_shift_source` each report `live`, `cache` or `stale`. The social half is fetched on a timer and shared across callers; the on-chain half is queried live on every request, so flow is never stale even when sentiment is. ## Parameters | Field | Type | Default | Notes | | - | - | - | - | | `chain` | string | `ethereum` | Any chain with a Uniswap V3 subgraph — `ethereum`, `base`, `arbitrum`, `polygon`, `optimism`, `bsc` | | `limit` | int | 10 | Rows returned, capped at 25 | | `cohort` | int | 40 | How many trending tokens to rank within. Wider is more meaningful and costs nothing extra | Ranks are **relative to the fetched cohort**, not the whole market. ## Sources Social momentum and sentiment shift from [Cambrian](https://cambrian.org) deep42. On-chain flow from Uniswap V3 subgraphs via The Graph. Symbol resolution via CoinGecko. # On-chain x402 address lookup Source: https://docs.graphadvocate.com/onchain-address Read-only reputation lookup for any Base address against the decentralized x402 Base subgraph on The Graph Network. Returns the address's payer and recipient summaries, recent activity in both directions, facilitator metadata, and the indexed-through block for freshness audit — in a single call. `POST /onchain-x402/address` is the cheap reputation primitive: hand it any Base address and get back its full x402 footprint — total payments sent and received, USDC volume, recent activity in each direction, and (if the address is a facilitator) facilitator-level metadata. Pulled live from the decentralized x402 Base subgraph on The Graph Network, so the answer is verifiable, not vendor-derived. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /onchain-x402/address` | \$0.01 | `{ as_recipient, as_payer, facilitator, recent_received[10], recent_sent[10], is_in_index, indexed_through_block }` | Per-call payment in USDC on Base via x402. ## Why derived over raw You can read the same subgraph directly via the Graph gateway, but it would take three GraphQL queries plus a `_meta` call to assemble what this endpoint returns in one shot — and you still wouldn't get the `is_in_index` boolean or the freshness indicators baked in. For agents using x402 footprint as a counterparty signal ("has this address ever been paid for anything?", "is the wallet I'm about to interact with a known facilitator?") this collapses the lookup into a single decision-grade call. ## Request body ```json theme={null} { "address": "0x…" } ``` The address is normalized server-side; case-insensitive. ## Response shape ```json theme={null} { "address": "0xac5a07c4...", "as_recipient": { "address": "0xac5a07c4...", "role": "RECIPIENT", "totalPayments": "11", "totalVolume": "47000", "totalVolumeDecimal": "0.047", "firstPaymentTimestamp": "1745779200", "lastPaymentTimestamp": "1748371200", "isKnownEscrow": false, "escrowDeposits": "0" }, "as_payer": null, "facilitator": null, "recent_received": [ { "blockNumber": "46823100", "blockTimestamp": "1748371200", "transactionHash": "0x…", "from": "0x…", "amountDecimal": "0.005", "transferMethod": "EIP3009", "facilitator": { "id": "0x…", "name": "CDP" } } ], "recent_sent": [], "is_in_index": true, "indexed_through_block": "46849999", "indexed_through_timestamp": "1748478312", "indexer_has_errors": false, "source": "graph-network:x402-base", "subgraph_id": "Cb56epg3EvQ6JRpPfknbkM54QxpzTvLa7mwKNQQfUyoj", "generated_at": "2026-06-04T18:23:11Z" } ``` ### Decision-grade fields | Field | What an agent does with it | | - | - | | `is_in_index` | Boolean gate. `false` means this address has never sent or received an x402 payment — useful as an "unknown counterparty" flag. | | `as_recipient.totalPayments` | Throughput score. Weight rankings or surface "paid agent vs untested" tiers. | | `as_recipient.totalVolumeDecimal` | Trust signal. Higher cumulative USDC received → more economic skin. | | `facilitator` | If non-null, the address is a known x402 facilitator (CDP, etc.). Different treatment than a regular recipient. | | `indexed_through_block` | Freshness audit. If your decision needs recent activity, check this against current Base tip (gap = indexer lag). | | `indexer_has_errors` | Don't trust the row counts if true. | ## Sample: reputation gate ```bash theme={null} curl -X POST 'https://graphadvocate.com/onchain-x402/address' \ -H 'Content-Type: application/json' \ -d '{"address": "0xac5a07c4..."}' ``` Use the response to decide whether to engage. A typical agent rule: `as_recipient && as_recipient.totalPayments > 5` → "this address has been paid for things, treat as a real agent." ## Sample: facilitator detection ```bash theme={null} curl -X POST 'https://graphadvocate.com/onchain-x402/address' \ -H 'Content-Type: application/json' \ -d '{"address": "0x4053338C7cB38624C0bc23c900F78Cf8470b4E38"}' ``` If `facilitator` is non-null, the address routes settlements for other agents. Use this to skip rep-scoring (facilitators always pass) or to apply distinct trust rules. ## Errors | Code | Meaning | Action | | - | - | - | | `400 invalid_address` | Body missing or malformed `address`. | Send `{ "address": "0x…" }`. | | `503 service_unconfigured` | Server lacks `GRAPH_API_KEY`. | Operator issue, not caller. | | `504 upstream_timeout` | Graph gateway didn't respond in 20s. | Retry per `retry_after_seconds`. | | `502 upstream_unavailable` | Graph gateway returned an error. | Retry per `retry_after_seconds`. | ## Why on-chain over a centralized DB The data is the same as what powers `/ask`, but the read path is different. `/ask` reads a Cloudflare R2 parquet snapshot — cheap, fast, indexed by Graph Advocate. `/onchain-x402/address` reads the canonical Graph Network subgraph deployment `Cb56epg3EvQ6JRpPfknbkM54QxpzTvLa7mwKNQQfUyoj` directly. If your agent needs decentralization-grade verifiability for the answer (a counterparty check, an attestation, a reputation claim it will later defend), this is the right endpoint. If it just needs the number, `/ask` is cheaper for aggregate questions. ## Free tier There is no free tier for `/onchain-x402/address`. To inspect routing without paying, send the plain-English question to `POST /` (A2A JSON-RPC) and Graph Advocate will name this endpoint and hand back the exact paid curl, without charging. ```bash theme={null} curl -X POST 'https://graphadvocate.com/' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "message/send", "params": {"message": {"parts": [{"text": "what is the onchain x402 reputation of 0xac5a07c4..."}]}} }' ``` # Outbound outreach Source: https://docs.graphadvocate.com/outreach Let Graph Advocate pay-to-call other x402 agents on your behalf. ## POST /admin/outreach-pay Admin-only endpoint to send a paid A2A `message/send` to any x402-gated target. ```bash theme={null} curl -X POST https://graphadvocate.com/admin/outreach-pay \ -H "Authorization: Bearer $ADMIN_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "target_url": "https://clawdmint-api.vercel.app/a2a", "message": "Hello from Graph Advocate", "max_usdc": "0.01" }' ``` ## Request | Field | Required | Notes | | - | - | - | | `target_url` | Yes | Any x402 endpoint | | `message` | Yes | Text the target agent receives | | `max_usdc` | No | Spend cap (default $0.05, hard cap $1.00) | | `sender_agent_id` | No | Defaults to `42161:734` (GA's ERC-8004 id) | | `sender_name` | No | Defaults to `Graph Advocate` | ## Response ```json theme={null} { "ok": true, "status": 200, "wallet": "0x575267eED09c338FAE5716A486A7B58A5749A292", "body": { ...target's response... }, "settlement": "0x-payment-response-header-if-present" } ``` If the target's 402 pricing exceeds `max_usdc`, the payment is refused and the requirements are returned for inspection. ## Auth `ADMIN_TOKEN` is a private shared secret set as a Railway env var. Rotate immediately if leaked. ## Safety * Hard cap of \$1.00 USDC per call * Private key read from `GA_BASE_WALLET_PK` only; never logged * If the env var isn't set, the endpoint returns a structured error — the server never crashes # Polymarket trader intelligence Source: https://docs.graphadvocate.com/polymarket Skill-score any Polymarket wallet, screen a market's holders, and assess ghost-fill counterparty risk — derived from on-chain trade history via The Graph Token API and Pinax's Polymarket REST. Four paid x402 endpoints that turn raw Polymarket trade history into agent-ready intelligence. Every score is derived — your agent gets a decision, not a pile of fills to parse. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /polymarket/pnl-quick` | \$0.01 | Fast read — `skill_score`, classification, realized PnL, win rate. No lot reconstruction. | | `POST /polymarket/pnl` | \$0.05 | Full dossier — scores + per-market position records + open positions. | | `POST /polymarket/screen` | \$0.02 | Size the room — top holders of a market, each with skill score + ghost-fill risk. | | `POST /polymarket/risk` | \$0.02 | Ghost-fill counterparty risk — wallet-type detection for the wallet you're about to fill against. | | `POST /polymarket/leaders` | \$0.02 | Leaderboard with derived skill metrics per trader. | Per-call payment in USDC on Base via x402. No subscription, no API key, no rate limit beyond the facilitator. ## Why derived over raw Raw Polymarket data is now commoditised — Pinax's Token API, Polymarket's own CLI, and Polymarket's REST all hand you markets, prices, and positions for free. What none of them give you is a *judgement*: is this wallet sharp, and is it safe to fill against? Graph Advocate does that synthesis once. `pnl-quick` and `pnl` reconstruct realized/unrealized PnL, win rate, and a sample-size-weighted `skill_score` from the wallet's full trade history (see [`polymarket_intel.py`](https://github.com/PaulieB14/graph-advocate/blob/main/polymarket_intel.py) for the formula). A small sample is shrunk toward neutral so a 3-trade wallet can't fake a 100. ## Ghost-fill risk — the distinctive one Polymarket's newer API-user accounts are **smart-contract wallets** (ERC-1967 proxies that sign with `POLY_1271`, deployed by a known factory on Polygon), not plain EOAs. An order resting against one of those carries different settlement behaviour than one against an EOA — the source of "ghost fills." `POST /polymarket/risk` detects the wallet type and returns it directly: ```json theme={null} { "wallet": "0x…", "wallet_type": "new_api_user_smart_account", "ghost_fill_risk_score": 72, "risk_classification": "elevated" } ``` `wallet_type` is one of `eoa`, `new_api_user_smart_account`, or `other`. For an agent about to take the other side of an order, that one field is the highest-signal input it can get. ## Sample: quick skill read ```bash theme={null} curl -X POST 'https://graphadvocate.com/polymarket/pnl-quick' \ -H 'Content-Type: application/json' \ -d '{"wallet": "0x…"}' ``` Returns `skill_score` (0–100), classification, realized PnL in USDC, and win rate — for a tenth of a cent. Use it as a cheap pre-filter before paying for the full `pnl` dossier. ## Sample: size the room ```bash theme={null} curl -X POST 'https://graphadvocate.com/polymarket/screen' \ -H 'Content-Type: application/json' \ -d '{"market": ""}' ``` Returns the market's top holders, each carrying a `skill_score` and a `ghost_fill_risk` flag. Before you enter a market, this tells you whether the existing position is held by sharps or by retail — and which holders are risky to trade against. ## Identifiers * **Wallet** — a standard `0x…` address. For `pnl-quick`, `pnl`, and `risk`. * **Market** — a Polymarket `market_slug` or a `condition_id`. For `screen`. ## Free tier There is no free tier for these endpoints — each fans out multiple upstream calls and synthesises the result. To inspect the routing for free, send a plain-English question to `POST /` (A2A JSON-RPC) and Graph Advocate will name the right `polymarket/*` endpoint and hand back the exact paid curl — without charging. ```bash theme={null} curl -X POST 'https://graphadvocate.com/' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "message/send", "params": {"message": {"parts": [{"text": "screen Polymarket wallet 0x… skill"}]}} }' ``` # Prediction-market cross-venue spread Source: https://docs.graphadvocate.com/predmarket One paid endpoint that JOINs Polymarket and Limitless on a topic. Per-pair yes-mid spread, arbitrage direction, and the JOIN single-venue passthroughs structurally can't return. One x402 endpoint for **cross-venue prediction-market arbitrage**. Polymarket has its own public API. Limitless has its own. Neither can answer "where do these two markets disagree?" in a single call — that's the JOIN Graph Advocate assembles. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /predmarket/spread` | \$0.05 | Same-topic markets paired across Polymarket + Limitless, per-pair yes-mid spread (bps), arbitrage direction. **JOIN single-venue passthroughs structurally can't return** | Per-call payment in USDC on Base via x402. No subscription, no API key, no free tier. ## Why cross-venue over single-venue Polymarket's Gamma API is public and free. Limitless's REST search is public and free. A consuming agent could call both and diff in code — but every agent then re-implements the same matching: * Pull candidate markets from each venue by topic keyword * Normalize the yes-side price from each venue's response shape (Polymarket uses JSON-encoded `outcomePrices`, Limitless uses a `prices: [yes, no]` array) * Pair candidates by closest-price-match (titles rarely overlap word-for-word) * Compute spread in basis points and emit arbitrage direction Graph Advocate does it once. The cross-venue `/spread` endpoint is the **defensible play**: passthrough APIs return one venue at a time and can't JOIN. As more prediction-market venues come online, the JOIN gets *more* valuable, not less. ## Sample request ```bash theme={null} curl -X POST 'https://graphadvocate.com/predmarket/spread' \ -H 'Content-Type: application/json' \ -d '{"topic": "sol", "limit": 5}' ``` Response: ```json theme={null} { "topic_keyword": "sol", "status": "ok", "polymarket_candidates": 1, "limitless_candidates": 5, "limitless_binary_candidates": 4, "semantic_rejections": 3, "pairs": [ { "polymarket_slug": "will-the-price-of-solana-be-above-70-on-june-15", "polymarket_question": "Will the price of Solana be above $70 on June 15?", "polymarket_yes_mid": 0.265, "limitless_condition_id": "0x...", "limitless_slug": "sol-up-or-down-15-min", "limitless_title": "SOL Up or Down - 15 Min", "limitless_yes_mid": 0.59, "semantic_match_score": 0.111, "spread_yes_polymarket_minus_limitless": -0.325, "spread_bps": -3250, "arbitrage_direction": "long-limitless-short-polymarket" } ], "agent_note": "Pairs filtered by semantic content-word overlap + negation consistency, then ranked by absolute spread. semantic_match_score is Jaccard on content words (0-1). Verify same-condition resolution before sizing — Polymarket and Limitless markets on the same topic often have different time horizons." } ``` **How to use it.** `spread_bps` is the basis-point gap on the yes-side mid. `arbitrage_direction` collapses the signal into one of: * `long-polymarket-short-limitless` — Polymarket is more expensive; if the two markets resolve identically, sell Polymarket and buy Limitless. * `long-limitless-short-polymarket` — Limitless is more expensive; reverse. * `tight` — within ±200bps; no edge after fees. `semantic_match_score` is a 0-1 Jaccard score on shared content words between the two market titles (after stopword removal). Pairs below threshold (0.10) are rejected outright. **A higher score doesn't guarantee same-event resolution** — it only signals overlap by content words. Verify resolution dates + outcome definitions before sizing. The `status` field tells you which venues had candidates so you don't waste a call interpreting an empty `pairs[]`: | Status | Meaning | | - | - | | `ok` | One or more pairs survived semantic filter | | `no_semantic_match` | Both venues had binary markets but none pair up semantically — the topic overlaps by keyword but the markets are about different events | | `limitless_multi_outcome_only` | Polymarket has binary markets, Limitless only has NegRisk multi-outcome — binary spread is undefined | | `polymarket_only` | Limitless had no markets for this topic | | `limitless_only` | Polymarket had no markets for this topic | | `no_matches` | Neither venue matched; broaden the keyword | ## Honest coverage note Polymarket and Limitless cover **mostly disjoint market sets** today. Polymarket leans US politics, sports, current events, and long-horizon crypto price thresholds. Limitless leans short-horizon (5-15 min) up/down price markets and multi-outcome categorical markets. Practically, the topics where both venues have semantically-aligned binary markets are narrow — often just crypto majors (BTC, ETH, SOL) on similar time horizons. When the endpoint returns no pairs but shows nonzero candidates, that's the signal: **the topic exists on both venues but the actual markets aren't comparable**. That's still useful intelligence (one less venue to check) — it just isn't an arbitrage opportunity. **Verify before sizing:** even when a pair passes the semantic filter, time horizons can differ (e.g. Polymarket "will SOL be above \$70 by June 15" vs Limitless "SOL up/down in 15 min" — both involve SOL but are different bets). Always check resolution date + outcome definitions before treating spread as arbitrage. ## How it differs from `/kalshi-polymarket/spread` Same JOIN-shaped value-add, different venue pair: * `/predmarket/spread` — Polymarket ↔ **Limitless** (Base-native CTF prediction market, public REST search, no auth required) * `/kalshi-polymarket/spread` — Polymarket ↔ **Kalshi** (US-regulated, public REST) Topic coverage skews differently. Limitless leans crypto / AI / tech. Kalshi leans US politics / sports / economics. Polymarket overlaps everything. Pick the endpoint by the venue pair you actually want to arbitrage. ## Routing for free first If you want to inspect the routing for free, send a plain-English question to `POST /` (A2A JSON-RPC) and Graph Advocate will name the right `predmarket/*` endpoint and hand back the exact paid curl — without charging. ## Source [`limitless_intel.py`](https://github.com/PaulieB14/graph-advocate/blob/main/limitless_intel.py) — the cross-venue search + closest-price-match pairing logic and how it fetches from Polymarket's Gamma API and Limitless's REST search. # Quickstart Source: https://docs.graphadvocate.com/quickstart 30 seconds from zero to first routing response. ## 0. Just want to see it work? Open [`/chat`](https://graphadvocate.com/chat) in your browser and type any onchain question — e.g. *"Top Uniswap V3 pools on Base"* or *"Wallet balance for vitalik.eth"*. No setup, no wallet, no signup. Calling it from code? Read on. ## 1. Ask anything No auth, no keys, nothing to install. POST a plain-English question: ```bash curl theme={null} curl -X POST https://graphadvocate.com/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "q1", "method": "message/send", "params": { "message": { "messageId": "q1", "role": "user", "parts": [{"kind": "text", "text": "Wallet balance for vitalik.eth"}] } } }' ``` ```python python theme={null} import httpx, json r = httpx.post( "https://graphadvocate.com/", json={ "jsonrpc": "2.0", "id": "q1", "method": "message/send", "params": {"message": { "messageId": "q1", "role": "user", "parts": [{"kind": "text", "text": "Wallet balance for vitalik.eth"}], }}, }, ) print(json.dumps(r.json(), indent=2)) ``` ```typescript TypeScript theme={null} const res = await fetch("https://graphadvocate.com/", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ jsonrpc: "2.0", id: "q1", method: "message/send", params: { message: { messageId: "q1", role: "user", parts: [{ kind: "text", text: "Wallet balance for vitalik.eth" }], }}, }), }); console.log(await res.json()); ``` > [!NOTE] > > **Free tier:** 3 routing calls/day per *identified* sender. Identification means putting your wallet address (or other ID) in the A2A message metadata — e.g. `params.metadata.sender_id` or `params.message.metadata.from_agent_id`. **Anonymous senders (no identity in metadata) pay from call 1** — there is no IP-fallback free tier. > > Beyond the 3-free cap, `POST /route` returns HTTP 402 with x402 payment requirements; any x402-aware client signs a \$0.01 USDC `transferWithAuthorization` on Base and retries automatically. **No signup, no card, no API key — ever.** ## 2. Keep going once you hit the cap ```python x402 client theme={null} from x402 import x402Client from x402.mechanisms.evm import EthAccountSigner from x402.mechanisms.evm.exact.register import register_exact_evm_client from x402.http.clients import x402HttpxClient from eth_account import Account import os client = x402Client() register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"]))) async with x402HttpxClient(client) as http: r = await http.post( "https://graphadvocate.com/route", json={"request": "Uniswap V3 pools on Base"}, ) print(r.json()) ``` ```typescript fetch wrapper theme={null} import { x402Client, wrapFetchWithPayment } from "@x402/fetch"; import { registerExactEvmScheme } from "@x402/evm/exact/client"; import { privateKeyToAccount } from "viem/accounts"; const client = new x402Client(); registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`) }); const pay = wrapFetchWithPayment(fetch, client); const r = await pay("https://graphadvocate.com/route", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ request: "Uniswap V3 pools on Base" }), }); console.log(await r.json()); ``` ## 3. Use it from Claude Desktop (MCP) Add to `~/Library/Application Support/Claude/claude_desktop_config.json`: ```json theme={null} { "mcpServers": { "graph-advocate": { "url": "https://graphadvocate.com/mcp" } } } ``` Restart Claude Desktop. Ask "use graph-advocate to find me the right subgraph for X" and the routing happens inline. # POST /route Source: https://docs.graphadvocate.com/route POST https://graphadvocate.com/route Paid routing — pay $0.01 USDC and get an end-to-end answer. > [!NOTE] > > This endpoint is x402-gated. Free-tier users (10/day) should POST to `/` using A2A JSON-RPC — same routing logic, no payment required. ## What happens 1. **First call** returns `402 Payment Required` with x402 accepts list (\$0.01 USDC on Base) 2. **x402 client signs** a transferWithAuthorization and retries with a `PAYMENT-SIGNATURE` header (x402 v2) or `X-PAYMENT` (v1) 3. **CDP facilitator** verifies, settles on-chain, forwards to the handler 4. **Graph Advocate routes** the query, picks the best service, generates the GraphQL, and — when possible — **executes it and returns live data** You pay once. You get routing + execution. One call, one answer. ## Request body ```json theme={null} { "request": "your plain-English question" } ``` Also accepts A2A-format body with `params.message.parts[].text`. ## Response shape ```json theme={null} { "recommendation": "subgraph-registry | token-api | substreams | ...", "reason": "...", "confidence": "high | medium | low", "query_ready": { "tool": "execute_query_by_subgraph_id", "args": { "subgraph_id": "HMuAwufqZ1YCRmzL2SfHTVkzZovC9VL2UAKhjvRqKiR1", "gql": "{ pools(...) { ... } }" } }, "curl_example": "curl -X POST 'https://gateway.thegraph.com/api/...", "subgraph_details": { "name": "UniV3-Base", "query_volume_30d": 40771350, "..." }, "alternatives": [ { "service": "...", "reason": "..." } ], "execution_result": { "data": { "pools": [...] } } } ``` The killer field is `execution_result` — Graph Advocate didn't just tell you where to look, it ran the query for you. ### What to do with the response * **`gql`** is production-ready GraphQL — paste it as-is into your client or the Graph gateway, no edits needed. * **`subgraph_id`** is the deployment ID; combine with `https://gateway.thegraph.com/api/subgraphs/id/{subgraph_id}` to query directly. * **`curl_example`** is a complete working request you can run in a terminal — useful for sanity-checking before wiring up your client. * **`execution_result`** (when present) is already the answer; no follow-up call needed. If `execution_result` is missing, fire the `curl_example` against the Graph gateway with your own API key (free tier available). The `gql` is always live-tested before being returned. ## Pricing | Tier | Quota | Cost | | - | - | - | | Free | 10 queries / sender / day | \$0 (hit `POST /`, not `/route`) | | Paid | Unlimited | \$0.01 USDC on Base per call | | Priority | Same as paid | Higher-ranked response, full search context | ## Sample: paid call ```python Python theme={null} from x402 import x402Client from x402.mechanisms.evm import EthAccountSigner from x402.mechanisms.evm.exact.register import register_exact_evm_client from x402.http.clients import x402HttpxClient from eth_account import Account import os client = x402Client() register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"]))) async with x402HttpxClient(client) as http: r = await http.post( "https://graphadvocate.com/route", json={"request": "Top Aave V3 reserves by TVL on Base"}, ) print(r.json()) ``` ```typescript TypeScript theme={null} import { x402Client, wrapFetchWithPayment } from "@x402/fetch"; import { registerExactEvmScheme } from "@x402/evm/exact/client"; import { privateKeyToAccount } from "viem/accounts"; const client = new x402Client(); registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`) }); const pay = wrapFetchWithPayment(fetch, client); const r = await pay("https://graphadvocate.com/route", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ request: "Top Aave V3 reserves by TVL on Base" }), }); console.log(await r.json()); ``` # Uniswap pre-trade & flow Source: https://docs.graphadvocate.com/uniswap Three paid endpoints over Uniswap subgraphs: pre-trade liquidity checks, spot-vs-perp basis, and per-wallet accumulation. Plus graph-uniswap-mcp for direct tool access. Three x402 endpoints for **acting on Uniswap data**, not just reading it. Each answers a question a raw subgraph query leaves you to assemble yourself. ## What you get | Endpoint | Cost | Returns | | - | -: | - | | `POST /uniswap/pretrade` | \$0.02 | Real liquidity, deepest venue, honeypot-flow flags, volume trend — the checks worth running *before* sizing a trade | | `POST /uniswap/basis` | \$0.05 | Uniswap spot vs Hyperliquid perp basis. **Cross-venue JOIN** neither venue's API can return | | `POST /uniswap/traders` | \$0.02 | Per-wallet flow: who is accumulating, who is distributing | Per-call payment in USDC on Base via x402. ## Why not just query the subgraph You can, and for many questions you should — the subgraph is public and Graph Advocate will happily route you to it for free via `POST /route`. These endpoints exist for the questions where the raw data is the *input*, not the answer: * **Pre-trade** needs pool depth across fee tiers and versions, then a judgment about which venue is actually deepest for your size. The anti-TVL trap matters here: high TVL in a pool you cannot trade through is not liquidity. * **Basis** requires a second venue entirely. Uniswap's subgraph has no idea what the Hyperliquid perp is priced at. * **Traders** needs per-wallet swap aggregation and a directional call on each one. ## Sample request ```bash theme={null} curl -X POST 'https://graphadvocate.com/uniswap/pretrade' \ -H 'Content-Type: application/json' \ -d '{"token": "WETH", "chain": "ethereum"}' ``` ## Prefer an MCP server? `graph-uniswap-mcp` gives the same underlying data as tools in your agent, free, with your own Graph API key: ```bash theme={null} GRAPH_API_KEY=your_key npx -y graph-uniswap-mcp ``` Eight tools across **13 subgraphs** — Uniswap V2, V3 and V4 on Ethereum, Base, Arbitrum, Polygon, Optimism and BSC. Get a free key at [thegraph.com/studio](https://thegraph.com/studio/). The MCP is the right choice when you want to explore. The paid endpoints are the right choice when you want a derived answer — the basis JOIN in particular has no MCP equivalent, because it spans two venues. ## Chains `ethereum`, `base`, `arbitrum`, `polygon`, `optimism`, `bsc`. Version selection is automatic; pass `version` to pin one. # x402 payments Source: https://docs.graphadvocate.com/x402 Graph Advocate accepts and sends x402 payments on Base. ## Accepting payments Several routes are x402-gated by `PaymentMiddlewareASGI`: | Route | Price | Purpose | | - | - | - | | [`POST /route`](/route) | \$0.01 USDC | Paid routing query | | `POST /tip` | \$0.01 USDC | Voluntary tip jar | | [`POST /ask`](/ask) | \$0.05 USDC | NL→SQL Q\&A over the 132M-row x402 settlements parquet warehouse | | [`POST /onchain-x402/address`](/onchain-address) | \$0.01 USDC | On-chain x402 reputation lookup via the Graph Network subgraph | | [`POST /polymarket/pnl-quick`](/polymarket) | \$0.01 USDC | Fast Polymarket wallet skill read | | [`POST /polymarket/pnl`](/polymarket) | \$0.05 USDC | Full Polymarket wallet dossier | | [`POST /polymarket/screen`](/polymarket) | \$0.02 USDC | Size the room — top holders of a Polymarket market | | [`POST /polymarket/risk`](/polymarket) | \$0.02 USDC | Ghost-fill counterparty risk on Polymarket | | [`POST /hyperliquid/*`](/hyperliquid) | $0.01–$0.03 USDC | Hyperliquid trader intelligence (6 endpoints) | All settle via the **CDP facilitator** (`api.cdp.coinbase.com/platform/v2/x402`) on Base. Payments trigger CDP Bazaar indexing automatically on first success. ## Sending payments Graph Advocate can pay *other* x402-gated agents via the admin endpoint: ``` POST /admin/outreach-pay Authorization: Bearer { "target_url": "https://some-agent.example.com/endpoint", "message": "Hello from Graph Advocate", "max_usdc": "0.05" } ``` Uses `x402Client` + `EthAccountSigner` under the hood (`ExactEvmScheme` + `UptoEvmClientScheme` for both fixed and usage-based pricing). Signs in-memory, never logs the key. ## Wallets Two wallets, distinct roles: | Role | Address | Key location | | - | - | - | | **Identity / owner / outbound spender** | `0x575267eED09c338FAE5716A486A7B58A5749A292` (`graphadvocate.eth`) | `GA_BASE_WALLET_PK` on Railway. Owns ERC-8004 agent #41034 (Base) and #734 (Arbitrum). Signs outbound x402 calls from `x402_outreach.py`. Signs in-memory, never logged. | | **Incoming x402 payTo** | `0x0FF5A6ecef783BBA35463ec2F8403B9B5e9e7C86` | **Ampersend smart account** — no EOA private key, controlled via Ampersend. Default for `X402_PAY_TO`. | Earnings (Ampersend) are isolated from the identity/outreach key so a Railway compromise can't drain incoming revenue. The incoming wallet has no EOA key at all. > **Note on on-chain `agentWallet`:** the ERC-8004 Identity contract on Base currently records the *identity* wallet (`0x575267…`) as agent #41034's `agentWallet`, not the payTo. Indexers that join 8004 ↔ x402 by `agentWallet` will not attribute revenue correctly. The off-chain [erc8004-registration.json](../erc8004-registration.json) declares the Base payTo via a CAIP-10 `agentWallet` service entry. Updating the on-chain field requires Ampersend to produce an ERC-1271 signature for the new wallet. ## Bazaar discovery Both `POST /route` and `POST /tip` declare discovery metadata via `declare_discovery_extension(...)` so CDP's Bazaar indexes the endpoints with input/output schemas after the first successful payment.