Broadcasting the liquidity info as a Web service

I would like to have ultimately a widget (a la bitcoin price widget) that broadcasts the real time liquidity.
Is there any API on top of a Web service that will be connected to a nud daemon on a remote server in the works?

Its currently on hold

This info, accessible via api, would also be beneficial to automated nuauction participants to help determine the proper nsr/nbt price.

Wait, I can get this info with a getinfo() RPC call right? If so, I can probably put it up as an api call to the nuauction.net server.

 nud getliquidityinfo B | tail -n 5 | head -n 3
    "total" : {
        "buy" : 46411.99,
        "sell" : 39247.2427
1 Like

That would be great. In fact, any relevant rpc call should be accessible via Web API, I feel.
I was thinking about trying to do it myself as a challenge though I am not at all an experienced programmer.
If you can implement the set of APIs, I could replicate on my vps.

1 Like
nud getinfo | grep blocks && nud getliquidityinfo B | tail -n 4 | head -n 2
    "blocks" : 473192,
        "buy" : 42924.3614,
        "sell" : 39139.3385

date && nud getinfo | grep blocks && nud getliquidityinfo B | tail -n 4 | head -n 2
Fr 7. Aug 16:54:54 UTC 2015
    "blocks" : 473197,
        "buy" : 42204.4848,
        "sell" : 39353.6673
1 Like

I’ve started to play with blocknotify to get the liquidity logged into a file each time a new block is found.
Each new block overwrites the logged liquidity information. Effectively the log contains only the most recent liquidty.
If the blockchain is not up-to-date this information is not accurate. To identify that the block height is reported as well.

If a web service provides access to the data in that file via API it should be a start for a solution to the request.

The script is located at “~/bin/nbtliqlog” and contains:

#!/bin/bash
nud getinfo | grep blocks > ~/bin/nbtliquidity.log
nud getliquidityinfo B | tail -n 4 | head -n 2 >> ~/bin/nbtliquidity.log

Nud gets started with the blocknotify option and calls the script each time

nud -daemon -blocknotify=~/bin/nbtliqlog

This is just a start…

cat ~/bin/nbtliqlog
    "blocks" : 474448,
        "buy" : 45497.0677,
        "sell" : 36396.4685
1 Like

@masterOfDisaster please let us continue this discussion here.

I have setup a json for the current liquidity:

https://raw.nupool.net/?liquidity

What else do you want to see? A liquidity history json would be huge.

2 Likes

The current liquidity is great!

The historical view would need to be graphical. Something like the charts here: http://coinmarketcap.com/currencies/nubits/ with variable time frame etc.
That’s not something that can be done easily I think

I see what I can do tomorrow… I’m mostly relying on @woolly_sammoth, master of charts, to make something like this:

or a bit fancier (.svg)

https://nupool.net/chartmaker/users.svg

Variable time frame… mmh… If someone points us to a good open source lib (preferably in python), why not do it?

Edit: Okay, Coinmarketcap is obviously using some kind of dark magic (AJAX/JS) …
Edit 2: … that witchcraft is provided by www.highmaps.com, but the licenses are also priced pretty high: Buy Highcharts License | Highcharts Online Shop … Not sure if Nu-related projects would be suitable for non-commercial use.

1 Like

That looks amazing!
Oh, but I’m just making suggestions.
Please don’t take them for what anybody else or NuTM wants :wink:

What looks amazing? Highmaps or the svg?

I’ll try to build a database tomorrow. Let’s see how well our current libs handle ~500k lines of data.

The svg!
I don’t want dark magic or Vodoo (except for VGA cards, but that was some time agooo) or things like that!
Please don’t kill anything with the 500k lines of data!

… how do you read the historic liquidity?

I lived in the illusion they are written into the blocks, which they aren’t… oops.

getblockhash 476138  

18ffabfe3654ce65f612336ffb45ba0fea5e26e836543f738ede661ed4d89c51

getblock 18ffabfe3654ce65f612336ffb45ba0fea5e26e836543f738ede661ed4d89c51

{
"hash" : "18ffabfe3654ce65f612336ffb45ba0fea5e26e836543f738ede661ed4d89c51",
"size" : 499,
"height" : 476138,
"version" : 1,
"merkleroot" : "8798316f0de16d50e17ba2f6d086dafa70c98ce232dd8b8fdf23e51ffe69ad65",
"time" : "2015-08-09 14:00:22 UTC",
"nonce" : 0,
"bits" : "1e0c7337",
"difficulty" : 0.00031375,
"mint" : 40.0,
"previousblockhash" : "02e3190e2533afb9cfb5280ed4ce552c942cf913268f5402aba7583e9a8e3d39",
"nextblockhash" : "85792069a455244dd7268551e2d70ee5ee1ff9f12d4d71f24a00e95a72b4b920",
"flags" : "proof-of-stake",
"proofhash" : "000003aa644b8fa8d3e8d9e2bf427f1b95863ea96cbaabe23d157c4285c4fc01",
"entropybit" : 1,
"modifier" : "26fd9ab6dd8b3aea",
"modifierchecksum" : "d0cf2018",
"tx" : [
"a0dd6a1eca44dc06670a552a61d8c71a65939c9dc9139f4f73fd193aa003a276",
"ce5f68227e7ccde82c74f753a1952104b77d7210bd96ea5645dc4bedf06df47a"
],
"coinagedestroyed" : 514633,
"vote" : {
"custodians" : [
{
"address" : "BSTGvERBWS6vYhUKgTuUn8s9z3nsmYpS3x",
"amount" : 300.0
}
],
"parkrates" : [
{
"unit" : "B",
"rates" : [
]
}
],
"motions" : [
"567dbf1fdd9ef5c99583c7af26fac85d57a0d39e"
]
},
"parkrates" : [
{
"unit" : "B",
"rates" : [
]
}
]
}

I live(d) in the same illusion. Where are they if not there?