Last active
December 27, 2019 13:58
-
-
Save YazzyYaz/eea7bd2d9b1c00cb5ce04830014c5137 to your computer and use it in GitHub Desktop.
ETC/ETH Daily Gas Usage Total
This file contains hidden or 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 ethereum_total_gas as ( | |
| SELECT SUM(gas_used) as eth_sum_gas, | |
| TIMESTAMP_TRUNC(timestamp, DAY) as eth_date, | |
| FROM `bigquery-public-data.crypto_ethereum.blocks` | |
| GROUP BY eth_date), | |
| etc_total_gas as ( | |
| SELECT SUM(gas_used) as etc_sum_gas, | |
| TIMESTAMP_TRUNC(timestamp, DAY) as etc_date, | |
| FROM `bigquery-public-data.crypto_ethereum_classic.blocks` | |
| GROUP BY etc_date | |
| ), | |
| total_transactions_book AS ( | |
| SELECT * | |
| FROM ethereum_total_gas eth | |
| LEFT JOIN etc_total_gas etc ON eth.eth_date = etc.etc_date | |
| ) | |
| SELECT etc_date as date, | |
| etc_sum_gas AS ETC, | |
| eth_sum_gas AS ETH, | |
| FROM total_transactions_book | |
| ORDER by etc_date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment