Skip to main content
The SQL API schema is a set of opinionated tables and columns used to organize onchain data for efficient retrieval.

Supported Tables

base.blocks

Block metadata including timestamps, gas usage, and consensus fields.
See an example block on Basescan to understand how blockchain data corresponds to these SQL fields.

base.transactions

Transaction data including hash, block number, gas usage, and signatures.
See an example transaction on Basescan to understand how transaction data corresponds to these SQL fields.
timestamp on base.blocks and base.transactions is DateTime (second precision, server timezone), while block_timestamp on base.events, base.encoded_logs, base.decoded_user_operations, and base.transaction_attributions is DateTime64(3, 'UTC') (millisecond precision, UTC). When joining or comparing timestamps across these tables, cast explicitly (for example, toDateTime64(timestamp, 3, 'UTC')) to avoid precision loss or timezone surprises.

base.events

Decoded event logs with contract interactions on Base.
B20 support: All B20 native token standard events—including token operations, factory deployments, and Policy Registry updates—are decoded into this table. See Query B20 Events for indexed event signatures and example queries.
Schema changes: timestamp has been renamed to block_timestamp, and transaction_index has been removed. To retrieve a log’s transaction position within its block, join to base.transactions on transaction_hash and select transaction_index from there.
See example events on Basescan to see how event logs appear on the blockchain.

base.encoded_logs

Encoded log data of event logs that aren’t able to be decoded by our event decoder (ex: log0 opcode).

base.decoded_user_operations

Decoded ERC-4337 user operations bundled into Base transactions.

base.transaction_attributions

Builder/searcher attribution metadata for Base transactions.