Total Supplies

Availability

This table is available for the Ethereum, Polygon, Arbitrum and Base.

Points-of-PresenceTables

eu-west-1

token_total_supplies_ethereum_mainnet_v1 token_total_supplies_polygon_mainnet_v1 token_total_supplies_arbitrum_mainnet_v1 token_total_supplies_base_mainnet_v1

Methodology

The table is built by the following process:

  1. Identify all Transfer events (shared by ERC-20 and ERC-721) emitted in a block

  2. Call the totalSupply method for each token extracted from these events

Some smart contracts have very inefficient implementations of the totalSupply method. To ensure the timely execution of our indexer, we decided to put a hard cap of gas usage for every totalSupply call we make. The current value is 2000000 gas.

Table Schema

Column NameColumn TypeDescription

chain_name

string

Name of the chain (ethereum, arbitrum, polygon, ...).

chain_network_name

string

name of the network (mainnet).

block_hash

string

Block hash encoded as binary string

block_number

uint64

Block height

timestamp

datetime

UNIX timestamp for when the block was collated

token_address

string

The address of the token

value

uint256

The total supply of the token

Usage

The below query makes use of the token_total_supplies_ethereum_mainnet_v1 to get the maximum total supply of USDC (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48) per day for the last 30 days.

select 
	date_trunc('day', timestamp) as date,
	argMax(value, block_number)
from token_total_supplies_ethereum_mainnet_v1
where token_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
and timestamp >= now() - interval 30 day
group by date
order by date desc

Last updated