Last active
November 12, 2018 17:41
-
-
Save PhABC/60f0e8cee8c4a37ada9be5e28089620c 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
/* | |
Calculate the total amount of transaction fee since January 1st 2017 (block 2912407), with weithed | |
average price of Ether as 492. | |
NOTE: Need to divide gas_price by 10 to prevent overflow in BigQuery. | |
*/ | |
SELECT | |
SUM(gas_price/10 * receipt_gas_used) / POWER(10, 17) * 492 | |
FROM | |
`bigquery-public-data.ethereum_blockchain.transactions` AS transactions | |
WHERE TRUE | |
and transactions.block_number >= 2912407 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment