Analyze Real-time Polygon Blockchain Data with Google BigQuery

Hosted by Google Cloud as a financial services public dataset, the Polygon blockchain dataset has been listed in the Google Cloud Marketplace, and can be found here.

Polygon aims to serve as an internet-of-blockchains for Ethereum, bringing massive scale to Ethereum via the Polygon SDK, supporting both standalone blockchains and secured blockchains.

This dataset is part of a larger effort to make cryptocurrency data available in Google BigQuery through the Google Cloud Public Datasets program. The program is hosting a number of real-time cryptocurrency datasets, with plans to expand offerings to include additional distributed ledgers. You can find these datasets by searching for “crypto” in the GCP Marketplace. For analytics interoperability, Google has designed a unified schema that allows all Bitcoin-like datasets to share queries.

This public dataset is hosted in Google BigQuery and is included in BigQuery’s 1TB/mo of free tier processing. This means that each user receives 1TB of free BigQuery processing every month, which can be used to run queries on this public dataset. Watch this short video to learn how to get started quickly using BigQuery to access public datasets.

What is BigQuery?

Google BigQuery makes it simple to query on-chain data in a simple, organized manner on the cloud using standard SQL syntax. You can think of it like a massive indexer that allows you to perform powerful data analysis. You are also able to perform the same or similar queries on multiple blockchains at once and compare them, or track cross-chain activity on interoperable tokens.

Some possibilities unlocked using Google BigQuery on the Polygon Dataset include the ability to:

  • Monitor gas costs over time
  • Monitor a smart contract’s calls and activity
  • Multi-Chain Analysis for SDKs like the Polygon SDK
  • Integrate with traditional financial record processing systems
  • Determine the most active/popular tokens, contracts, or applications on Polygon
  • Audit groups of transactions

Sample Queries to get started with Polygon Data on BigQuery:

  1. You can find out the number of active addresses on Polygon by running this simple query.
# Calculate Active Monthly EOA's from Polygon Transactions
#standardSQL
SELECT
DATE(TIMESTAMP_TRUNC(block_timestamp, MONTH, "UTC")) AS month,
COUNT(DISTINCT from_address) AS active_addresses
FROM `public-data-finance.crypto_polygon.transactions`
GROUP BY month
ORDER BY month DESC

After running the query, you will get the results which can then be exported as CSV/to Google Sheets for further analysis. You can also proceed to use Google Data Studio to generate interactive visualizations based on this data, by clicking on the ‘Explore Data’ button.

Using Google Data Studio to Visualize Query Results

Blockchain analytics platform Nansenalready built a Polygon dashboard that you can check out here.

Example of using BigQuery for Polygon Datasets

Interested in learning more about how the data from these blockchains were brought into BigQuery? Looking for more ways to analyze the data? Check out the Google Cloud Big Data blog post and try the sample queries to get started.

Who made this happen?

It has been a pleasure to work with Helix TechnologiesNansen, and the Google Cloud Developer Relations team on this project.

We look forward to seeing how the vibrant developer community at Polygon uses this powerful platform to bring further utility to their Dapps!

Other relevant links:

About Polygon

Polygon is the first well-structured, easy-to-use platform for Ethereum scaling and infrastructure development. Its core component is Polygon SDK, a modular, flexible framework that supports building and connectingSecured Chains like Plasma, Optimistic Rollups, zkRollups, Validium etc and Standalone Chains like Polygon POS, designed for flexibility and independence. Polygon’s scaling solutions have seen widespread adoption with 350+ Dapps, ~121M txns and ~1M+ unique users.

If you’re an Ethereum Developer, you’re already a Polygon developer! Leverage Polygon’s fast and secure txns for your Dapp, get started here.

More from the Polygon Blog
Polygon Reaches First Sustainability Milestone by Achieving Network Carbon Neutrality

Polygon has made a major first step toward becoming carbon negative with the retirement of $400,000 in carbon credits representing 104,794 tonnes of greenhouse gasses, or the entirety of the network’s CO2 debt since inception.  The milestone comes after Polygon in mid-April released its Green Manifesto, part of its broader vision for sustainable development. The […]

Read More
State of Governance #2: Identity & Reputation

Clink Clank For a period of time, democracy in ancient Athens was exercised in a peculiar way.* Every eligible voter, when entering the hall, would receive a single pebble to be cast in one of two urns during assembly, signifying approval or disapproval on an issue. Athenians, understanding the significance of votes being cast anonymously, […]

Read More
Why Neobanks Will Lead TradFi’s Shift to Web3

Conventional wisdom has it that traditional finance (TradFi) and decentralized finance (DeFi) go together like vampires and garlic. But there is one area of TradFi where that black-and-white picture shades into gray. This is the case for why neobanks will be key to bridging these two worlds. Neobanks, or digital banks, are basically banks without […]

Read More
Polygon ID x Polygon DAO Integration Launches to Create New ZK-based Governance Frameworks

Today, we’re launching the first iteration of Polygon ID - a private and self-sovereign identity solution powered by zero-knowledge cryptography. To start, Polygon ID enables a whole host of features previously inaccessible to DAOs. It will be integrated with Polygon DAO beginning today, and many more DAOs to come soon.  Too often, we’re forced to […]

Read More
Announcing Polygon Pod, a Podcast From the Epicenter of Web3

What’s the future of DeFi? How can blockchain projects shake the reputation for being bad for the environment? What in the world are zero knowledge proofs? How can Web3 attract and accommodate the next billion users? When Flippening? You want to know the answers and so do we. That’s why Polygon is launching Polygon Pod […]

Read More
crossmenuchevron-down-circle