Skip to content

Instantly share code, notes, and snippets.

@allenday
Created May 26, 2019 08:11
Show Gist options
  • Save allenday/b7867cc0db76b810dee2ab9215e0512d to your computer and use it in GitHub Desktop.
Save allenday/b7867cc0db76b810dee2ab9215e0512d to your computer and use it in GitHub Desktop.
Ethereum gas price by date from BigQuery
SELECT CAST('2019-04-01' AS DATE) AS d, AVG(gas_used) AS gas
FROM `bigquery-public-data.crypto_ethereum.blocks`
WHERE TRUE
AND timestamp >= TIMESTAMP('2019-04-01')
AND timestamp <= TIMESTAMP(DATE_ADD(CAST('2019-04-01' AS DATE), INTERVAL 1 DAY))
GROUP BY d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment