Skip to content
Amp Docs

Overview

Amp is Edge & Node's blockchain native database. It extracts data from chains, transforms it with SQL, stores it as Parquet you own, and serves it to your applications, as one-off queries or as continuous streams. To see why teams use it, visit ampdb.io.

What it's for

Reading a chain directly is slow and awkward. An RPC endpoint, the API a blockchain node serves, returns one block or transaction at a time, in a format made for nodes rather than for analysis. Amp turns a chain into tables that you query with SQL:

SELECT block_num, timestamp, gas_used
FROM "acme/eth_mainnet".blocks
ORDER BY block_num DESC
LIMIT 5

With Amp, you can:

  • Query chains with SQL: blocks, transactions, and logs from Ethereum and other EVM chains, Solana, Bitcoin, and more.
  • Decode and transform data: write SQL over other datasets to decode contract events into token transfers, swaps, or whatever your application needs, and keep the results up to date as new blocks arrive.
  • Stream results: turn a query into a stream of new rows that arrive as the chain grows, with signals that tell your application which rows to replace when the chain reorganizes.
  • Keep your data: Amp stores everything it extracts as Parquet files, an open format that most data tools read, in storage you choose.

How it works

Data moves through Amp in three steps:

  1. Extract: a raw dataset pulls a chain's data, like its blocks, transactions, and logs, through a provider: a connection to an RPC endpoint or another source of chain data.
  2. Transform: a derived dataset is SQL over other datasets. This is where protocol decoding lives (token transfers, swaps, and so on), and where you combine data from several chains.
  3. Serve: Amp's query server answers SQL over Arrow Flight, a protocol for sending tables over the network. Add SETTINGS stream = true to a query to turn it into a continuous stream.

Between extracting and serving, Amp stores each dataset's tables as Parquet files, in a local directory or an object store like Amazon S3.

chain ──▶ provider ──▶ raw dataset ──▶ derived datasets
                            │                 │
                            ▼                 ▼
                     Parquet files in your storage
                                    │
                                    ▼
                  query server ──▶ your queries and streams

Amp's pieces

  • ampd, the Amp daemon. One program runs all three of Amp's services: the query server, which answers queries; the controller, which serves the Admin API you manage Amp with and schedules work; and workers, which extract and transform data. It runs them in one process (solo mode) or as separate ones (distributed mode).
  • A PostgreSQL database for Amp's metadata: which datasets exist, what has been extracted, and which work is running.
  • Storage for the data itself: a directory, or an object store like Amazon S3 or Google Cloud Storage.
  • CLIs: ampup installs Amp, ampctl manages it, ampsql runs queries, and ampsync copies datasets into PostgreSQL.
  • SDKs for TypeScript and Python, to query and manage Amp from your code.
  • The Amp app, to explore and query datasets in your browser.

Architecture explains how they work together.

Design

  • Open formats: data travels as Apache Arrow, a standard format for tables in memory and on the network, and is stored as Parquet. Any tool that reads Parquet can read Amp's data, without Amp.
  • Reorg-aware: chains sometimes replace their latest blocks, which is called a reorg. Amp records which blocks every file and streamed batch came from, so it can replace data from abandoned blocks, and tell your application which rows to replace.
  • VerifiableExperimental: Amp can check the data it extracts against the chain's own cryptographic commitments: block hashes and transaction and receipt roots on Ethereum, signatures on Solana. See Verification.
  • One program: ampd runs on your machine, in your cloud, or operated by Edge & Node. It needs only PostgreSQL and storage.

Ways to use Amp

  • In the Amp app: explore and query datasets, with nothing to install.
  • Connect to a hosted Amp: someone else runs Amp, and you query and manage it with the CLIs and SDKs.
  • Run Amp yourself: in one process on your machine, or as separate services in production.

Choose How to Run Amp compares them.

Next steps

  • Quickstart: run Amp on your machine, extract Ethereum blocks, and query them.
  • Datasets: the building block of everything in Amp.
  • Glossary: the terms these docs use.