Skip to main content

Chart Integration

The chart command is a G_core alias that routes to different data providers based on the chart type and --protocol flag. This page explains how routing works and how each provider's chart data differs.


Chart Routing Logic

The chart alias uses a two-step decision:

  1. Is this a built-in chart? Built-in charts are non-token analytics panels (performance, network, portfolio). These never route to a provider.
  2. Which provider? For token charts, route based on the --protocol flag or active context.

Built-in Charts (No Provider)

These charts are always available and source their data from the analytics pipeline:

chart performance    # App-level performance metrics
chart network # Network graph visualization
chart network-graph # Same as above
chart portfolio # Wallet portfolio analytics
chart balances # Token balance history

Built-in charts: wbtc, eth (special built-in DEX chart panels), performance, network, network-graph, portfolio, balances.

Token Charts (Provider-Routed)

Any other symbol routes to a protocol-specific chart command:

chart BTC --protocol coinpaprika    # → coinpaprika:cchart BTC
chart WBTC --protocol 1inch # → 1inch chart (DEX price data)
chart ETH --protocol coingecko # → coingecko chart (when implemented)
chart TOKEN/SOL --protocol dexscreener # → dexscreener pair chart (when implemented)

Routing implementation:

// src/core/commands.ts (chart alias)
const validCharts = ['wbtc', 'eth', 'performance', 'network', 'network-graph', 'portfolio', 'balances']

if (validCharts.includes(chartType)) {
// Render built-in chart directly
} else if (explicitProtocol === 'coinpaprika') {
// Delegate to cchart command
return await cchartCmd.run(`${symbol} ${lineFlag}`, context)
} else {
// Default: 1inch chart lookup
}

Provider Comparison

Feature1inchCoinPaprikaCoinGeckoDexScreener
Data sourceDEX aggregator100+ exchanges100+ exchangesOn-chain DEX pairs
Coverage~10K tokens56K+ coins~13K coinsAll on-chain pairs
Chain supportMulti-chain EVMChain-agnosticChain-agnosticAll chains
Price typeReal-time DEXMarket aggregatedMarket aggregatedReal-time on-chain
Intervals1h, 6h, 24h, 7d1h, 24h, 7d, 14d, 30d, 90d, 365dFlexibleReal-time
Max data pointsVaries366VariesStreaming
Historical depthRecentUp to 1 yearExtensiveReal-time
Rate limitsGenerous25K req/monthFree tier / ProRate limited
Chart typesCandlestick, LineCandlestick, LineCandlestick, LineCandlestick
Implementationℹ️ Plannedℹ️ Planned

1inch Charts

1inch provides DEX price data based on on-chain liquidity. Best for:

  • Tokens actively traded on Ethereum mainnet and other EVM chains.
  • Real-time DEX price movements.
  • Comparing DEX price vs market price.
chart WBTC --protocol 1inch
chart ETH --protocol 1inch # wbtc and eth also have built-in 1inch panels

CoinPaprika Charts

CoinPaprika provides OHLCV data aggregated from 100+ exchanges. Best for:

  • 56K+ coins including many not traded on major DEXes.
  • 30-day historical data at 24h intervals (default).
  • Candlestick and line chart modes.
# Direct command
cchart BTC
cchart ETH --line

# Via chart alias
chart BTC --protocol coinpaprika
chart SOL --protocol coinpaprika --line

Symbol resolution: CoinPaprika uses its own coin ID system (btc-bitcoin, eth-ethereum). The cchart command automatically resolves symbols:

cchart BTC → resolveSymbol('BTC') → 'btc-bitcoin' → GET /api/coinpaprika/ohlcv/btc-bitcoin

API endpoint: GET /api/coinpaprika/ohlcv/[id]

Query parameters:

  • interval: 1h, 24h (default), 7d, 14d, 30d, 90d, 365d
  • limit: 1–366 (default: 30)
  • start, end: ISO 8601 date strings

See Market Data: CoinPaprika for the full integration details.


CoinGecko Charts

Not Yet Implemented

CoinGecko chart support is planned but not yet available. This section describes the intended behavior.

CoinGecko provides market aggregated OHLCV data with flexible time ranges.

chart ETH --protocol coingecko    # (planned)

See Market Data: CoinGecko.


DexScreener Charts

Not Yet Implemented

DexScreener chart support is planned but not yet available. This section describes the intended behavior.

DexScreener provides real-time on-chain pair data. Unlike the other providers, DexScreener is pair-based (not coin-based) — you specify a token/quote pair on a specific DEX.

chart TOKEN/SOL --protocol dexscreener    # (planned)

See Market Data: DexScreener.


Chart Output Format

All chart commands return data in a format compatible with the analytics panel:

{
success: true,
value: {
message: string // e.g., "📊 Added BTC chart to analytics panel (CoinPaprika)"
chartType: 'candlestick' | 'line'
symbol: string
source: string // provider name
interval: string
dataPoints: number
data: OHLCVDataPoint[]
}
}

The analytics panel renders this data regardless of which provider generated it.


Search-Then-Chart Workflow

# Find a coin first
coinsearch cardano
1. 🪙 ADA - Cardano (Rank #8)
2. 🎫 ADAi - ADA-pegged stablecoin...

# Chart it
cchart ADA
→ 📊 Added ADA chart to analytics panel (CoinPaprika)