blockchain-etl/awesome-bigquery-views
blockchain-etl/awesome-bigquery-views has 213 GitHub stars and 37 forks. GitHot measured 0 stars in 24 hours, 0 in 7 days, and 0 in 15 days. Last checked 2026-11-11 11:59 UTC. Last push 2022-11-06.
Useful SQL queries for Blockchain ETL datasets in BigQuery.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAwesome BigQuery Views
Here are some examples of how to derive insights from on-chain crypto data. Not all networks have examples here - you can find the complete list of crypto datasets in blockchain-etl/public-datasets
Top Ethereum Balances
WITH double_entry_book AS (
-- debits
SELECT to_address AS address, value AS value
FROM `bigquery-public-data.crypto_ethereum.traces`
WHERE to_address IS NOT NULL
AND status = 1
AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS NULL)
UNION ALL
-- credits
SELECT from_address AS address, -value AS value
FROM `bigquery-public-data.crypto_ethereum.traces`
WHERE from_address IS NOT NULL
AND status = 1
AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS NULL)
UNION ALL
-- transaction fees debits
SELECT
miner AS address,
SUM(CAST(receipt_gas_used AS numeric) * CAST((receipt_effective_gas_price - COALESCE(base_fee_per_gas, 0)) as numeric)) AS value
FROM `bigquery-public-data.crypto_ethereum.transactions` AS transactions
join `bigquery-public-data.crypto_ethereum.blocks` AS blocks ON blocks.number = transactions.block_number
GROUP BY blocks.number, blocks.miner
UNION ALL
-- transaction fees credits
SELECT
from_address AS address,
-(CAST(receipt_gas_used AS numeric) * CAST(receipt_effective_gas_price AS numeric)) AS value
FROM `bigquery-public-data.crypto_ethereum.transactions`
)
SELECT address, SUM(value) AS balance
FROM double_entry_book
GROUP BY address
ORDER BY balance DESC
LIMIT 1000
Alternatively query bigquery-public-data.crypto_ethereum.balances (updated daily), e.g.:
SELECT *
FROM `bigquery-public-data.crypto_ethereum.balances`
WHERE SEARCH(address, '0x0cfb686e114d478b055ce8614621f8bb62f70360', analyzer=>'NO_OP_ANALYZER');
Every Ethereum Balance on Every Day
WITH double_entry_book AS (
-- debits
SELECT to_address AS address, value AS value, block_timestamp
FROM `bigquery-public-data.crypto_ethereum.traces`
WHERE to_address IS NOT NULL
AND status = 1
AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS NULL)
UNION ALL
-- credits
SELECT from_address AS address, -value AS value, block_timestamp
FROM `bigquery-public-data.crypto_ethereum.traces`
WHERE from_address IS NOT NULL
AND status = 1
AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS NULL)
UNION ALL
-- transaction fees debits
SELECT
miner AS address,
SUM(CAST(receipt_gas_used AS numeric) * CAST((receipt_effective_gas_price - COALESCE(base_fee_per_gas, 0)) AS numeric)) AS value,
block_timestamp
FROM `bigquery-public-data.crypto_ethereum.transactions` AS transactions
JOIN `bigquery-public-data.crypto_ethereum.blocks` AS blocks ON blocks.number = transactions.block_number
GROUP BY blocks.number, blocks.miner, block_timestamp
UNION ALL
-- transaction fees credits
SELECT
from_address AS address,
-(CAST(receipt_gas_used AS numeric) * CAST(receipt_effective_gas_price AS numeric)) AS value,
block_timestamp
FROM `bigquery-public-data.crypto_ethereum.transactions`
),
double_entry_book_grouped_by_date AS (
SELECT address, SUM(value) AS balance_increment, DATE(block_timestamp) AS date
FROM double_entry_book
GROUP BY address, date
),
daily_balances_with_gaps AS (
SELECT address, date, SUM(balance_increment) OVER (PARTITION BY address ORDER BY date) AS balance,
LEAD(date, 1, CURRENT_DATE()) OVER (PARTITION BY address ORDER BY date) AS next_date
FROM double_entry_book_grouped_by_date
),
calendar AS (
SELECT date FROM UNNEST(GENERATE_DATE_ARRAY('2015-07-30', CURRENT_DATE())) AS date
),
daily_balances AS (
SELECT address, calendar.date, balance
FROM daily_balances_with_gaps
JOIN calendar ON daily_balances_with_gaps.date <= calendar.date AND calendar.date < daily_balances_with_gaps.next_date
)
SELECT address, date, balance
FROM daily_balances
Related article: https://medium.com/google-cloud/plotting-ethereum-address-growth-chart-55cc0e7207b2
Transaction Throughput Comparison
WITH bitcoin_throughput AS (
-- takes transactions count in every block and divides it by average block time on that day
SELECT 'bitcoin' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_bitcoin.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
),
bitcoin_cash_throughput AS (
SELECT 'bitcoin_cash' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_bitcoin_cash.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
),
ethereum_throughput AS (
SELECT 'ethereum' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_ethereum.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
),
ethereum_classic_throughput AS (
SELECT 'ethereum_classic' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_ethereum_classic.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
),
dogecoin_throughput AS (
SELECT 'dogecoin' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_dogecoin.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
),
litecoin_throughput AS (
SELECT 'litecoin' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_litecoin.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
),
dash_throughput AS (
SELECT 'dash' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_dash.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
),
zcash_throughput AS (
SELECT 'zcash' AS chain, count(*) / (24 * 60 * 60 / count(*) OVER (PARTITION BY DATE(block_timestamp))) AS throughput, block_timestamp AS time
FROM `bigquery-public-data.crypto_zcash.transactions` AS transactions
GROUP BY transactions.block_number, transactions.block_timestamp
ORDER BY throughput DESC
LIMIT 1
)
SELECT * FROM bitcoin_throughput
UNION ALL
SELECT * FROM bitcoin_cash_throughput
UNION ALL
SELECT * FROM ethereum_throughput
UNION ALL
SELECT * FROM ethereum_classic_throughput
UNION ALL
SELECT * FROM dogecoin_throughput
UNION ALL
SELECT * FROM litecoin_throughput
UNION ALL
SELECT * FROM dash_throughput
UNION ALL
SELECT * FROM zcash_throughput
ORDER BY throughput DESC
Related article: https://medium.com/@medvedev1088/comparing-transaction-throughputs-for-8-blockchains-in-google-bigquery-with-google-data-studio-edbabb75b7f1
More Queries
| Network | Description | Query | Screenshot | BigQuery | DataStudio | Notes |
|---|---|---|---|---|---|---|
| Band | Latest oracle prices | 📝 | 🔍 | |||
| Band | Log types by transaction | 📝 | 🔍 | |||
| Bitcoin | Top 1K addresses, by balance | 📝 | 🔍 | 📊 | ||
| Bitcoin | Bitcoin Gini index, by day | 📝 | 🔍 | 📊 | [1] | |
| Ethereum | Every account balance on every day | 📝 | 🔍 | 📊 | [1] | |
| Ethereum | Ether supply by day | 📝 | 🖼️ | 🔍 | 📊 | [1] |
| Ethereum | Shortest path between addresses | 📝 | 🔍 | ❌ | ||
| Zilliqa | Shortest path between addresses v2 | 📝 | 🔍 | ❌ |
Check out this awesome repository: https://github.com/RokoMijic/awesome-bigquery-views
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,830 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,395 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,473 스타