# Introduction (Carbon 2.0)

> What Carbon is, how a pipeline moves Solana data from datasources through decoders to your processors, what you can build and when to use something else.

Carbon is an open-source Rust framework for building Solana indexers and data pipelines. You choose where the data comes from, Carbon decodes it into typed Rust values, and your code decides what to do with them. Carbon is maintained by [SevenLabs](https://github.com/sevenlabs-hq) with the Solana Foundation and released under the MIT license.

## How a pipeline works

A Carbon program builds one `Pipeline` from three kinds of parts:

- **Datasources** read updates from Solana: account writes, transactions, account closures and block metadata. A datasource can be a Geyser gRPC stream, a Solana RPC subscription, a crawler over history, a validator snapshot or a provider API.
- **Decoders** turn raw bytes into Rust types. Carbon publishes decoders for 60+ programs, and the Carbon CLI generates one from any Anchor or Codama IDL.
- **Processors** are your code. Each one receives decoded data together with its metadata: slot, signature, the instruction's position in the transaction and so on.

![How a Carbon pipeline moves data](https://carbon.sevenlabs.org/diagrams/pipeline-overview.svg)

**Diagram: How a Carbon pipeline moves data.** Datasources such as Yellowstone gRPC, an RPC crawler or a snapshot each send updates into one channel. The pipeline takes updates off the channel one at a time and offers each one to the pipes for its type: account pipes and instruction pipes filter and decode, transaction pipes filter and decode every instruction with a decoder set, and account-deletion and block-details pipes only filter. Every pipe then calls its processor, which is your code.

Every datasource runs in its own task and sends updates into one channel. The pipeline takes updates off the channel one at a time and offers each one to the pipes that match its type. A pipe applies its filters, decodes the update and calls its processor. [Architecture](https://carbon.sevenlabs.org/concepts/architecture.md) explains the exact order and guarantees.

The same processor works with any datasource. You can develop against the free public RPC endpoint and switch to a Geyser stream in production without changing your processing code.

## What you can build

- **Real-time indexers** that write decoded instructions and account state to Postgres or another store as blocks land, from a Geyser gRPC stream such as [Yellowstone](https://carbon.sevenlabs.org/datasources/yellowstone-grpc.md) or [Helius LaserStream](https://carbon.sevenlabs.org/datasources/helius-laserstream.md).
- **Backfills** that walk a program's transaction history with the [transaction crawler](https://carbon.sevenlabs.org/datasources/rpc-transaction-crawler.md) or a block range with the [block crawler](https://carbon.sevenlabs.org/datasources/rpc-block-crawler.md).
- **State loaders** that read every account of a program at once from `getProgramAccounts` or a [validator snapshot](https://carbon.sevenlabs.org/datasources/validator-snapshot.md), then keep it current with a stream.
- **Bots and alerting** that react to swaps, liquidations or account changes within the same slot.
- **Analytics pipelines** that aggregate trades, fees or balances across several programs, using [transaction processors](https://carbon.sevenlabs.org/concepts/transactions.md) to see every instruction of a transaction together.

Carbon also ships optional [Postgres](https://carbon.sevenlabs.org/guides/postgres.md) and [GraphQL](https://carbon.sevenlabs.org/guides/graphql.md) layers, [Prometheus metrics](https://carbon.sevenlabs.org/guides/prometheus.md) and test utilities.

## When not to use Carbon

- **You need ad-hoc queries over all of Solana's history.** Carbon processes the updates you subscribe to; it isn't a hosted warehouse. Use a data warehouse or a provider's historical API, and use Carbon when you want your own tables for specific programs.
- **You only need a few RPC calls.** Reading one account or sending transactions is simpler with `solana-client` directly.
- **You can't use Rust.** Carbon is a Rust library. The Carbon CLI is a Node.js tool, but it only generates Rust code.
- **You need a datasource that isn't on the Carbon 2 line yet.** Jito Shredstream and Jetstreamer have no 2.0 crates. See [Datasources](https://carbon.sevenlabs.org/datasources.md) for what's available, or [write your own](https://carbon.sevenlabs.org/guides/custom-datasource.md).

## Map of the docs

| Section                                                                                                                                                                          | Read it when you want to                                                                      |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [Quickstart](https://carbon.sevenlabs.org/quickstart.md)                                                                                                                         | Run a working indexer against mainnet in five minutes.                                        |
| [Installation](https://carbon.sevenlabs.org/installation.md)                                                                                                                     | Add Carbon to a project and pick crates and features.                                         |
| Concepts, starting with [Architecture](https://carbon.sevenlabs.org/concepts/architecture.md)                                                                                    | Understand updates, datasources, decoders, processors, filters, metrics, shutdown and errors. |
| Guides, such as [Generate a decoder](https://carbon.sevenlabs.org/guides/generate-a-decoder.md)                                                                                  | Follow a task end to end: streaming, backfills, Postgres, GraphQL, testing, production.       |
| Reference, starting with [`PipelineBuilder`](https://carbon.sevenlabs.org/reference/pipeline-builder.md)                                                                         | Look up a builder method, trait, filter, metric, error, feature flag or CLI flag.             |
| [Datasources](https://carbon.sevenlabs.org/datasources.md) and [Decoders](https://carbon.sevenlabs.org/decoders.md)                                                              | Configure a specific datasource or decoder crate.                                             |
| [Examples](https://carbon.sevenlabs.org/examples.md), [Troubleshooting](https://carbon.sevenlabs.org/troubleshooting.md), [Changelog](https://carbon.sevenlabs.org/changelog.md) | Copy a full project, fix an error, or upgrade.                                                |

Using a coding agent? Every page is available as Markdown; see [For AI agents](https://carbon.sevenlabs.org/agents.md).

## Next steps

- [Quickstart](https://carbon.sevenlabs.org/quickstart.md): Decode live Meteora swaps from mainnet. No account needed.
- [Installation](https://carbon.sevenlabs.org/installation.md): Requirements, crates and feature flags.
- [Architecture](https://carbon.sevenlabs.org/concepts/architecture.md): How Pipeline::run moves an update from datasource to processor.

---

Carbon 2.0.0 documentation · Web: https://carbon.sevenlabs.org/introduction · Last updated 2026-11-09 · Index of all pages: https://carbon.sevenlabs.org/llms.txt
