SQD Blockchain Data Infrastructure
Build production-grade blockchain data pipelines across 200+ networks. SQD provides four core products: Portal API (raw HTTP data access), Pipes SDK (composable TypeScript pipelines), Squid SDK (complete indexing framework with GraphQL), and SQD Cloud (managed deployment).Quick Reference
- Portal API Base URL:
https://portal.sqd.dev/datasets/{dataset-slug} - Authentication: Free, no API keys required
- Rate Limits: 20 requests per 10 seconds (public), unlimited (self-hosted)
- Response Format: Newline-delimited JSON (NDJSON), gzip-compressed — always use
--compressedin curl - Documentation: https://beta.docs.sqd.dev
- Full LLM docs: https://beta.docs.sqd.dev/llms-full.txt
When to Use Each Tool
Portal API — Core Usage
EVM Query Structure
fromBlock(required): Starting block numbertoBlock(optional): Ending block. Omit to stream to current head and stopincludeAllBlocks: If true, returns all blocks in range even without matching datafields: Select which fields to return per data type — reduces payload sizelogs,transactions,traces,stateDiffs: Filter arrays for each data type
Solana Query Structure
d1/d2/d4/d8 are 1/2/4/8-byte instruction type identifiers in 0x-prefixed hex format. Example: "d1": ["0x03"] filters for SPL Token Transfer instructions.
Bitcoin Query Structure
transactions: Transaction data (txid, hash, size, vsize, weight, version, locktime). Use"transactions": [{}]to match all. Setinputs: true/outputs: trueto include related datainputs: Transaction inputs with prevout data. Filter byprevoutScriptPubKeyAddress,prevoutScriptPubKeyType, orprevoutGenerated(coinbase). Settransaction: trueto include parent txoutputs: Transaction outputs. Filter byscriptPubKeyAddressorscriptPubKeyType(e.g.witness_v1_taproot,witness_v0_keyhash,pubkeyhash,scripthash,nulldata). Settransaction: trueto include parent tx
number, hash, parentHash, timestamp, medianTime, version, merkleRoot, nonce, target, bits, difficulty, chainWork, strippedSize, size, weight
Common Event Signatures (topic0)
- Transfer (ERC-20/721):
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef - Approval (ERC-20):
0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925 - Swap (Uniswap V2):
0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822 - Swap (Uniswap V3):
0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67
Endpoints
Error Codes
- 400: Invalid query format
- 404: Dataset not found (check slug at https://portal.sqd.dev/datasets)
- 204: Requested block range exceeds available data
- 409: Chain reorg conflict — retry with updated block range
- 429: Rate limit exceeded (20 req/10s on public Portal)
- 500: Internal server error
fromBlock is required. Omitting it silently streams from block 0, which is expensive and almost never what you want.
Top Dataset Slugs
Full list: https://portal.sqd.dev/datasets (returns JSON array of dataset objects)
Pipes SDK — Composable Pipelines
TypeScript-only. Currently supports EVM and Solana.Squid SDK — Full Indexing Framework
TypeScript-only. Supports EVM, Solana, Substrate, Fuel, Tron, Starknet.sqd deploy).
Common Recipes
Track USDC transfers on Base:Guidelines
- Always use
--compressedwith curl — Portal returns gzip-compressed responses - Use
/finalized-streaminstead of/streamfor production-critical applications that need reorg safety - Filter by
addressand/ortopic0in logs to minimize response size — unfiltered queries on busy chains return massive payloads - The
fieldsobject controls which properties are returned per data type — request only what you need - Portal is 10-50x faster than RPC for historical data extraction
- For continuous real-time streaming, reconnect to
/streamperiodically after reaching head - OpenAPI specs available at: https://beta.docs.sqd.dev/files/evm-openapi.yaml, https://beta.docs.sqd.dev/files/solana-openapi.yaml, and https://beta.docs.sqd.dev/files/bitcoin-openapi.yaml
Portal MCP Server — Convenience Tools
The Portal MCP Server (https://portal.sqd.dev/mcp) provides high-level tools that are often more useful than raw curl for AI workflows:
Prefer MCP convenience tools over raw curl when available — they auto-decode values, add token metadata, and format amounts.
AI Integration
- Docs MCP Server:
https://beta.docs.sqd.dev/mcp— search and access SQD documentation - Portal MCP Server:
https://portal.sqd.dev/mcp— query blockchain data directly (see convenience tools above) - Agent Skills: https://github.com/subsquid-labs/agent-skills