Created
October 29, 2018 19:59
-
-
Save phiresky/a6755c650b3bbb340c4d641f89f01b42 to your computer and use it in GitHub Desktop.
bitcoin fees vs block reward 2017
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
fees = await fetch("https://api.blockchain.info/charts/transaction-fees-usd?format=json×pan=2years").then(x => x.json()) | |
year = 2018 | |
filter = x => new Date(1000*x.x) > Date.UTC(year) && new Date(1000*x.x) < Date.UTC(year + 1) | |
totalFees = fees.values.filter(filter).reduce((a,b) => a+b.y, 0) | |
rewards = await fetch("https://api.blockchain.info/charts/miners-revenue?format=json×pan=2years").then(x => x.json()) | |
totalReward = rewards.values.filter(filter).reduce((a,b) => a+b.y, 0) | |
console.log("part that was caused by fees", totalFees/totalReward) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment