Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Historian search and summary endpoint #1

Open
DevonJames opened this issue Jun 19, 2016 · 4 comments
Open

Historian search and summary endpoint #1

DevonJames opened this issue Jun 19, 2016 · 4 comments

Comments

@DevonJames
Copy link
Member

Index all tx-comments that include "alexandria-historian-v001"

message schema:

"alexandria-historian-v001:$URL_of_node_or_pool:$mrr.last_10:$pool.hashrate:$fbd.networkhashps:$fmd.weighted:$fmd.usd:$signature"

$signature=$URL_of_node_or_pool:$mrr.last_10:$pool.hashrate:$fbd.networkhashps:$fmd.weighted:$fmd.usd

example tx-comment:

"alexandria-historian-v001:pool.alexandria.io:0.000130513000:358920574.29333335:798504117:0.00000499:0.00216:IKDcfh8URcFR8pdl0fp25f2Jtq7br1HMcdZQfXJ3LwngFW1r6E9+7UMxLjj+pOFqjV39E8iCWLwbyJakRwSZUpY="

Variables

mrr.last_10 = miningrigrentals, last 10 scrypt rentals:
= 0.000130513000 (btc per MH/day)

pool.hashrate = alexandria pool hashrate:
= 358920574.29333335 (hashes per second)

fbd.networkhashps = florincoin blockchain data api, hashrate:
= 798504117 (hashes per second)

fmd.weighted = florincoin market data api, volume weighted avg BTC price:
= 0.00000499 (BTC)

fmd.usd = florincoin market data api, 24-hour average USD price:
= 0.00216 (USD)

Calculations

spot flo cost basis:
flo.spotcost_btc = fbd.networkhashps ÷ 1000000 x mrr.last_10 ÷ (24 x 60 x 3 ÷ 2 x 25) =
798504117 ÷ 1000000 x 0.000130513000 ÷ (24 x 60 x 3 ÷ 2 x 25) =
0.00000192991052 BTC per Flo

flo.spotcost_usd = flo.spotcost_btc x fmd.usd ÷ fmd.weighted =
= 0.00083539278557 USD per Flo

Return the following:

Summary from recent 135 blocks:
fmd.weighted_avg = average of fmd.weighted values from most recent 135 blocks
fmd.usd_avg = average of fmd.usd values from most recent 135 blocks
flo.spotcost_btc_avg = average of flo.spotcost_btc values from most recent 135 blocks
flo.spotvalue_usd_avg = average of flo.spotcost_usd values from most recent 135 blocks
individual entries with the following fields for the most recent 135 blocks:
flo.spotcost_btc
flo.spotcost_usd
fmd.weighted
fmd.usd
URL_of_node_or_pool

Note: it might be a good idea to make the number of blocks an input variable rather than a hard coded 135. or perhaps even better, an "hours" variable that calculates the number of blocks in that period?

@DevonJames
Copy link
Member Author

Also calculate offer_btc and include in summary data
using these calculations: https://docs.google.com/spreadsheets/d/11uyc3HqaDD4_WfNkgSfGWDb3r5__fR6V4W0CuQb5LmE/edit#gid=0

@DevonJames
Copy link
Member Author

@DevonJames
Copy link
Member Author

Include block range fields to limit the summary and search results

@DevonJames
Copy link
Member Author

Add API version number to results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant