Skip to content

Instantly share code, notes, and snippets.

@ParzivalWins
Forked from allenday/zero-fee-bitcoin-tx.sql
Created February 23, 2019 18:52
Show Gist options
  • Save ParzivalWins/cccc06f9fab48af0cc0693b6afc0f5e3 to your computer and use it in GitHub Desktop.
Save ParzivalWins/cccc06f9fab48af0cc0693b6afc0f5e3 to your computer and use it in GitHub Desktop.
Find zero-fee Bitcoin transactions
SELECT
ROUND((input_value - output_value)/ size, 0) AS fees_per_byte,
COUNT(*) AS txn_cnt
FROM
`bigquery-public-data.crypto_bitcoin.transactions`
WHERE TRUE
AND block_timestamp >= '2018-01-01'
AND is_coinbase IS FALSE
GROUP BY 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment