Created
December 27, 2019 13:59
-
-
Save YazzyYaz/64acfdccfb9cee9179650967be88ff06 to your computer and use it in GitHub Desktop.
ETC/ETH Daily Gas Usage Average
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_avg_gas as ( | |
| SELECT AVG(gas_used) as eth_avg_gas, | |
| TIMESTAMP_TRUNC(timestamp, DAY) as eth_date, | |
| FROM `bigquery-public-data.crypto_ethereum.blocks` | |
| GROUP BY eth_date), | |
| etc_avg_gas as ( | |
| SELECT AVG(gas_used) as etc_avg_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_avg_gas eth | |
| LEFT JOIN etc_avg_gas etc ON eth.eth_date = etc.etc_date | |
| ) | |
| SELECT etc_date as date, | |
| etc_avg_gas AS ETC, | |
| eth_avg_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