Last active
October 23, 2017 16:29
-
-
Save jb55/6d4b498512ecaf9927329ba3e84817f3 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
#!/usr/bin/env bash | |
getprice () { | |
# replace with your preferred exchange | |
curl -sL 'https://api.quadrigacx.com/v2/ticker' | jq -r .last | |
} | |
n=${1:-100} | |
size=${2:-226} | |
price=${3:-$(getprice)} | |
for x in $(seq 1 $n) | |
do | |
bitcoin-cli estimatesmartfee $x | |
done \ | |
| sed -e 's,\(0.[0-9]\+\),"\1",g' \ | |
| jq -r "[.feerate, .blocks, (((.blocks * 10)/60)*100 | floor)/100, (.feerate | tonumber | ((. * $size)/1000) * $price) ] | @tsv" \ | |
| sort -n -u -t$'\t' -k1,1 \ | |
| tac \ | |
| column -t -s $'\t' |
Author
jb55
commented
Oct 23, 2017
•
bitcoin-cli settxfee 0.00016504
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment