The SQL API schema is a set of opinionated tables and columns used to organize onchain data for efficient retrieval. Developers can view the latest schema by calling our schema endpoint.

Supported Tables

  • base.blocks - Block metadata including timestamps and difficulty.
  • base.events - Decoded event logs with contract interactions on Base.
  • base.transactions - Transaction data including hash, block number, gas usage.
  • base.encoded_logs - Encoded log data of event logs that aren’t able to be decoded by our event decoder (ex: log0 opcode).
  • base.transfers - Token transfer events including block details, addresses, and amounts

base.blocks

Block metadata including timestamps and difficulty.
FieldTypeDescription
block_numberuint64The number of the block
block_hashStringThe unique hash identifying this block
parent_hashStringThe hash of the parent block
timestampDateTimeThe timestamp when this block was created
minerStringThe address of the miner/validator who created this block
nonceuint64The proof-of-work nonce value
sha3_unclesStringThe hash of the uncles list for this block
transactions_rootStringThe root hash of the transactions trie
state_rootStringThe root hash of the state trie
receipts_rootStringThe root hash of the receipts trie
logs_bloomStringThe bloom filter for the logs of the block
gas_limituint64The maximum gas allowed in this block
gas_useduint64The total gas used by all transactions in this block
base_fee_per_gasuint64The base fee per gas in this block (EIP-1559)
total_difficultyStringThe total difficulty of the chain up to this block
sizeuint64The size of this block in bytes
extra_dataStringExtra data field for this block
mix_hashStringThe mix hash for this block
withdrawals_rootStringThe root hash of withdrawals (post-merge)
parent_beacon_block_rootStringThe parent beacon block root (post-merge)
blob_gas_useduint64The amount of blob gas used in this block
excess_blob_gasuint64The excess blob gas in this block
transaction_countuint64The number of transactions in this block
actionInt8Indicates if block was added (1) or removed (-1) due to chain reorganization

base.events

Decoded event logs with contract interactions on Base.
FieldTypeDescription
block_numberuint64The block number
block_hashStringA keccak-256 (SHA-3) hash of the block’s header data. Unique to the block’s contents. Used to verify the integrity of the block
timestampDateTime64Time at which the block was created
transaction_hashStringA keccak-256 hash of the signed transaction data. Unique identifier, on the blockchain, for this specific transaction
transaction_toStringThe address the transaction is acting against. Could be either an EOA (ex: ETH transfer) or a contract (ex: smart contract call)
transaction_fromStringThe address that originated the transaction. Will be an EOA
transaction_indexuint64The order in which the transaction was included in the block. Commonly used to match transactions to their logs
log_indexuint64The index of the log within the transaction. First log is in the transaction at index 0, second is index 1, etc
addressStringThe address of the contract that the log was created from
topicsArray(String)The topics of the log. Topics are the indexed parameters of the event and the keccak256 hash of the event signature
event_nameStringHuman-readable name of the event
event_signatureStringFull canonical declaration of the event, including its name and parameter types. Used to generate the hash
parametersMap(String, Variant(Bool, Int256, String, uint256))Map of parameter name to its value
parameter_typesMap(String, String)Map of parameter name to its ABI type
actionInt8If the log is created, it is 1. If the log is re-orged out it is -1. If the sum of all actions for a given log is greater than 0, the log is “active”, meaning it is still in the chain (has not been re-orged out)

base.transactions

Transaction data including hash, block number, gas usage.
FieldTypeDescription
block_numberuint64The number of the block that contains this transaction
block_hashStringThe hash of the block that contains this transaction
transaction_hashStringThe unique hash identifying this transaction
transaction_indexuint64The index position of this transaction within its block
from_addressStringThe address that originated this transaction
to_addressStringThe destination address for this transaction
valueStringThe value being transferred in this transaction
gasuint64The amount of gas allocated for this transaction
gas_priceuint64The price of gas (in wei) for this transaction
inputStringThe data payload sent with this transaction
nonceuint64The number of transactions sent from this address before this one
typeuint64The transaction type
max_fee_per_gasuint64The maximum fee per gas the sender is willing to pay
max_priority_fee_per_gasuint64The maximum priority fee per gas the sender is willing to pay
chain_iduint64The chain ID this transaction is valid for
vStringThe v component of the transaction signature
rStringThe r component of the transaction signature
sStringThe s component of the transaction signature
is_system_txBoolWhether this is a system transaction
max_fee_per_blob_gasStringThe maximum fee per blob gas the sender is willing to pay
blob_versioned_hashesArray(String)Array of versioned hashes for any blobs associated with this transaction
timestampDateTime64The timestamp when this transaction was included in a block
actionInt8Indicates if transaction was added (1) or removed (-1) due to chain reorganization

base.encoded_logs

Encoded log data of event logs that aren’t able to be decoded by our event decoder (ex: log0 opcode).
FieldTypeDescription
block_numberuint64The number of the block that the log is in
block_hashStringThe hash of the block that the log is in
block_timestampDateTime64The timestamp of the block that the log is in
transaction_hashStringThe hash of the transaction that the log is in
transaction_toStringThe address the transaction is acting against. Could be either an EOA (ex: ETH transfer) or a contract (ex: smart contract call)
transaction_fromStringThe address that originated the transaction. Will be an EOA
log_indexuint32The index of the log within the transaction. First log is in the transaction at index 0, second is index 1, etc
addressStringThe address of the contract that the log was created from
topicsArray(String)The topics of the log. Topics are the indexed parameters of the event and the keccak256 hash of the event signature
actionEnum8(‘removed’ = -1, ‘added’ = 1)If the log is created, it is 1. If the log is re-orged out it is -1. If the sum of all actions for a given log is greater than 0, the log is “active”, meaning it is still in the chain (has not been re-orged out)

base.transfers

Token transfer events including block details, addresses, and amounts
FieldTypeDescription
block_numberuint64Block number containing the transfer
block_timestampDateTime64Block timestamp
transaction_toStringTransaction recipient address
transaction_fromStringTransaction sender address
log_indexuint32Log index within the transaction
token_addressStringAddress of the token contract
from_addressStringAddress tokens are transferred from
to_addressStringAddress tokens are transferred to
valueuint256Amount of tokens transferred
actionEnum8Action: 1 for add, -1 for re-org removal