How to Query Solana Data with SQL: Flipside, Dune, Helius & BigQuery (2026)

Learn how to query Solana blockchain data using SQL. This guide covers Flipside Crypto, Dune Analytics, Helius DAS, and Google BigQuery with practical queries for token holders, DEX volume, wallet profitability, and NFT sales.

MadeOnSol··Updated · 14 min read
How to Query Solana Data with SQL: Flipside, Dune, Helius & BigQuery (2026)

Disclosure: This article contains affiliate links. If you sign up through them, MadeOnSol may earn a commission at no extra cost to you. This never affects our rankings, ratings, or reviews.

SQL has become the standard way to query Solana blockchain data. Whether you are tracking whale wallets, measuring DEX volume, or analyzing NFT sales trends, writing SQL against indexed Solana data gives you precision that no dashboard can match.

The problem is choosing the right platform. Dune Analytics, Helius, and Google BigQuery all offer SQL (or SQL-adjacent) access to Solana data today — Flipside Crypto's self-serve SQL platform, once a fourth option, was discontinued in 2026 (details below) — and the survivors differ in schema design, data freshness, pricing, and query speed. This guide walks through each platform with setup instructions and ready-to-use queries so you can start extracting insights immediately.

If you are new to on-chain data analysis, start with our introduction to Solana on-chain data before diving into SQL-specific workflows.

Why Query Solana Data with SQL

Dashboards are useful for monitoring known metrics, but SQL unlocks questions that no pre-built dashboard anticipates. You can filter by specific programs, time windows, wallet clusters, or token mints — and combine them in ways that surfaces alpha before it becomes common knowledge.

Common use cases for SQL on Solana:

  • Identify the top holders of any SPL token at a specific point in time
  • Calculate daily DEX volume broken down by protocol (Jupiter, Raydium, Orca)
  • Track wallet profitability across hundreds of trades
  • Analyze NFT sales history by collection, marketplace, or price range
  • Monitor protocol-level metrics like TVL changes, fee revenue, and user retention

Every platform covered here indexes raw Solana transactions and decodes them into structured tables you can query with standard SQL syntax.

Dune Analytics

Dune Analytics is the most popular blockchain analytics platform with a massive community of analysts sharing public queries and dashboards. Its Solana support covers decoded program data, token transfers, DEX trades, and NFT events.

Setting Up Dune

  1. Create an account at dune.com
  2. Navigate to the query editor (New Query)
  3. Select "Solana" from the database dropdown
  4. Start writing SQL using DuneSQL syntax (Trino-based)

As of September 10, 2026, Dune's free tier is view-only — you can browse and fork existing dashboards and queries, but running your own SQL (the workflow this guide walks through) requires a paid plan. The cheapest option is the Analyst plan at $65/month (4,000 credits); the Plus plan ($349/month, 25,000 credits) adds private queries, faster execution, and CSV exports.

Dune Schema Overview

Dune organizes Solana data into several key schemas:

  • solana.transactions — All Solana transactions with fee, signer, and status data
  • solana.account_activity — Account balance changes per transaction
  • tokens_solana.transfers — Decoded SPL token transfers
  • dex_solana.trades — Aggregated DEX trades across all major Solana DEXs
  • nft_solana.trades — NFT marketplace sales data

Example: Daily DEX Volume on Solana

SELECT
  date_trunc('day', block_time) AS trade_date,
  project AS dex,
  COUNT(*) AS trade_count,
  SUM(amount_usd) AS volume_usd
FROM dex_solana.trades
WHERE block_time >= NOW() - INTERVAL '30' DAY
GROUP BY 1, 2
ORDER BY 1 DESC, 4 DESC

This query returns daily DEX volume per protocol over the last 30 days. You can filter by specific DEX names like 'jupiter' or 'raydium' to narrow results.

Example: Top Token Holders

SELECT
  to AS wallet,
  SUM(CASE WHEN to = wallet THEN amount ELSE 0 END)
    - SUM(CASE WHEN "from" = wallet THEN amount ELSE 0 END) AS net_balance
FROM tokens_solana.transfers
WHERE token_mint_address = '{{token_mint}}'
GROUP BY 1
HAVING net_balance > 0
ORDER BY 2 DESC
LIMIT 100

Replace {{token_mint}} with any SPL token mint address. Dune supports parameterized queries, so you can create a reusable dashboard widget for any token.

Flipside Crypto

Flipside took a different approach by providing curated, pre-modeled data tables that were easier to query than raw transaction data, with Solana coverage spanning decoded program events, labelled wallet addresses, and clean swap tables.

Status update: Flipside's self-serve SQL platform (Flipspace) is no longer available. Flipside sold its blockchain data business to SonarX in May 2026, and flipsidecrypto.xyz now redirects to edisyl.com, Flipside's new enterprise AI venture. SonarX inherited Flipside's Solana dataset but serves it through institutional delivery (SOC 2, custom data pipelines) rather than a public sign-up-and-query web app, so there is no direct self-serve replacement for the workflow this section used to describe. If you were using Flipside for ad-hoc SQL analysis, Dune (paid tier) or Google BigQuery below are the closest remaining free/self-serve options.

The schema shape below is kept for reference, since Flipside-modeled tables are still the basis of the data SonarX now sells, but you can no longer run these queries yourself without an enterprise data agreement.

Flipside's Former Schema

Flipside's Solana tables were organized like this:

  • solana.core.fact_transactions — Transaction-level data with fees, signers, and success status
  • solana.core.fact_transfers — All SOL and SPL token transfers
  • solana.core.fact_events — Decoded program events
  • solana.defi.fact_swaps — DEX swap data with clean token symbols and USD values
  • solana.nft.fact_nft_sales — NFT marketplace transactions
  • solana.core.dim_labels — Known wallet labels (exchanges, protocols, whales)

Example: Wallet Profitability Analysis (illustrative — Flipside's self-serve editor is discontinued)

WITH buys AS (
  SELECT
    swapper AS wallet,
    swap_to_mint AS token,
    SUM(swap_to_amount) AS tokens_bought,
    SUM(swap_from_amount * COALESCE(swap_from_decimal_price, 0)) AS cost_usd
  FROM solana.defi.fact_swaps
  WHERE swapper = '{{wallet_address}}'
    AND block_timestamp >= CURRENT_DATE - 30
  GROUP BY 1, 2
),
sells AS (
  SELECT
    swapper AS wallet,
    swap_from_mint AS token,
    SUM(swap_from_amount) AS tokens_sold,
    SUM(swap_to_amount * COALESCE(swap_to_decimal_price, 0)) AS revenue_usd
  FROM solana.defi.fact_swaps
  WHERE swapper = '{{wallet_address}}'
    AND block_timestamp >= CURRENT_DATE - 30
  GROUP BY 1, 2
)
SELECT
  b.token,
  b.tokens_bought,
  COALESCE(s.tokens_sold, 0) AS tokens_sold,
  b.cost_usd,
  COALESCE(s.revenue_usd, 0) AS revenue_usd,
  COALESCE(s.revenue_usd, 0) - b.cost_usd AS pnl_usd
FROM buys b
LEFT JOIN sells s ON b.token = s.token
ORDER BY pnl_usd DESC

This query calculates profit and loss per token for a given wallet over the last 30 days. It pairs buy and sell activity to show which tokens were profitable — the pattern is worth understanding even though you can no longer run it against Flipside directly.

Helius DAS and SQL Access

Helius is primarily an RPC and API provider, but its Digital Asset Standard (DAS) API and enhanced transaction endpoints let you query Solana data programmatically. While Helius does not offer a traditional SQL editor, you can pipe its structured JSON responses into your own database for SQL analysis.

Setting Up Helius for Data Queries

  1. Sign up at helius.dev and get your API key
  2. Use the DAS API for asset and ownership queries
  3. Use Enhanced Transaction API for decoded transaction history
  4. Load results into a local PostgreSQL or SQLite database for SQL analysis

The free tier provides 1,000,000 credits/month. For heavy data analysis, the Business plan ($499/month) offers higher limits and priority access.

Example: Query Top Holders via DAS API

// Fetch top holders for a token mint using Helius DAS
const response = await fetch(
  `https://mainnet.helius-rpc.com/?api-key=${API_KEY}`,
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      jsonrpc: "2.0",
      id: 1,
      method: "getTokenAccounts",
      params: {
        mint: "TOKEN_MINT_ADDRESS",
        limit: 100,
        options: { showZeroBalance: false }
      }
    })
  }
);

Once you load this data into a local database, you can run standard SQL queries against it. This approach is best when you need real-time data that analytics platforms might lag behind on.

Example: NFT Sales History via Enhanced Transactions

// Fetch NFT transaction history
const response = await fetch(
  `https://api.helius.xyz/v0/addresses/${NFT_MINT}/transactions?api-key=${API_KEY}&type=NFT_SALE`
);
const sales = await response.json();
// Insert into local DB for SQL analysis

Helius is ideal when you need the freshest data possible or when your analysis requires combining on-chain data with off-chain sources in a custom database.

Building a product on Solana or Robinhood Chain data?

Skip the Geyser pipeline — embed KOL flow, deployer reputation, and the all-DEX firehose over REST, WebSocket, or webhooks. The Business tier (€400/mo) is the self-serve embed license at 500k calls/day — Enterprise adds white-label & redistribution.

See Business pricing

Google BigQuery (Solana Warehouse)

Google BigQuery provides access to Solana blockchain data through the public dataset bigquery-public-data.crypto_solana_mainnet_us. This is a fully managed warehouse with no indexing required and virtually unlimited compute for large-scale analysis.

Setting Up BigQuery

  1. Go to console.cloud.google.com and create a project
  2. Navigate to BigQuery in the left sidebar
  3. Search for crypto_solana in the public datasets explorer
  4. Pin the dataset to your project for easy access

BigQuery offers 1 TB of free query processing per month. For most Solana analysis tasks, this is more than enough. Billing kicks in at $6.25 per TB scanned after the free tier.

Known caveat: This is a community-maintained public dataset, not a Google-operated pipeline, and it has a documented history of falling behind — reports on Google's own developer forums show it stalling for days at a time (most recently a multi-day gap in late 2025) rather than staying within the 1-6 hour lag Google's own description implies. Check the dataset's "last modified" timestamp against a recent block before relying on it for anything time-sensitive.

BigQuery Schema Overview

The Solana public dataset includes:

  • transactions — Full transaction data including instructions and logs
  • blocks — Block-level metadata (slot, timestamp, leader)
  • accounts — Account state snapshots
  • token_transfers — Decoded SPL token transfer events
  • rewards — Validator and staking rewards

Example: NFT Sales History

SELECT
  t.block_timestamp,
  t.signatures[OFFSET(0)] AS tx_signature,
  tt.source AS seller,
  tt.destination AS buyer,
  tt.value / 1e9 AS price_sol
FROM `bigquery-public-data.crypto_solana_mainnet_us.transactions` t,
  UNNEST(t.token_transfers) tt
WHERE tt.mint = '{{nft_collection_mint}}'
  AND t.block_timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 90 DAY)
  AND t.success = TRUE
ORDER BY t.block_timestamp DESC
LIMIT 500

BigQuery shines for historical analysis across large time ranges where other platforms might time out. Scanning a full year of Solana DEX data is routine on BigQuery but can be painful on platforms with execution time limits.

Platform Comparison

FeatureDune AnalyticsFlipside CryptoHeliusGoogle BigQuery
SQL dialectDuneSQL (Trino)Snowflake SQLN/A (API)GoogleSQL
Free tierView-only (paid to run queries)Discontinued (self-serve)1M credits/mo1 TB queries/mo
Data freshnessNear real-timeN/A (discontinued)Real-time1-6 hour lag, with documented multi-day gaps
Query speedModerateFastInstant (API)Fast for large scans
Decoded DEX dataYesYesVia parsed txLimited
NFT sales tablesYesYesVia DAS APIRaw transfers only
Wallet labelsCommunityBuilt-inNoNo
VisualizationBuilt-in chartsBuilt-in chartsNoLooker Studio
API accessPaid plansN/A (discontinued)All plansAll plans
Best forCommunity dashboards, researchDiscontinued — data now sold via SonarX (enterprise)Real-time data, app backendsLarge-scale historical analysis

Choosing the right platform:

  • Exploratory analysis and sharing: Start with Dune. The community queries and dashboards are still free to browse and fork, though running new SQL now requires a paid plan.
  • Clean wallet and DeFi analysis: Flipside's self-serve tables are gone. Helius (raw data you model yourself) or Dune's forkable community queries are the closest remaining options.
  • Real-time application data: Use Helius. When your app needs fresh data with millisecond latency, an API beats a query platform.
  • Large historical scans: Use BigQuery, but verify the dataset's freshness first — it has a documented history of multi-day update gaps.

For a broader comparison of analytics tools, see our guide on the best Solana analytics dashboards.

Practical Tips for Solana SQL Queries

Optimize for cost and speed:

  • Always filter by block_time or block_timestamp first. Time-partitioned columns dramatically reduce the amount of data scanned.
  • Use LIMIT during development. A query that returns 10 million rows wastes compute even if you only look at the first 100.
  • Avoid SELECT * on transaction tables. Solana transactions contain nested instruction data that inflates scan size.

Handle Solana-specific quirks:

  • Token amounts are stored as integers. Divide by 10^decimals to get human-readable values. Most platforms provide a decimal column or pre-divided amount.
  • A single Solana transaction can contain dozens of inner instructions. When counting "trades" or "transfers," be specific about which instruction types you include.
  • Wallet addresses on Solana are base58-encoded. Most SQL platforms store them as strings, so text matching and grouping works normally.

Combine platforms for the best results:

Use Dune for discovery and exploration, then move to Helius or BigQuery for production pipelines that need reliability and freshness. Many analysts use Dune to prototype a query, then replicate it in BigQuery for scheduled reporting.

For deeper guidance on working with historical Solana data, check out our historical data access and analysis guide. If you want production-grade freshness instead of a warehouse query, our guide to building a Solana token analytics dashboard shows how to combine several of these same data sources into one live view, while our breakdown of the dual-region gRPC pipeline behind MadeOnSol's KOL tracker covers what real-time ingestion looks like without SQL at all. Before you write a query, it's often faster to sanity-check a wallet, token, or transaction by hand in a block explorer first — our guide to Solana FM's Translator feature shows how to read holder distributions and parsed transactions without touching a single line of SQL.

Frequently Asked Questions

Is it free to query Solana data with SQL?

Mostly. Google BigQuery includes 1 TB of free query processing per month and Helius gives 1,000,000 free API credits per month, both of which are sufficient for learning and moderate analysis. Dune's free tier is now view-only (as of September 10, 2026) — you can browse and fork existing dashboards for free, but running your own SQL requires a paid plan starting at $65/month. Flipside's self-serve platform has been discontinued entirely. Paid tiers on the remaining platforms become necessary when you need private queries, higher execution limits, or programmatic API access for production applications.

Which platform has the freshest Solana data?

Helius provides the freshest data because it queries the Solana blockchain directly via RPC and API calls, giving you real-time results with no indexing delay. Dune Analytics operates at near real-time freshness, typically lagging by a few minutes as it indexes and decodes new blocks. Google BigQuery's public Solana dataset is nominally updated within a few hours but has a documented history of falling multiple days behind, so verify its freshness before relying on it for recent activity. If your analysis requires data from the most recent blocks, Helius is the best choice.

Can I use these SQL platforms to build automated trading strategies?

You can use them for the analytical component of a trading strategy, but none of these platforms are designed for real-time trade execution. Dune is best suited for backtesting strategies, identifying patterns, and generating watchlists (now on a paid plan, since free-tier query execution is gone). Helius can feed real-time data into a trading bot via its API and webhooks. BigQuery works well for batch analysis that runs on a schedule. The typical workflow is to use SQL analysis to identify opportunities, then execute trades through a separate system connected to Jupiter or Raydium. See our on-chain data analysis guide for more on turning data into actionable insights.

Do I need to know advanced SQL to get useful results?

Basic SQL knowledge is enough to extract significant value from Solana data. If you can write SELECT, WHERE, GROUP BY, and JOIN statements, you can answer most common questions about token holders, trading volumes, and wallet activity. Dune has a large library of community queries you can fork and modify without writing anything from scratch, even on the free view-only tier. More advanced techniques like window functions, CTEs, and subqueries become useful for complex analyses like wallet profitability tracking or time-series comparisons, but you can learn these incrementally as your questions get more sophisticated.

Tools mentioned

Compare features and read reviews.

Live health scores, average ratings, and direct links on MadeOnSol.

Build with MadeOnSol API

KOL tracking, deployer intelligence, DEX streaming, and webhooks. Free API key — 200 requests/day.

Start free
import { MadeOnSol } from "madeonsol";

// Get a free API key at madeonsol.com/pricing
const client = new MadeOnSol({ apiKey: "msk_your_key" });

const { trades } = await client.kol.feed({ limit: 10 });
const { alerts } = await client.deployer.alerts({ limit: 5 });
const { tools } = await client.tools.search({ q: "trading" });
npm install madeonsolFull API docs

Building a product on Solana or Robinhood Chain data?

MadeOnSol isn't an RPC or another generic token API — it's Solana & Robinhood Chain memecoin intelligence that's painful to build in-house, pulled from dual-region gRPC shred streams and our own Robinhood Chain node, pushed to your app as events land.

Signals you'd otherwise build

KOL & smart-money flow from 2,000+ labeled wallets, deployer reputation, coordination clusters, linked-wallet entity resolution, and an all-DEX firehose.

Embed it in your product

The Business tier (€400/mo, self-serve) licenses you to display MadeOnSol data inside your own product — 500k calls/day, 15 WS + 6 firehose connections. Enterprise above adds white-label & redistribution rights and custom endpoints.

Evaluate first, commit later

Test everything on a free ULTRA key — no commitment. If it fits, we scope volume or white-label pricing.

Keep reading

More from the blog.

All Analytics
How to Analyze Solana On-Chain Data: Tools, Metrics & Techniques (2026)

Education

How to Analyze Solana On-Chain Data: Tools, Metrics & Techniques (2026)

Learn how to analyze Solana on-chain data using tools like Dune, Flipside, Helius, and Birdeye. Master key metrics including TVL, volume, active wallets, and fee revenue to make smarter trading and investment decisions.

14 minMarch 15, 2026
Solana Historical Data: How to Access and Analyze Past On-Chain Activity (2026)

Analytics

Solana Historical Data: How to Access and Analyze Past On-Chain Activity (2026)

Solana validators prune old data aggressively, making historical analysis difficult. Learn how to access Solana historical data using BigQuery, Flipside, Dune, Helius DAS API, and archival services — with practical query examples.

14 minApril 6, 2026
Inside Our Deployer Intelligence: How We Score 10,600+ Pump.fun Deployers

Education

Inside Our Deployer Intelligence: How We Score 10,600+ Pump.fun Deployers

How MadeOnSol classifies pump.fun deployers into tiers, tracks bonding rates, and surfaces the 34 elite deployers whose tokens graduate at 71% — versus the 1-2% baseline.

13 minMay 26, 2026
Solana Wallet Win Rate Leaderboard API: Developer Guide

Developer Tools

Solana Wallet Win Rate Leaderboard API: Developer Guide

How to query the alpha leaderboard API, what win_rate, roi, and net_pnl_sol actually mean, how to page through results, and how to build a top-wallets dashboard or bot signal feed in TypeScript.

8 minApril 15, 2026
Solana Webhooks: The Complete Guide to Real-Time On-Chain Alerts (2026)

Developer Tools

Solana Webhooks: The Complete Guide to Real-Time On-Chain Alerts (2026)

Learn how to set up Solana webhooks for real-time blockchain alerts. Compare Helius, QuickNode, Shyft, and Triton webhook providers, with TypeScript code examples for wallet monitoring, NFT sales alerts, and payment confirmation.

11 minApril 6, 2026
Solana RPC Provider Reviews: Helius vs QuickNode vs Alchemy vs Triton, Tested (2026)

Guides

Solana RPC Provider Reviews: Helius vs QuickNode vs Alchemy vs Triton, Tested (2026)

Hands-on reviews of the top Solana RPC providers — Helius, QuickNode, Alchemy, Triton — on pricing, speed, free tiers, gRPC streaming, DAS API, webhooks, plus private/dedicated and archival RPC. Written by a team that runs Solana RPC + gRPC at production scale. For the live side-by-side feature table, see our RPC comparison page.

19 minApril 1, 2026

Enjoyed this article?

Explore the live data.

Real-time KOL trades, Pump.fun deployer intel, and 1,200+ ranked Solana & Robinhood Chain tools — free to explore.

Open the KOL Tracker