Getting Started with Decoded Ethereum Events
This guide will take you through some sample queries working with decoded ethereum events.
Last updated
Was this helpful?
This guide will take you through some sample queries working with decoded ethereum events.
Last updated
Was this helpful?
This guide provides an introduction to the ethereum.core.ez_decoded_event_logs
table via a series of simple queries that explore the data.
Let's familiarize ourselves with the table by first looking at the types of events emitted by the USDC contract in the last week.
As you would expect, the most common event for the USDC token is the Transfer
event. Let us dig a big deeper into the Transfer
event. The human-readable arguments for this event can be found in the decoded_log
column. This column is an object
and must be queried using a specific syntax, demonstrated below.
Now that we know how to work with this data, let's analyze it.
The query above totals the transfer volume by day, for the last week, for USDC. Token amounts on the blockchain almost always require a decimal transformation, which for USDC is 6 places. We'll learn how to pull this in programmatically in the next section where we dig into who is receiving USDC in the last week.
This query utilizes a common-table-expression (CTE) to first pull in the relevant transfers in the last week. Next, we take advantage of the metadata in dim_labels
and dim_contracts
to enrich our analysis. dim_contracts
is the home of decimals and symbols for smart contracts, as well as other metadata. dim_labels
is useful for tagging addresses with human readable names, as well.