# Home Source: https://docs.sqd.dev/en/home Build blockchain data pipelines with SQD — Portal HTTP APIs across 225+ chains, Squid and Pipes SDKs in TypeScript, and managed Cloud hosting for indexers.
Portal is a high-performance HTTP API for querying blockchain data at scale. With native finality, real-time streaming, and deep historical access. Query arbitrary block ranges in a single request with automatic reorg handling.
Four integrated products that work together to power your blockchain data infrastructure
HTTP API for raw blockchain data with arbitrary ranges, streaming, and finality handling
Learn more →TypeScript libraries for data transformation, decoding, and persistence to any database
Learn more →Managed deployment platform with monitoring, scaling, and zero DevOps required
Learn more →Decentralized data lake powering Portal with 200+ networks and self-hosting options
Learn more →SQD Portal provides an HTTP API for extracting blockchain data with arbitrary block ranges, streaming, and reorg handling
Access data from all major blockchains through Portal
Leading Web3 projects trust SQD to power their blockchain data infrastructure
Large-scale multichain data indexing for top DEX
Accelerated cross-chain indexing for decentralized exchange
Seamless game development across multiple chains
Crosschain privacy with trace data indexing
Data-powered growth for liquidity protocol
Compliant DeFi with SQD data infrastructure
SQD data access powering blockchain games
Seamless social gaming experience with real-time data
Expanding NFT browsing on LUKSO with SQD
Real-time sports betting on Monad powered by SQD
Securing data back-end infrastructure with SQD
Enabling people to explore Ethereum with SQD
Powering AI processors with blockchain data from SQD
Choose your path based on your needs, from quick data queries to full production deployments
Extract blockchain data in minutes using Portal's HTTP API, no setup required, just HTTP requests
Create type-safe indexers with TypeScript SDK and stream data to any database
Ship to SQD Cloud with managed infrastructure, monitoring, and zero DevOps
Build AI agents with SQD using MCP servers, agent skills, and LLM-optimized documentation
Need help choosing? Check out our FAQ or join our community
number \| bigint | [NUMERIC(P\[, S\])](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#parameterized_decimal_type) |
| `BigNumeric(precision, scale)` | number \| bigint | [BIGNUMERIC(P\[, S\])](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#parameterized_decimal_type) |
| `Bool()` | `boolean` | [BOOL](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#boolean_type) |
| `Timestamp()` | `Date` | [TIMESTAMP](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#timestamp_type) |
| `Float64()` | `number` | [FLOAT64](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#floating_point_types) |
| `Int64()` | number \| bigint | [INT64](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#integer_types) |
# CSV support
Source: https://docs.sqd.dev/en/sdk/squid-sdk/reference/store/file/csv
Write Squid SDK indexed data as CSV files via the Table class — schema, encoding, and per-batch flushing for analytics-friendly file output.
# CSV format support
## `Table` Implementation
The `@subsquid/file-store-csv` package provides a `Table` implementation for writing to CSV files. Use it by [supplying one or more of its instances via the `tables` field of the `Database` constructor argument](/en/sdk/squid-sdk/resources/persisting-data/file#database-options). Constructor of the `Table` implementation accepts the following arguments:
* **`fileName: string`**: the name of the output file in every dataset partition folder.
* **`schema: {[column: string]: ColumnData}`**: a mapping from CSV column names to [`ColumnData` objects](#columns). A mapping of the same keys to data values is the row type used by the [table writer](/en/sdk/squid-sdk/resources/persisting-data/file#table-writer-interface).
* **`options?: TableOptions`**: see [`Table` Options](#table-options).
## Columns
`ColumnData` objects determine how the in-memory data representation of each table column should be serialized. They are made with the `Column` factory function that accepts a column data type and an optional `{nullable?: boolean}` `options` object as arguments.
Column types can be obtained by making the function calls listed below from the `Types` submodule. They determine the type that the [table writer](/en/sdk/squid-sdk/resources/persisting-data/file#table-writer-interface) will expect to find at the corresponding field of data row objects.
| Column type | Type of the data row field |
| :-------------------------------: | :------------------------: |
| `Types.String()` | `string` |
| `Types.Numeric()` | `number` or `bigint` |
| `Types.Boolean()` | `boolean` |
| `Types.DateTime(format?: string)` | `Date` |
| `Types.JSON | -n | [-s ] | [-t ]]
[-m ] [--hard-reset] [--stream-logs] [--add-tag ]
[--allow-update] [--allow-tag-reassign] [--allow-manifest-override]
ARGUMENTS
SOURCE [default: .] Squid source. Could be:
- a relative or absolute path to a local folder (e.g. ".")
- a URL to a .tar.gz archive
- a github URL to a git repo with a branch or commit tag
FLAGS
-m, --manifest= [default: squid.yaml] Specify the relative local path
to a squid manifest file in the squid working directory
--add-tag= Add a tag to the deployed squid
--allow-manifest-override Allow overriding the manifest during deployment
--allow-tag-reassign Allow reassigning an existing tag
--allow-update Allow updating an existing squid
--hard-reset Perform a hard reset before deploying. This will drop
and re-create all squid resources, including the
database, causing a short API downtime
--[no-]interactive Disable interactive mode
--[no-]stream-logs Attach and stream squid logs after the deployment
SQUID FLAGS
-n, --name= Name of the squid
-r, --reference=[/](@|:) Fully qualified reference of the squid.
It can include the organization, name,
slot, or tag
-s, --slot= Slot of the squid
-t, --tag= Tag of the squid
ORG FLAGS
-o, --org= Code of the organization
DESCRIPTION
Deploy new or update an existing squid in the Cloud
EXAMPLES
// Create a new squid with name provided in the manifest file
$ sqd deploy .
// Create a new squid deployment and override it's name to "my-squid-override"
$ sqd deploy . -n my-squid-override
// Update the "my-squid" squid with slot "asmzf5"
$ sqd deploy . -n my-squid -s asmzf5
// Use a manifest file located in ./path-to-the-squid/squid.prod.yaml
$ sqd deploy ./path-to-the-squid -m squid.prod.yaml
// Full paths are also fine
$ sqd deploy /Users/dev/path-to-the-squid -m /Users/dev/path-to-the-squid/squid.prod.yaml
```
*See code: [src/commands/deploy.ts](https://github.com/subsquid/squid-cli/tree/master/src/commands/deploy.ts)*
# sqd gateways
Source: https://docs.sqd.dev/en/sdk/squid-sdk/squid-cli/gateways
Explore SQD Network gateways and data sources for a squid with the sqd gateways CLI command — list endpoints, statuses, and chains supported.
Explore data sources for a squid
* [`sqd gateways list`](#sqd-gateways-list)
## `sqd gateways list`
List available gateways
```
USAGE
$ sqd gateways list [--interactive] [-t ] [-n ] [-c ]
FLAGS
-c, --chain= Filter by chain ID or SS58 prefix
-n, --name= Filter by network name
-t, --type= Filter by network type
--[no-]interactive Disable interactive mode
ALIASES
$ sqd gateways ls
```
*See code: [src/commands/gateways/ls.ts](https://github.com/subsquid/squid-cli/blob/master/src/commands/gateways/ls.ts)*
# sqd init
Source: https://docs.sqd.dev/en/sdk/squid-sdk/squid-cli/init
Initialize a new Squid SDK project from a template or GitHub repo with sqd init — choose EVM, Substrate, Solana, Tron, or Fuel starters and scaffold files.
Setup a new squid project from a template or github repo
* [`sqd init NAME`](#sqd-init-name)
## `sqd init NAME`
Setup a new squid project from a template or github repo
```
USAGE
$ sqd init NAME [--interactive] [-t ] [-d ] [-r]
ARGUMENTS
NAME The squid name. It must contain only alphanumeric or dash ("-") symbols and must not start with "-".
FLAGS
-d, --dir=
The target location for the squid. If omitted, a new folder NAME is created.
-r, --remove
Clean up the target directory if it exists
-t, --template=
A template for the squid. Accepts:
- a github repository URL containing a valid squid.yaml manifest in the root folder
or one of the pre-defined aliases:
- evm A minimal squid template for indexing EVM data.
- abi A template to auto-generate a squid indexing events and txs from a contract ABI
- multichain A template for indexing data from multiple chains
- gravatar A sample EVM squid indexing the Gravatar smart contract on Ethereum.
- substrate A template squid for indexing Substrate-based chains.
- ink A template for indexing Ink! smart contracts
- ink-abi A template to auto-generate a squid from an ink! contract ABI
- frontier-evm A template for indexing Frontier EVM chains, like Moonbeam and Astar.
--[no-]interactive
Disable interactive mode
```
*See code: [src/commands/init.ts](https://github.com/subsquid/squid-cli/tree/master/src/commands/init.ts)*
# Installation
Source: https://docs.sqd.dev/en/sdk/squid-sdk/squid-cli/installation
Install the sqd CLI in your local environment — npm install -g, standalone binaries for macOS/Linux/Windows, and shell autocomplete configuration.
Squid CLI is a command line tool for
* scaffolding new squids from templates
* running SDK tools and scripts defined in `commands.json` in a cross-platform way
* managing squid deployments in [SQD Cloud](/en/cloud) (former Aquarium)
The CLI is distributed as a [`npm` package](https://www.npmjs.com/package/@subsquid/cli).
To install Squid CLI, follow the steps below.
First, install the latest version of Squid CLI as a global `npm` package:
```bash theme={"system"}
npm i -g @subsquid/cli@latest
```
Check the version:
```bash theme={"system"}
sqd --version
```
Make sure the output looks like `@subsquid/cli@`.
The next steps are **optional** for building and running squids. A key is required to enable the CLI commands managing the [SQD Cloud](/en/cloud) deployments.
Sign in to [Cloud](https://app.subsquid.io/), and obtain (or refresh) the deployment key page by clicking at the profile picture > "Deployment key":
Open a terminal window and run
```bash theme={"system"}
sqd auth -k
```
Use `sqd --help` to get a list of the available command and `sqd --help` to get help on the available options for a specific command, e.g.
```bash theme={"system"}
sqd deploy --help
```
# sqd list
Source: https://docs.sqd.dev/en/sdk/squid-sdk/squid-cli/list
List squids deployed to SQD Cloud with the sqd ls command — running, stopped, and archived deployments per organization with their slots and tags.
List squids deployed to the Cloud
* [`sqd list`](#sqd-list-1)
## `sqd list`
List squids deployed to the Cloud
```
USAGE
$ sqd list [--interactive] [--truncate]
[-r [/](@|:) | -o | -n | [-s ] | [-t ]]
FLAGS
--[no-]interactive Disable interactive mode
--[no-]truncate Truncate data in columns: false by default
SQUID FLAGS
-n, --name= Name of the squid
-r, --reference=[/](@|:) Fully qualified reference
of the squid. It can include
the organization, name, slot,
or tag
-s, --slot= Slot of the squid
-t, --tag= Tag of the squid
ORG FLAGS
-o, --org= Code of the organization
ALIASES
$ sqd ls
```
*See code: [src/commands/ls.ts](https://github.com/subsquid/squid-cli/tree/master/src/commands/ls.ts)*
# sqd logs
Source: https://docs.sqd.dev/en/sdk/squid-sdk/squid-cli/logs
Fetch live and historical logs from a squid deployed to SQD Cloud with the sqd logs command — filter by container, time range, slot, and tag.
Fetch logs from a squid deployed to the Cloud
* [`sqd logs`](#sqd-logs-1)
## `sqd logs`
Fetch logs from a squid deployed to the Cloud
```
USAGE
$ sqd logs [--interactive] [--since ] [--search ] [-f | -p ]
[-r [/](@|:) | -o | [-s -n ] | [-t ]]
[-c processor|query-node|api|db-migrate|db...]
[-l error|debug|info|warning...] [--since ]
FLAGS
-c, --container=