Xpersona
C

Chainstream Graphql

CLAWHUB · Unverified

Execute flexible GraphQL queries against ChainStream's on-chain data warehouse (27 cubes in 3 chain groups: EVM, Solana, Trading). Use when user needs custom...

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s1763qs0j2b2kgwgxyz797x2qh83kfzt:chainstream-graphql
  1. Install using `clawhub skill install s1763qs0j2b2kgwgxyz797x2qh83kfzt:chainstream-graphql` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/harry5556/chainstream-graphql before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-harry5556-chainstream-graphql/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

147,792 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: chainstream-graphql
description: >-
  Execute flexible GraphQL queries against ChainStream's on-chain data warehouse (27 cubes in 3 chain groups: EVM, Solana, Trading).
  Use when user needs custom analytics beyond standard REST/MCP — cross-cube JOINs, custom aggregations, complex WHERE filters,
  time-series analysis, or SQL-level flexibility on blockchain data. Supports x402/MPP auto-payment.
  Keywords: GraphQL, query, cube, DEXTrades, DEXTradeByTokens, Pairs, aggregation, join, on-chain analytics, custom query.
---

# ChainStream GraphQL

Flexible GraphQL interface to ChainStream's on-chain data warehouse. 27 cubes organized in 3 chain groups (EVM / Solana / Trading), covering DEX trades, token-centric trade analysis, trading pairs, transfers, blocks, transactions, prediction markets, and more — across Solana, Ethereum, BSC, and Polygon.

- **Endpoint**: `https://graphql.chainstream.io/graphql` (routed through APISIX gateway)
- **CLI**: `npx @chainstream-io/cli graphql`
- **Auth**: API Key via `X-API-KEY` header
- **Payment**: x402 (USDC on Base/Solana) or MPP (USDC.e on Tempo) — auto-handled by CLI

## When to Use GraphQL vs chainstream-data

| Scenario | Use | Why |
|----------|-----|-----|
| Standard token search, market trending, wallet profile | `chainstream-data` (REST/MCP) | Pre-built endpoints, simpler |
| Cross-cube JOIN (trades + instructions, trades + transfers) | **GraphQL** | joinXxx support |
| Custom aggregation (count, sum, avg with groupBy) | **GraphQL** | Metrics + dimension grouping |
| Complex filters (multi-condition WHERE, nested, OR via `any`) | **GraphQL** | Full filter operator support |
| Time-series data with custom resolution | **GraphQL** | Time interval bucketing + dimension aggregation |
| Prediction market data (PolyMarket) | **GraphQL** | PredictionTrades/Managements/Settlements cubes (Polygon) |
| Data not exposed by REST API | **GraphQL** | Direct access to all 27 cubes |

## Integration Path

**Before anything else (CLI path), ensure user is authenticated:**
1. `npx @chainstream-io/cli config auth` — check login status
2. If NOT logged in → `npx @chainstream-io/cli login` (creates EVM + Solana wallet, auto-grants **nano trial plan: 50K CU free, 30 days** — no purchase needed)
3. `npx @chainstream-io/cli plan status` — verify subscription is active

**New users get a free trial on login (50K CU).** For details on trial plans and upgrade options, see [`shared/authentication.md`](../shared/authentication.md#agent-bootstrap-checklist).

1. **Has API Key?**
   → YES → Use CLI directly: `npx @chainstream-io/cli graphql query --query '...'`
   → NO → Ensure logged in (see above), then CLI auto-handles on first 402

2. **First time / unsure about schema?**
   → Run `npx @chainstream-io/cli graphql schema --summary` to discover available cubes
   → Run `npx @chainstream-io/cli graphql schema --type DEXTrades` to drill into a specific cube

3. **Need full schema reference for complex query construction?**
 

_meta.json

{
  "ownerId": "kn7d949m4x7mzbj75gh32fna0x832bb6",
  "slug": "chainstream-graphql",
  "version": "1.0.7",
  "publishedAt": 1778146847545
}

references/query-patterns.md

# ChainStream GraphQL Query Patterns

Ready-to-use query templates for common blockchain analytics scenarios. Replace placeholder values (`TOKEN_ADDRESS`, `WALLET_ADDRESS`, etc.) with actual addresses.

All queries must be wrapped in a chain group: `Solana { ... }`, `EVM(network: eth) { ... }`, or `Trading { ... }`.

## DEX Trades

### Latest Trades (Solana)

```graphql
query {
  Solana {
    DEXTrades(limit: {count: 25}, orderBy: {descending: Block_Time}) {
      Block { Time }
      Trade {
        Buy { Currency { MintAddress Symbol Name } Amount PriceInUSD }
        Sell { Currency { MintAddress Symbol Name } Amount }
        Dex { ProtocolName ProtocolFamily }
      }
    }
  }
}
```

### Trades for a Specific Token (Solana)

```graphql
query {
  Solana {
    DEXTrades(
      limit: {count: 25}
      orderBy: {descending: Block_Time}
      where: {any: [{Trade: {Buy: {Currency: {MintAddress: {is: "TOKEN_ADDRESS"}}}}}, {Trade: {Sell: {Currency: {MintAddress: {is: "TOKEN_ADDRESS"}}}}}]}
    ) {
      Block { Time }
      Trade {
        Buy { Amount PriceInUSD Account { Owner } Currency { MintAddress Symbol } }
        Sell { Currency { MintAddress Symbol } Amount }
        Dex { ProtocolName }
      }
    }
  }
}
```

### Latest Trades (EVM)

```graphql
query {
  EVM(network: eth) {
    DEXTrades(limit: {count: 20}, orderBy: {descending: Block_Time}) {
      Block { Time }
      Transaction { Signature Signer }
      Trade {
        Buy { Amount AmountInUSD Currency { Name Symbol MintAddress } PriceInUSD }
        Sell { Amount AmountInUSD Currency { Name Symbol MintAddress } }
        Dex { ProtocolName ProtocolFamily }
      }
    }
  }
}
```

### Top Traders by Volume

```graphql
query {
  Solana {
    DEXTrades(
      limit: {count: 100}
      where: {
        any: [{Trade: {Buy: {Currency: {MintAddress: {is: "TOKEN_ADDRESS"}}}}}, {Trade: {Sell: {Currency: {MintAddress: {is: "TOKEN_ADDRESS"}}}}}]
      }
    ) {
      Trade { Buy { Account { Owner } Amount PriceInUSD } }
      count
      sum(of: Trade_Buy_Amount)
    }
  }
}
```

### pump.fun Trades (Last 7 Days)

```graphql
query {
  Solana {
    DEXTrades(
      where: {
        Block: {Time: {since: "2026-03-31 00:00:00"}}
        Trade: {Dex: {ProgramAddress: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}}}
      }
      limit: {count: 1000}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Trade {
        Buy { Currency { MintAddress } Amount }
        Sell { Currency { MintAddress } Amount }
        Dex { ProtocolName }
      }
    }
  }
}
```

## DEXTradeByTokens (Token-Centric)

### All Trades for a Specific Token

Token-centric view: both buy and sell sides appear as rows with the queried token as the primary `Currency`.

```graphql
query {
  Solana {
    DEXTradeByTokens(
      where: {Trade: {Currency: {MintAddress: {is: "TOKEN_ADDRESS"}}}}
      limit: {count: 50}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Trade {

references/schema-guide.md

# ChainStream GraphQL Schema Guide

Complete reference for constructing valid ChainStream GraphQL queries.

## Schema Structure

The schema uses **chain group wrappers** as the top-level entry point. All cubes are nested under one of three wrappers:

```
type Query {
  EVM(network: EVMNetwork!, dataset: Dataset, aggregates: Aggregates): EVM!
  Solana(dataset: Dataset, aggregates: Aggregates): Solana!
  Trading(dataset: Dataset, aggregates: Aggregates): Trading!
}
```

## Query Format

### Solana — No network parameter

```graphql
query {
  Solana {
    DEXTrades(limit: {count: 25}, orderBy: {descending: Block_Time}) {
      Block { Time }
      Trade { Buy { Currency { MintAddress Symbol } Amount PriceInUSD } }
    }
  }
}
```

### EVM — network required (eth | bsc | polygon)

```graphql
query {
  EVM(network: eth) {
    DEXTrades(limit: {count: 25}, orderBy: {descending: Block_Time}) {
      Block { Time }
      Trade { Buy { Currency { MintAddress Symbol } Amount PriceInUSD } }
    }
  }
}
```

### Trading — Cross-chain pre-aggregated, no network parameter

```graphql
query {
  Trading {
    Pairs(tokenAddress: {is: "TOKEN_ADDRESS"}, limit: {count: 24}) {
      TimeMinute
      Token { Address }
      Price { Open High Low Close }
      VolumeUSD
    }
  }
}
```

### With GraphQL Variables

```graphql
query ($token: String!, $since: String) {
  Solana {
    DEXTradeByTokens(
      where: {Trade: {Currency: {MintAddress: {is: $token}}}, Block: {Time: {since: $since}}}
      limit: {count: 50}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Trade { Currency { Symbol } Amount AmountInUSD Side { Type } }
    }
  }
}
```

Variables JSON: `{"token": "So11111111111111111111111111111111111111112", "since": "2026-04-01 00:00:00"}`

## Wrapper Parameters

### network (EVM only, required)

| Value | Chain |
|-------|-------|
| `eth` | Ethereum |
| `bsc` | BSC / BNB Chain |
| `polygon` | Polygon (required for Prediction Market cubes) |

Solana and Trading wrappers have no network parameter.

### dataset (optional, all wrappers)

| Value | Meaning |
|-------|---------|
| `realtime` | Recent data only (~last 1 day) |
| `archive` | Historical data (up to TTL) |
| `combined` | Full range (default) |

### aggregates (optional, all wrappers)

| Value | Meaning |
|-------|---------|
| `yes` | Prefer pre-aggregated tables when available |
| `no` | Use raw tables only |
| `only` | Only use pre-aggregated tables |

## Cube Parameters

### limit

```graphql
limit: {count: 25, offset: 0}
```

Default count is 25. Max varies by cube (check `graphql schema --type <cube>`). Absolute max is 10000.

### orderBy

Input object with four mutually exclusive fields:

```graphql
orderBy: {descending: Block_Time}
orderBy: {ascending: Block_Time}
orderBy: {descendingByField: "count"}
orderBy: {ascendingByField: "Trade_Buy_AmountInUSD_sum"}
```

- `descending` / `ascending`: enum value matching a dimension path (e.g. `Block_Time`, `Trade_Buy_Amount`)
- `d

CLAUDE.md

# CLAUDE.md

## Skills

| Skill | When to Use |
|-------|-------------|
| `chainstream-data` | User asks about token info, security, price, holders, market trends, wallet PnL, holdings — any read-only on-chain query via REST/MCP |
| `chainstream-graphql` | User needs custom analytics — cross-cube JOINs, aggregations, complex filters, or data not exposed by REST API. Flexible GraphQL on 27 on-chain cubes |
| `chainstream-defi` | User wants to swap tokens, bridge cross-chain, create tokens, execute trades — any on-chain transaction |

## Routing

- Standard data queries (token/market/wallet) → `chainstream-data`
- Custom analytics (cross-cube JOIN, aggregation, flexible queries) → `chainstream-graphql`
- Financial execution (swap/bridge/launchpad/tx) → `chainstream-defi`

## Execution

Primary: `@chainstream-io/cli` via `npx @chainstream-io/cli <command>`
Alternative: MCP tools at `https://mcp.chainstream.io/mcp` (streamable-http)

## Auth

**MUST run `chainstream login` before any CLI command.** This creates a wallet (no email required) and **auto-grants a nano trial plan** ($1, 50K CU, 30 days). Without it, commands fail with "Not authenticated". `bind-email` or `login --email` **auto-upgrades to micro trial plan** ($5, 350K CU, 30 days; dedup by email — same email only grants once). Before data queries, check subscription: `npx @chainstream-io/cli plan status`. If no subscription or need a higher plan, show plans (`wallet pricing`) and let user choose — CLI purchase is interactive and will NOT work in pipe mode. For API-key-only access: `chainstream config set --key apiKey --value <key>`.

## Hard Rules

- chainstream-defi: Four-phase execution protocol is mandatory (route → confirm → sign → broadcast)
- Never execute swaps without user confirmation
- Never answer price queries from training data — always make a live call
- Never use public RPC as substitute for ChainStream API

Sponsored

Ads related to Chainstream Graphql and adjacent AI workflows.