Overview
Thechainstream-graphql skill gives AI agents flexible SQL-like access to ChainStream’s on-chain data warehouse through GraphQL. It is the right tool whenever a pre-built REST/MCP endpoint is not expressive enough — cross-cube JOINs, custom aggregations, multi-condition filters, custom time-series resolution, or data only exposed via GraphQL (e.g. PolyMarket prediction cubes).
- Pattern: Tool (read-only, no signing)
- Endpoint:
https://graphql.chainstream.io/graphql(routed through APISIX) - CLI:
npx @chainstream-io/cli graphql - Auth: API Key via
X-API-KEY, or SIWX wallet token - Payment: Same API Key / subscription pool as REST (x402 / MPP auto-handled by CLI)
- Scope: 27 cubes across 3 chain groups —
Solana,EVM(network: eth | bsc | polygon),Trading
When to Use
Decision matrix vschainstream-data:
Integration Path
Channel Matrix
GraphQL is a single surface accessed from different callers:AI Workflows
Discover Schema
Always start here if the agent doesn’t already know which cube it needs.--summary returns a compact catalog of all 27 cubes grouped by chain (EVM / Solana / Trading), with top-level fields and descriptions. --type expands one cube’s field tree for query construction.
Construct and Run a Query
The schema uses chain group wrappers as the top-level entry point.- Solana
- EVM
- Trading
Query Construction Quick Reference
- Chain group wrapper: Top-level required.
Solana,EVM(network: ...), orTrading. network: Only onEVM. Values:eth,bsc,polygon.limit:{ count: N, offset: M }. Default 25.orderBy:{ descending: Field }/{ ascending: Field }. For computed fields use{ descendingByField: "field_name" }.where:{ Group: { Field: { operator: value } } }. OR conditions viaany: [{...}, {...}].- DateTime format:
"YYYY-MM-DD HH:MM:SS"— noT, noZ(ClickHouse requirement). - DateTime filters:
since,till,after,before— nevergt/lton DateTime fields. joinXxx: LEFT JOIN to related cubes. Prefer over multiple queries.datasetwrapper arg:realtime,archive,combined(default).aggregateswrapper arg:yes,no,only.
Chain Groups and Cubes
* Prediction cubes only available on
polygon network.
Safety Rules
Error Recovery
Related
chainstream-data
Standard REST/MCP queries for token, market and wallet analytics
chainstream-defi
Execute trades after analysis — swap, create token
GraphQL access method
Endpoint reference, auth, schema overview
CLI `graphql` subcommand
chainstream graphql schema and query reference
