Skip to content

feat(action-providers): add Graph Advocate provider (trader intel + agent reputation over x402)#1357

Open
PaulieB14 wants to merge 1 commit into
coinbase:mainfrom
PaulieB14:add-graph-advocate-action-provider
Open

feat(action-providers): add Graph Advocate provider (trader intel + agent reputation over x402)#1357
PaulieB14 wants to merge 1 commit into
coinbase:mainfrom
PaulieB14:add-graph-advocate-action-provider

Conversation

@PaulieB14

Copy link
Copy Markdown

Description

Adds a graphadvocate action provider giving agents paid access to Graph Advocate's onchain-intelligence endpoints. Three actions:

  • get_hyperliquid_trader_score — Hyperliquid perps trading skill score (~$0.02 USDC)
  • get_polymarket_trader_score — Polymarket trading skill score (~$0.01 USDC)
  • get_agent_reputation — ERC-8004 identity + USDC-settlement reputation score (~$0.02 USDC)

Each action POSTs to graphadvocate.com and auto-pays the small USDC fee on Base through the agent's own wallet, using the same x402 signing stack as the built-in x402 provider (x402Client + wrapFetchWithPayment + registerExactEvmScheme). No new dependencies.

  • Base mainnet only (that's where the x402 payments settle).
  • A per-call spend cap (maxPaymentUsdc, default 1.0 / env-overridable) refuses any action priced above the cap before anything is signed.
  • Complements the existing erc8004 (identity) and x402 (payments) providers by adding a reputation / skill-scoring layer. Fits WISHLIST → "Trading & Data".

Tests

  • Unit tests in graphAdvocateActionProvider.test.ts cover supportsNetwork, the payment-cap guard (refuses before signing), and the EVM-wallet-only guard.
  • tsc --noEmit passes clean for the new provider against current types.
  • I have not yet run it through an example chatbot against a funded wallet (needs live USDC on Base). I'm happy to add example-chatbot prompt/output samples before merge — I can point graph-advocate's own funded Base wallet at it if that's preferred.

Checklist

  • Added documentation to all relevant README.md files (graphadvocate/README.md)
  • Added a changelog entry (.changeset/graph-advocate-action-provider.md)

🤖 Generated with Claude Code

@PaulieB14
PaulieB14 requested a review from murrlincoln as a code owner July 3, 2026 15:30
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Jul 3, 2026
…gent reputation over x402)

Adds a `graphadvocate` action provider with three paid actions
(get_hyperliquid_trader_score, get_polymarket_trader_score,
get_agent_reputation) that auto-pay a small USDC fee on Base through the
agent's own wallet, reusing AgentKit's existing x402 signing stack
(x402Client + wrapFetchWithPayment + registerExactEvmScheme) — no new
dependencies. Base-only, with a per-call maxPaymentUsdc cap enforced
before signing. Includes README, unit tests, and a changeset.
@PaulieB14

Copy link
Copy Markdown
Author

@murrlincoln — following up on this one. CI is green and it's conflict-free; I've completed the funded-wallet run the checklist called for (run from graph-advocate's own Base wallet, as offered in the description).

Each of the three actions was exercised against its live endpoint with a real x402 USDC payment on Base, using AgentKit's own exact-EVM x402 stack (x402Client + ExactEvmScheme + wrapFetchWithPayment — the same one this provider reuses). All three settled on-chain and returned the documented schema (settlement txs verifiable on BaseScan):

1. get_hyperliquid_trader_scorePOST /hyperliquid/score · $0.02

  • settle tx 0x22f91df5a187e848c26e76f194a374717c9b475267fb4517ec295aae7acf7f63
  • {"skill_score":51.1,"classification":"neutral","realized_pnl_usdc":28367824.35,"sample_size_trades":30291135, ...}

2. get_polymarket_trader_scorePOST /polymarket/pnl-quick · $0.01

  • settle tx 0xe85ef728209acca641d851974a9b300ba611c5baa7a5c59c74e1ecbe3f761279
  • {"skill_score":100.0,"classification":"sharp","total_pnl_usdc":32275.36,"sample_size_trades":4879, ...}

3. get_agent_reputationPOST /agent/score · $0.02

  • settle tx 0x38ba7aefa4a6cb950fe3bfc781d17148c87a41125bfc7f9de82ace7b98332f99
  • {"score":55,"tier":"registered_or_settling","verdict":"ERC-8004 registered (agent #41034), metadata valid ...","cache_hit":false}
  • Note: this action runs an on-chain settlement scan (~15–20s cold, cached 24h after); the other two are sub-second. Worth keeping in mind for the provider's fetch timeout.

Each X-PAYMENT was signed + retried automatically and the endpoint served real data only after settlement — i.e. the full pay-per-call loop the provider wraps. Happy to add an example-chatbot transcript in whatever format you prefer, or to adjust naming/frontmatter to fit conventions. Thanks for taking a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

2 participants