Skip to main content

DuneSQL Features

DuneSQL offers several useful features for working with blockchain data:
  1. Blockchain varbinary data types: Designed for storing addresses, hashes, and other encoded data.
  2. Native support for uint256 and int256 data types: Ideal for handling large numbers commonly found in blockchain data, with built-in functions for ease of use.
  3. Columnar storage format Optimized for fast reads, this format organizes data in columns rather than rows, enabling quick access to single columns for aggregation or filtering.
  4. Querying a query: DuneSQL allows you to query a query, which is great for creating reusable queries, building up complex queries, and reusing queries as views.

Using DuneSQL

DuneSQL is our query engine for blockchain data. It is a fork of TrinoSQL, which is an open-source, distributed SQL query engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes. We maintain extensive documentation for DuneSQL Here you will be able to find:

Functions and Operators

A reference guide to DuneSQL functions and operators.

Data Types

A reference guide to DuneSQL data types.

Reserved Keywords

A list of reserved keywords in DuneSQL.

Writing Efficient Queries

An efficient query-writing process requires knowledge of how DuneSQL and data storage works.

Querying a Query

DuneSQL allows you to query a query, which is great for creating reusable queries, building up complex queries, and reusing queries as views.

Materialized Views

Learn how to create and use materialized views in DuneSQL for improved query performance.

Resources and Support

For assistance with DuneSQL, consider the following resources: