Created
July 23, 2019 06:21
-
-
Save daira/a0d437c0bd9640a3b0959fdaa8172907 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
SELECT alltxs.block_timestamp_month, fulltxs.fully_shielded_count, 100*fulltxs.fully_shielded_count/alltxs.count AS fully_shielded_percent FROM | |
(SELECT | |
block_timestamp_month, count(distinct `hash`) AS fully_shielded_count | |
FROM | |
`bigquery-public-data.crypto_zcash.transactions` AS zec_txs | |
WHERE | |
NOT EXISTS (SELECT 1 FROM UNNEST(zec_txs.inputs) WHERE NOT type = 'shielded') | |
AND NOT EXISTS (SELECT 1 FROM UNNEST(zec_txs.outputs) WHERE NOT type = 'shielded') | |
GROUP BY block_timestamp_month) fulltxs | |
INNER JOIN | |
(SELECT | |
block_timestamp_month, count(distinct `hash`) AS count | |
FROM | |
`bigquery-public-data.crypto_zcash.transactions` AS zec_txs | |
GROUP BY block_timestamp_month) alltxs | |
ON fulltxs.block_timestamp_month = alltxs.block_timestamp_month | |
ORDER BY alltxs.block_timestamp_month |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment