What SQL features are supported?
CoinbaSeQL supports all standard SQL query features including SELECT statements, WHERE filtering, JOINs, aggregations (COUNT, SUM, AVG, MIN, MAX), subqueries, Common Table Expressions (CTEs), UNION operations, and CASE statements. See the CoinbaSeQL reference for details.What’s the difference between SQL API and Wallet History API?
- SQL API: Write custom SQL queries against any blockchain data (events, transactions, blocks, transfers). Flexible and powerful.
- Wallet History API: Pre-built endpoints for wallet-specific data. Simple and fast for common wallet operations.
Do I need API keys?
- SQL Playground (browser): No API keys needed—just sign in to CDP Portal
- REST API (programmatic): Yes, create free Client API keys
What are the query limits?
- Maximum result set: 50,000 rows
- Query timeout: 30 seconds
- Maximum JOINs: 12 per query
- Query length: 10,000 characters maximum
- Rate limit: 2 queries every second per project (default)
How do I optimize slow queries?
- Use indexed columns in WHERE clauses: For example, when querying
base.events, filter byevent_signatureandaddress. On Solana, filtersolana.transfersbymintandblock_time, orsolana.instructionsbyexecuting_account,instruction_name, andblock_time. Check the schema of each table. - Use specific block ranges: Query smaller ranges by
block_timestamp(Base) orblock_time(Solana) rather than the entire history from genesis. - Filter early: Put selective filters in WHERE clauses.
- Avoid SELECT *: Select only the columns you need.
What happens if my query times out?
If your query exceeds the 30-second timeout, you’ll receive atimed_out error. To fix:
- Filter by indexed columns (
event_signature/addresson Base;mint/executing_account/instruction_nameon Solana) to remove irrelevant rows - Reduce the block range in your WHERE clause via
block_timestamporblock_time - Simplify complex JOINs (avoid
ORin JOINs)
What networks are supported?
SQL API supports Base Mainnet (base.*), Base Sepolia (base_sepolia.*), and Solana Mainnet (solana.*). Tables are always prefixed with the network.
See the schema reference for the full table list on each network. Solana currently exposes a smaller set of tables than Base. See What data is available for Solana? below.
How fresh is the data?
- Base Mainnet and Base Sepolia: Data is typically < 250ms from chain tip, with query response latency < 500ms.
- Solana Mainnet: Data is typically available within a few seconds of chain tip (P99 freshness under 5 seconds).
What data is available for Solana?
At launch, Solana coverage focuses on SPL Token and Token-2022 activity through two tables:solana.transfers— token transfers (including native SOL transfers) projected from transfer instructionssolana.instructions— decoded instruction calls for those programs
What data types does SQL API support?
SQL API uses ClickHouse data types including:- Numeric: UInt8, UInt16, UInt32, UInt64, UInt128, UInt256, Int8, Int16, Int32, Int64, Int128, Int256
- String: String
- Boolean: Bool
- Temporal: Date, DateTime, DateTime64
- Complex: Array, Map, Tuple
How do I handle re-orgs?
Each table includes anaction field:
1or'added': Data was added to the chain-1or'removed': Data was removed due to reorganization
action = 1 or action = 'added'. On Base, the log_id on each row can be used to identify duplicates. On Solana, use instruction_id as the stable identifier across reprocessing.