Created
August 27, 2021 02:43
-
-
Save askeluv/0db353340222c05dad0a3424514662e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH | |
aggregated as ( | |
SELECT | |
TIMESTAMP_SECONDS(300 * DIV(UNIX_SECONDS(block_timestamp) + 150, 300)) AS dt, | |
CASE | |
WHEN transaction_type = 2 THEN 1.0 | |
ELSE 0.0 | |
END as pct_1559 | |
from `bigquery-public-data.crypto_ethereum.transactions` | |
where block_timestamp >= timestamp_sub(current_timestamp(), INTERVAL 24 HOUR) | |
) | |
select | |
dt, | |
AVG(pct_1559) AS pct_1559 | |
from aggregated | |
group by 1 | |
order by 1 DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment