Supply, Reserves, and Equilibrium (superseded by automation)

You intend to put the script into crontab? Running it later could lead to wrong balances if funds get moved after end of Friday UTC.

It only causes small deltas. I will worry about it later.

Tier 4 BTC held by me remains unchanged at 174.8 BTC:

I have figured it out i think. blockexplorer.nu is down now.

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?

3 Likes

Short answer: I concur with you.

I think there’s some room for interpretation, but I consider the gateway NBT as part of NBT in circulation and the BTC there as part of the T4 reserves, although they are on T1.1 and T2.

I’ll try that script :wink:
Automation of stupid tasks is welcome!
Thank you for creating it!

I will skip them for now.

v0.3

First the full output:

As of Sat Feb 6 12:28:23 UTC 2016
"blocks" : 734247,
Total NBT = 3223876.6386

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 is 810143.286100 NBT.
Required 15% reserve is 121521.492915 NBT

Tier 4 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

status of sell side gateway:
“BETwD8nSjtj9ADSvej2na34xmsMYwPRymv” : {
“buy” : 4317.96,
“sell” : 7273.609
status of buy side gateway:
“BFGMPykfKxXZ1otrCZcsbnTwJjKHPP9dsP” : {
“buy” : 6595.22,
“sell” : 5647.5302

bitfinex mid price is 374.33 USD
Tier 4 buy side funds total 440.905758 BTC, valued $165044.252246
121521.492915 NBT excluded from the share buyback calculation equals 324.637333 BTC.
440.905758 - 324.637333 = 116.268424 BTC sits in the share buyback pool.
10 percent of this – 11.626842 BTC-- will be used for share buyback next week.
That is equivalent to approximately $4352.275933.

Here is the code.

NUD=./nud

echo As of `date --utc`

$NUD --unit=B getinfo | grep 'blocks'
totalNBT=`$NUD --unit=B getinfo | awk '$1 ~ /moneysupply/{print $3}' | tr -d ,`
echo Total NBT = $totalNBT
echo $totalNBT > templist
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 $tempval >> templist

echo FSRT singlesig
nbtBalance BFTnCyMX1nsTNp6X7Bcm1qVocvShdbwtMi
echo $tempval >> templist

echo JordanLee singlesig
nbtBalance B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj
echo $tempval >> templist

echo FLOT 3-of-5 multisig
nbtBalance BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js
echo $tempval >> templist

#cat templist
# calc the first line minus rest of the lines
circNBT=`awk  '{if(n) c-=$1; else {c=$1;n=1}}END{printf "%f",c;printf "%f",c*0.15 > "reserve"}' templist`

echo
echo Total NBT in circulation is $circNBT NBT.
echo Required 15% reserve is `cat reserve` NBT
echo

echo **Tier 4 BTC**
echo
echo Tier 4 buy side funds controlled by FLOT
echo FLOT 5-of-8 multisig old
btcBalance 3QDWJ2yqJ5iTUg6cSpAwxx95ba3NG97hzG
echo $tempval > templist

echo FLOT 5-of-8 multisig new
btcBalance 3HikFkS2Zinab1TJq7dqp6wSPyLu7i7bhe
echo $tempval >> templist

echo Tier 4 buy side funds controlled by JordanLee [174.8 BTC]\(https://discuss.nubits.com/t/nsr-buyback-calculations/3347/51\)
echo 174.8 >> templist

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
btcPrice
bp=$tempval

awk  '{c+=$1}END{\
printf "Tier 4 buy side funds total %f BTC, valued $%f\n",c,c*BTCP;\
printf "%f NBT excluded from the share buyback calculation equals %f BTC.\n",RES,RES/BTCP;\
pool=c-RES/BTCP;\
printf "%f - %f = %f BTC sits in the share buyback pool.\n",c,RES/BTCP,pool;\
printf "10 percent of this **-- %f BTC-- will be used for share buyback next week.**\n",pool*0.1;\
printf "That is equivalent to approximately $%f.\n",pool*0.1*BTCP;\
}' RES=`cat reserve` BTCP=$bp templist
2 Likes

Gateways should not be considered T4 as we can lose them with exchange insolvency. I feel strongly about this and will draft it as a motion if necessary.

1 Like

I think I agree with both statements.

1 Like

@Nagalim’s statement include bitcoins in the buy wall of gateways. That makes the difference.

@Nagalim how about the #20 buyback?

1 more signer needed.

Last week I held 174.8 BTC. 32 BTC was spent at NuLagoon Tube this week, making my new total 142.8 BTC.

1 Like

Nushare buyback calculation v0.4:
update Jordan Lee’s T4 BTC holdings; comment out gateways; add NuSafe

Please check.

output
As of Sat Feb 13 06:38:12 UTC 2016
"blocks" : 743672,
Total NBT = 1273086.9845

FSRT multisig
Balance of BhCnQrYrA5LZm871dtMQEXeU93gmqbhdrC is 0 NBT
FSRT singlesig
Balance of BFTnCyMX1nsTNp6X7Bcm1qVocvShdbwtMi is 151500 NBT
JordanLee singlesig
Balance of B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj is 150000 NBT
FLOT 3-of-5 multisig
Balance of BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js is 175714.0616 NBT

Total NBT in circulation is 795872.922900 NBT.
Required 15% reserve is 119380.938435 NBT

Tier 4 BTC

Tier 4 buy side funds controlled by FLOT
FLOT 5-of-8 multisig old
Balance of 3QDWJ2yqJ5iTUg6cSpAwxx95ba3NG97hzG is 0 BTC
FLOT 5-of-8 multisig new
Balance of 3HikFkS2Zinab1TJq7dqp6wSPyLu7i7bhe is 158.49818542 BTC
Tier 4 buy side funds controlled by JordanLee 142.8 BTC
NuSafe has $30000 for T4

bitfinex mid price is 389.14 USD
Tier 4 buy side funds total 301.298185 BTC and $30000.000000, valued $147247.175874 (378.391262 BTC)

119380.938435 NBT excluded from the share buyback calculation equals 306.781463 BTC.
378.391262 - 306.781463 = 71.609800 BTC sits in the share buyback pool.
10 percent of this 7.160980 BTC will be used for share buyback next week.
That is equivalent to approximately $2786.623744.

code
bash script (working in cygwin on windows)

# Nushare buyback calculation v0.4
# mhps 2016
# change log
# v0.4 update Jordan Lee's T4 BTC holdings; comment out gateways; add NuSafe
# v0.3 https://discuss.nubits.com/t/nsr-buyback-calculations/3347/56
# relace this to how nud is run locally
NUD=./daemon/nd

echo As of `date --utc`

$NUD --unit=B getinfo | grep 'blocks'
totalNBT=`$NUD --unit=B getinfo | awk '$1 ~ /moneysupply/{print $3}' | tr -d ,`
echo Total NBT = $totalNBT
echo $totalNBT > templist
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 $tempval >> templist

echo FSRT singlesig
nbtBalance BFTnCyMX1nsTNp6X7Bcm1qVocvShdbwtMi
echo $tempval >> templist

echo JordanLee singlesig
nbtBalance B5Zi5XJ1sgS6mWGu7bWJqGVnuXwiMXi7qj
echo $tempval >> templist

echo FLOT 3-of-5 multisig
nbtBalance BqyRzFtWXDmjxrYpyJD42MLE5xc8FrB4js
echo $tempval >> templist

#cat templist
# calc the first line minus rest of the lines
circNBT=`awk  '{if(n) c-=$1; else {c=$1;n=1}}END{printf "%f",c;printf "%f",c*0.15 > "reserve"}' templist`

echo
echo Total NBT in circulation is $circNBT NBT.
echo Required 15% reserve is `cat reserve` NBT
echo

echo **Tier 4 BTC**
echo
echo Tier 4 buy side funds controlled by FLOT
echo FLOT 5-of-8 multisig old
btcBalance 3QDWJ2yqJ5iTUg6cSpAwxx95ba3NG97hzG
echo $tempval > templist

echo FLOT 5-of-8 multisig new
btcBalance 3HikFkS2Zinab1TJq7dqp6wSPyLu7i7bhe
echo $tempval >> templist

jltbc=142.8
echo Tier 4 buy side funds controlled by JordanLee [$jltbc BTC]\(https://discuss.nubits.com/t/nsr-buyback-calculations/3347/62\)
echo $jltbc >> templist

nuSafe=30000
echo NuSafe has [\$$nuSafe]\(https://discuss.nubits.com/t/flot-operations-buy-side-btc-related/3117/317\) for T4

# 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
btcPrice
bp=$tempval

awk  '{c+=$1}END{\
printf "Tier 4 buy side funds total %f BTC and $%f, valued $%f (%f BTC)\n\n",c,NS,c*BTCP+NS,c+NS/BTCP;\
printf "%f NBT excluded from the share buyback calculation equals %f BTC.\n",RES,RES/BTCP;\
pool=c+NS/BTCP-RES/BTCP;\
printf "%f - %f = %f BTC sits in the share buyback pool.\n",c+NS/BTCP,RES/BTCP,pool;\
printf "10 percent of this **%f BTC will be used for share buyback next week.**\n",pool*0.1;\
printf "That is equivalent to approximately $%f.\n",pool*0.1*BTCP;\
}' RES=`cat reserve` NS=$nuSafe BTCP=$bp templist

2 Likes

As a reminder, i dont do buybacks if the value is less than $2,500. (It’s a clause in the ppc motion)

show the link here please

You could argue that it doesn’t take effect till April 1st, but I really don’t think it’s sensible to do for example a $400 buyback. It’s just a lot of work from a volunteer (me) for very minimal effect on the market (or our outstanding shares).

a lot of work ? or we can cancel all this buyback action

It’s not a cancellation, it just puts it on hold while we have a dip in NBT demand. It’s really just a practical limit, i haven’t done a complete analysis but I think the theoretical implications are minimal. When we have a spike in NBT demand, we get a lot of BTC, which we convert to NSR to store and minimize risk in another blockchain. If a hundred thousand NBT get sold tomorrow I’d be happy to keep doing buybacks.

This week is $2786 > $2500 so I will certainly do buybacks this week.

1 Like

i see , thanks for you work !

1 Like