Skip to content

feat(action-providers): add The Graph provider (query subgraphs directly, pay-per-query over x402)#1358

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

feat(action-providers): add The Graph provider (query subgraphs directly, pay-per-query over x402)#1358
PaulieB14 wants to merge 1 commit into
coinbase:mainfrom
PaulieB14:add-thegraph-action-provider

Conversation

@PaulieB14

Copy link
Copy Markdown

Description

Adds a thegraph action provider that lets an agent query The Graph directly and pay per query over x402 from its own wallet — no API key, no signup. Three actions:

  • search_subgraphs — find the best subgraph(s) for a plain-English topic
  • get_subgraph_schema — list a subgraph's queryable entities + args
  • query_subgraph — run a GraphQL query against a subgraph

Query prices are variable, so each paid action probes the gateway's 402 price, enforces a per-query maxPaymentUsdc cap, and only then signs and pays. Base-only; reuses the same x402 signing stack as the built-in x402 provider, so no new dependencies. Discovery + query-construction logic is ported from PayQL (Apache-2.0).

This complements #1357 (the managed graphadvocate provider) as the self-serve tier: graphadvocate = pay an agent that does the routing/querying for you (no setup); thegraph = query The Graph gateway directly and pay your own way (cheaper, more control). Fits WISHLIST → "Trading & Data".

Tests

  • Unit tests: supportsNetwork, the EVM-wallet guard (rejects non-EVM before any network call), and the ported toFulltext + parseHits logic.
  • tsc --noEmit clean; 5/5 tests pass locally in a matched (pnpm/lockfile) env.
  • Live example-chatbot run against a funded wallet not yet done; happy to add prompt/output samples before merge.

Checklist

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

🤖 Generated with Claude Code

…tly, pay-per-query over x402)

Adds a `thegraph` action provider that lets an agent query The Graph directly
and pay per query over x402 from its own wallet: search_subgraphs,
get_subgraph_schema, query_subgraph. Query prices are variable, so each action
probes the 402 price and enforces a per-query maxPaymentUsdc cap before signing.
Base-only; reuses AgentKit's existing x402 signing stack (no new deps).
Discovery + query construction ported from PayQL (Apache-2.0). Includes README,
unit tests, and a changeset. Complements the managed `graphadvocate` provider
with a direct/self-serve tier.
@PaulieB14 PaulieB14 requested a review from murrlincoln as a code owner July 3, 2026 19:13
@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 0
Sum 1

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Jul 3, 2026
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