Skip to content

Instantly share code, notes, and snippets.

@allenday
Created January 25, 2019 07:39
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save allenday/b0817265e94a36be69e51a1866cc9fd7 to your computer and use it in GitHub Desktop.
Save allenday/b0817265e94a36be69e51a1866cc9fd7 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