v 0.2 of NSR buyback calculation script. Balances of NBT and BTC addresses, and BTC spot price are ready to use.
shell script code
NUD=./nud
$NUD --unit=B getinfo | grep ‘blocks’
$NUD --unit=B getinfo | grep 'moneysupply’
echo Total NBT = XXXX
echo
function nbtBalance { tempval=`curl -s http://blockexplorer.nu/api/addressInfo/$1 | awk ‘BEGIN{RS=","";FS=":"}{print $1,$2}’ | grep totalBalanceInt | awk ‘{print $2}’`;echo Balance of $1 is $tempval NBT; }
function btcBalance { tempval=`curl -s http://btc.blockr.io/api/v1/address/info/$1 | awk ‘BEGIN{RS=","";FS=":"}{print $1,$2}’ | grep balance" | awk ‘{print $2}’`;echo Balance of $1 is $tempval BTC; }
function btcPrice { tempval=`curl -s https://api.bitfinex.com/v1//pubticker/btcusd | awk ‘BEGIN{RS=","";FS=":"}{print $1,$2}’ | grep mid | awk ‘{print $2}’| tr -d "`;echo bitfinex mid price is $tempval USD; }
echo FSRT multisig
nbtBalance BhCnQrYrA5LZm871dtMQEXeU93gmqbhdrC
echo FSRT singlesig
nbtBalance BFTnCyMX1nsTNp6X7Bcm1qVocvShdbwtMi
echo JordanLee singlesig
nbtBalance B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj
echo FLOT 3-of-5 multisig
nbtBalance BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js
echo Total NBT in circulation XXXX
echo
echo BTC
echo
echo Tier 4 buy side funds controlled by FLOT
echo FLOT 5-of-8 multisig old
btcBalance 3QDWJ2yqJ5iTUg6cSpAwxx95ba3NG97hzG
echo FLOT 5-of-8 multisig new
btcBalance 3HikFkS2Zinab1TJq7dqp6wSPyLu7i7bhe
echo Tier 4 buy side funds controlled by JordanLee [174.8 BTC](Supply, Reserves, and Equilibrium)
echo
echo status of sell side gateway:
$NUD getliquidityinfo B | grep BETwD8nSjtj9ADSvej2na34xmsMYwPRymv -A 2
echo status of buy side gateway:
$NUD getliquidityinfo B | grep BFGMPykfKxXZ1otrCZcsbnTwJjKHPP9dsP -A 2
echo
echo As of `date --utc`
btcPrice
echo Tier 4 buy side funds total XXXX BTC, valued $XXXX
echo
echo XXXX excluded from the share buyback calculation equals XXXX BTC.
echo XXXX - XXXX = XXXX BTC sits in the share buyback pool.
echo 10% of this (XXXX) will be used for share buyback next week.
echo That is equivalent to approximately $XXXX.
The output is:
"blocks" : 733851,
"moneysupply" : 3223876.8386,
Total NBT = XXXX
FSRT multisig
Balance of BhCnQrYrA5LZm871dtMQEXeU93gmqbhdrC is 2000000 NBT
FSRT singlesig
Balance of BFTnCyMX1nsTNp6X7Bcm1qVocvShdbwtMi is 103104.7025 NBT
JordanLee singlesig
Balance of B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj is 150000 NBT
FLOT 3-of-5 multisig
Balance of BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js is 160628.65 NBT
Total NBT in circulation XXXX
BTC
Tier 4 buy side funds controlled by FLOT
FLOT 5-of-8 multisig old
Balance of 3QDWJ2yqJ5iTUg6cSpAwxx95ba3NG97hzG is 124 BTC
FLOT 5-of-8 multisig new
Balance of 3HikFkS2Zinab1TJq7dqp6wSPyLu7i7bhe is 142.10575761 BTC
Tier 4 buy side funds controlled by JordanLee [174.8 BTC](https://discuss.nubits
.com/t/nsr-buyback-calculations/3347/51)
status of sell side gateway:
“BETwD8nSjtj9ADSvej2na34xmsMYwPRymv” : {
“buy” : 4268.2873,
“sell” : 7273.11
status of buy side gateway:
“BFGMPykfKxXZ1otrCZcsbnTwJjKHPP9dsP” : {
“buy” : 6500.98,
“sell” : 5647.5302
As of Sat Feb 6 05:54:18 UTC 2016
bitfinex mid price is 371.22 USD
Tier 4 buy side funds total XXXX BTC, valued $XXXX
XXXX excluded from the share buyback calculation equals XXXX BTC.
XXXX - XXXX = XXXX BTC sits in the share buyback pool.
10% of this (XXXX) will be used for share buyback next week.
That is equivalent to approximately $XXXX.
@masterOfDisaster I don’t know how to treat the gateways. The buy side is part of T4 and sell side part of T1?