Architecture
Components
Portal Source
ThesolanaPortalSource connects to Subsquid Portal API and streams Solana blockchain data.
Query Builder
TheSolanaQueryBuilder defines what data to fetch from the Portal. It supports:
- Field selection: Choose which block, transaction, and instruction fields to include
- Data filtering: Filter by program ID, instruction discriminators, account addresses
- Range specification: Define slot ranges for data fetching
Decoders & Transformers
Decoders parse raw instruction data into typed objects using ABIs:Targets
Targets persist or output the processed data:Data Flow
- Source connects to Portal and streams raw blockchain data
- Query Builder filters and shapes the Portal query
- Decoder/Transformer processes and transforms the data
- Target persists or outputs the final data
Pipeline Composition
Chain components using.pipe() and .pipeTo():
.pipeComposite() for parallel processing:
Key Concepts
| Concept | Description |
|---|---|
| Slot | Solanaβs equivalent of a block number |
| Instruction | A single operation within a transaction |
| Discriminator | Unique identifier for instruction types (d1, d2, d4, d8 byte prefixes) |
| Program ID | Address of the Solana program (smart contract) |
| Cursor | Tracks indexing progress for resumption |
| Fork handling | Manages blockchain reorganizations |
Next Steps
- Sources & Query Builder - Learn how to configure data sources
- Instruction Decoder - Decode program instructions
- Transformers - Transform and process data
- Targets & Persistence - Persist data to databases

