Skip to main content

Schema Reference

The GraphQL API provides access to ERC token data through nine tables. This page details the available fields, data types, and relationships. The generated erc schema reference lists every column with its Postgres and GraphQL type.

TableContents
erc_tokenOne row per token contract, all standards
erc_token_accountBalances for ERC-20, ERC-721, ERC-1400, and ERC-3643
erc_token_partition_balanceERC-1400 balances per partition
erc_multi_token_accountERC-1155 balances per token type (sub_token_id)
erc_nftIndividual ERC-721 NFTs
erc_token_transferERC-20, ERC-1400, and ERC-3643 transfer history
erc_nft_transferERC-721 transfer history
erc_multi_token_transferERC-1155 transfer history
erc_watermarkIndexer progress, for freshness checks

erc_token​

Stores metadata for pure ERC token contracts deployed to Hedera's EVM.

Fields​

FieldTypeDescription
token_idbigintHedera entity ID for the contract
token_evm_addressstringContract's EVM address (0x format)
contract_typestringToken standard; see Contract Types
namestringToken name
symbolstringToken symbol
decimalsbigintDecimal places (fungible standards; NULL for ERC-721)
total_supplynumericTotal token supply (handles uint256 values)
metadata_reliability_scoredecimalQuality score from 0.00 to 1.00
created_timestampbigintContract creation time (nanoseconds since epoch)
processing_timestampbigintLast processing time (nanoseconds since epoch)
transfers_indexed_timestampbigintLast indexed transfer timestamp (nanoseconds, NULL if not indexed)
balance_accruesbooleanTrue for interest-bearing tokens whose balances grow without Transfer events

Token Features​

  • Primary storage for token contract metadata
  • Classifies each contract as ERC-20, ERC-721, ERC-1155, ERC-1400, or ERC-3643
  • Includes reliability scoring for metadata quality
  • balance_accrues marks Aave-style interest-bearing and debt tokens (detected by scaledTotalSupply()); their balances are refreshed on a timer, so they can trail the chain by up to about 15 minutes

erc_token_account​

Tracks ERC-20, ERC-1400, and ERC-3643 balances and ERC-721 ownership counts.

Fields​

FieldTypeDescription
account_idbigintHolder's Hedera account ID; NULL for a holder with no Hedera account
holder_evm_addresstextHolder's EVM address, set only when account_id is NULL
holder_keytextaccount_id as text, or holder_evm_address for accountless holders
token_idbigintReferences erc_token
token_evm_addresstextToken contract's EVM address
balancenumericBalance in the smallest unit (wei), or NFT count for ERC-721
balance_timestampbigintLast balance update (nanoseconds since epoch)
created_timestampbigintFirst association time (nanoseconds since epoch)
associatedbooleanAlways true for pure ERC tokens

Account Features​

  • Balances come from the contract's own balanceOf(), not from summing Transfer events
  • An EVM address that maps to a Hedera account (account-num alias or ECDSA alias) is stored by account_id; both forms of one account collapse to a single row
  • A holder with no Hedera account (an ECDSA address that was never activated) is still included: account_id is NULL and holder_evm_address identifies it. Filtering only on account_id misses these holders
  • For ERC-1400, balance is the transferable balance from balanceOf(); the per-partition split is in erc_token_partition_balance
  • Primary key: (token_id, holder_key)

erc_token_partition_balance​

ERC-1400 balances per partition, computed from the partition events (IssuedByPartition, TransferByPartition, RedeemedByPartition).

Fields​

FieldTypeDescription
token_idbigintReferences the ERC-1400 contract in erc_token
account_idbigintHolder's Hedera account ID; NULL for a holder with no Hedera account
holder_evm_addresstextHolder's EVM address, set only when account_id is NULL
holder_keytextaccount_id as text, or holder_evm_address
partition_idtextPartition identifier, 0x hex with leading zero bytes stripped
balancenumericBalance in the partition
balance_timestampbigintConsensus time of the last partition event counted

erc_multi_token_account​

ERC-1155 balances: one row per holder per token type.

Fields​

FieldTypeDescription
token_idbigintReferences the ERC-1155 contract in erc_token
sub_token_idnumericThe ERC-1155 token type ID (full uint256 range)
account_idbigintHolder's Hedera account ID; NULL for a holder with no Hedera account
holder_evm_addresstextHolder's EVM address, set only when account_id is NULL
holder_keytextaccount_id as text, or holder_evm_address
balancenumericBalance of this token type, from balanceOf(address, id)
balance_timestampbigintLast balance update (nanoseconds since epoch)
created_timestampbigintFirst association time (nanoseconds since epoch)
token_evm_addresstextToken contract's EVM address

erc_nft​

Tracks individual NFTs within ERC-721 collections.

Fields​

FieldTypeDescription
token_idbigintReferences the ERC-721 contract in erc_token
serial_numbernumericThe individual NFT's tokenId (supports full uint256 range)
account_idbigintCurrent owner's Hedera account ID (NULL for unresolved addresses)
deletedbooleanBurn status (true if NFT was burned)
metadatabyteaThe tokenURI value (e.g., ipfs://... or https://...)
created_timestampbigintWhen NFT was first minted (nanoseconds since epoch)
processing_timestampbigintWhen this record was processed (nanoseconds since epoch)

NFT Features​

  • Individual NFT ownership tracking by tokenId
  • tokenURI captured for each NFT
  • Burn status tracking via deleted flag
  • Supports full uint256 range for tokenIds
note

Many NFTs have NULL account_id values. This occurs when the owner is an EVM address with no Hedera account. Ownership counts for those owners still appear in erc_token_account, keyed by holder_evm_address.

erc_token_transfer​

Stores transfer history for ERC-20, ERC-1400, and ERC-3643 tokens.

Fields​

FieldTypeDescription
token_idbigintHedera contract ID for the token
consensus_timestampbigintTransfer time (nanoseconds since epoch)
log_indexintegerEvent index within transaction
token_evm_addresstextEVM address of token contract
contract_typevarcharThe token's standard: ERC_20, ERC_1400, or ERC_3643
transaction_hashtextTransaction hash
payer_account_idbigintHedera account ID of transaction payer
payer_evm_addresstextEVM address of payer
transfer_typevarcharSee Transfer Types
sender_account_idbigintSender's Hedera account ID, when the event carried one
sender_evm_addresstextSender's EVM address
receiver_account_idbigintReceiver's Hedera account ID, when the event carried one
receiver_evm_addresstextReceiver's EVM address
amountnumericTransfer amount in smallest unit (wei)
partition_idtextERC-1400 partition identifier (NULL for other standards)
operator_account_idbigintOperator account ID (ERC-1400 partition events only)
operator_evm_addresstextOperator EVM address (ERC-1400 partition events only)

Account ID Resolution​

warning

In the transfer tables, *_account_id is filled only when the event itself carried a Hedera account number (a long-zero address). Transfers between ECDSA addresses, which are most of them, store only *_evm_address. To find an account's transfers, match on its EVM address as well as its account ID; see Account Transfer History.

Transfer Types​

TypeStandardDescription
transferERC-20, ERC-1400, ERC-3643Standard token transfer
mintERC-20, ERC-1400, ERC-3643Token creation; sender_account_id is 0 (the zero address)
burnERC-20, ERC-1400, ERC-3643Token destruction; receiver_account_id is 0 (the zero address)
partition_mintERC-1400 onlyIssuance to a partition (IssuedByPartition); no sender
partition_transferERC-1400 onlyTransfer within a partition (TransferByPartition)
partition_burnERC-1400 onlyRedemption from a partition (RedeemedByPartition); no receiver
note

An ERC-1400 contract emits both a standard Transfer event and a partition event for the same movement, so its history contains both a mint/transfer/burn row and a partition_* row. To total volume, count one family, not both.

erc_nft_transfer​

Stores transfer history for ERC-721 NFTs.

Fields​

FieldTypeDescription
token_idbigintHedera contract ID for the NFT collection
serial_numbernumericNFT tokenId within the collection
consensus_timestampbigintTransfer time (nanoseconds since epoch)
log_indexintegerEvent index within transaction
token_evm_addresstextEVM address of NFT contract
transaction_hashtextTransaction hash
payer_account_idbigintHedera account ID of transaction payer
payer_evm_addresstextEVM address of payer
transfer_typevarcharType: transfer, mint, burn
sender_account_idbigintSender's Hedera account ID, when the event carried one
sender_evm_addresstextSender's EVM address
receiver_account_idbigintReceiver's Hedera account ID, when the event carried one
receiver_evm_addresstextReceiver's EVM address

erc_multi_token_transfer​

Stores ERC-1155 transfer history from TransferSingle and TransferBatch events. A batch event produces one row per token type it moves.

Fields​

FieldTypeDescription
token_idbigintHedera contract ID for the ERC-1155 contract
sub_token_idnumericThe ERC-1155 token type ID
consensus_timestampbigintTransfer time (nanoseconds since epoch)
log_indexintegerEvent index within transaction
token_evm_addresstextEVM address of the contract
transaction_hashtextTransaction hash
payer_account_idbigintHedera account ID of transaction payer
payer_evm_addresstextEVM address of payer
transfer_typevarcharType: transfer, mint, burn
sender_account_idbigintSender's Hedera account ID, when the event carried one
sender_evm_addresstextSender's EVM address
receiver_account_idbigintReceiver's Hedera account ID, when the event carried one
receiver_evm_addresstextReceiver's EVM address
operator_account_idbigintOperator's Hedera account ID, when the event carried one
operator_evm_addresstextOperator's EVM address
amountnumericAmount of this token type moved

erc_watermark​

Indexer progress. Every transfer event at or before last_processed_ns for the transfer_indexing job is present in the transfer tables.

FieldTypeDescription
job_nametexttransfer_indexing for the live indexer
last_processed_nsbigintConsensus time indexed up to (nanoseconds)
last_processed_ns_iso8601textThe same time as an ISO 8601 string
updated_attimestamptzWhen the watermark last moved

Data Types and Constraints​

Numeric Types​

  • BIGINT: Used for Hedera IDs, timestamps, and counts
  • NUMERIC: Used for balances, supplies, and ERC-1155 token type IDs (handles uint256 values up to 2^256-1)
  • DECIMAL(3,2): Used for reliability scores (0.00 to 1.00)

Timestamp Formats​

All timestamps use nanoseconds since epoch (Hedera format):

  • created_timestamp: Contract/entity creation time
  • balance_timestamp: Last balance update time
  • processing_timestamp: When the record was processed/synced
  • transfers_indexed_timestamp: Last indexed transfer time
  • consensus_timestamp: Transaction consensus time (transfer tables)

Contract Types​

Values of the contract_type field:

  • ERC_20: ERC-20 fungible token
  • ERC_721: ERC-721 NFT collection
  • ERC_1155: ERC-1155 multi-token contract
  • ERC_1400: ERC-1400 security token
  • ERC_3643: ERC-3643 (T-REX) permissioned token

Relationships​

These GraphQL relationships can be nested in a query:

FromFieldTo
erc_tokennfterc_nft (many)
erc_tokentoken_partition_balanceerc_token_partition_balance (many)
erc_tokenmulti_token_accounterc_multi_token_account (many)
erc_token_accounttokenerc_token (one)
erc_token_accountnftthat holder's erc_nft rows (many)
erc_token_partition_balancetokenerc_token (one)
erc_multi_token_accounttokenerc_token (one)
erc_multi_token_transfertokenerc_token (one)

The fungible and NFT transfer tables have no relationships; join them to erc_token by token_id in a separate query.

Query Examples​

Get a token's holders with token metadata​

query GetTokenHolders($tokenId: bigint!) {
erc_token_account(
where: { token_id: { _eq: $tokenId }, balance: { _gt: "0" } }
order_by: { balance: desc }
limit: 100
) {
account_id
holder_evm_address
balance
balance_timestamp
token {
name
symbol
decimals
}
}
}

Get NFT collection with individual NFTs​

query GetNFTCollection($tokenId: bigint!) {
erc_token_by_pk(token_id: $tokenId) {
token_id
name
symbol
total_supply
nft(where: { deleted: { _eq: false } }, order_by: { serial_number: asc }, limit: 100) {
serial_number
account_id
metadata
created_timestamp
}
}
}

Get an ERC-1155 contract's holders by token type​

query GetMultiTokenHolders($tokenId: bigint!) {
erc_multi_token_account(
where: { token_id: { _eq: $tokenId }, balance: { _gt: "0" } }
order_by: [{ sub_token_id: asc }, { balance: desc }]
) {
sub_token_id
account_id
holder_evm_address
balance
}
}

For more comprehensive query examples, see the Query Examples page.