Polygon Mainnet example queries

This page provides Blockchain Analytics query examples for Polygon Mainnet.

See the BigQuery documentation for instructions on using BigQuery.

View the earliest and most recently indexed block

In the Google Cloud console, go to the BigQuery page.

Go to BigQuery

The following query is loaded into the Editor field:

SELECT  MIN(block_number) AS `First block`,  MAX(block_number) AS `Newest block`,  COUNT(1) AS `Total number of blocks` FROM  bigquery-public-data.goog_blockchain_polygon_mainnet_us.blocks; 

The following shows an example result:

First Block Newest Block
0 54794165

Calculate TPS (transactions per second) by month on Polygon mainnet

Go to BigQuery

The following query is loaded into the Editor field:

SELECT  COUNT(*) AS TXN_COUNT_PER_MONTH,  COUNT(*) / 2592000.0 AS TXN_PER_SECOND, # seconds in a month  EXTRACT(YEAR  FROM  txn.block_timestamp) AS YEAR,  EXTRACT(MONTH  FROM  txn.block_timestamp) AS MONTH, FROM  `bigquery-public-data.goog_blockchain_polygon_mainnet_us.transactions` AS txn GROUP BY  EXTRACT(YEAR  FROM  txn.block_timestamp),  EXTRACT(MONTH  FROM  txn.block_timestamp) ORDER BY TXN_COUNT_PER_MONTH DESC; 

The following shows an example result:

TXN_COUNT_PER_MONTH TXN_PER_SECOND YEAR MONTH
113,037,832 43.610274691358022 2024 2
103,680,742 40.0002862654321 2024 1
82,598,612 31.866748456790123 2024 3