Calculating payout for last 24 hours for all the pools

Issue #133 new
jesgatt created an issue

I am not much into programming but a hint might be to use an array of 288 locations (1 location for every 5 mins) for each pool and log the total given by each pool in a particular location i.e. location 0 for 00:00, 1 for 00:05, etc. To calculate the payout for last 24 hrs, the current total is then subtracted from the corresponding location (according to the time) and the old value is replaced with the new one. A variable can be used to hold the value that will be displayed. This procedure will be carried out every 5 mins so the data can be max. 5 mins old. Thanks and well done

Comments (9)

  1. James Dimitrov repo owner

    The last 24 hour payout is already provided by the MPH API, though, and this is where I get it from. Could you elaborate more on this request please?

  2. jesgatt reporter

    For the other pools like NH, Zpool and AHashpool the 24 hour payout does not show (it shows as 0). I meant maybe you can use the above (if no API is available) to show also for the other pools.

    Thanks

  3. James Dimitrov repo owner

    ahhhhhh OK, that makes sense. Yes I think something like that can be done. There is a feature that I am planning on implementing in the future, but it depends on site adoption/ revenue to cover hosting, etc. I want to create a distributed service (5-6 nodes around different datacenters) that poll the APIs every 5 minutes for every registered user. That way stats are compiled even when you're not viewing the page. This won't be easy or cheap though :/ and I refuse to charge for this thing as it stands.

  4. John

    Wouldn't it be a lot simpler to just record the value of "Confirmed" (at whatever interval) and then take the difference of the current amount from 24 hours ago? This is assuming that money stays at the same address over that 24 hour window, and doesn't move somewhere else. A negative value here would indicate it has been moved, and then wouldn't be included in the 24 hour total.

    I understand the other method of polling the API's would be more accurate, but if it's also a lot more complex/expensive.

  5. jesgatt reporter

    John, still arrays need to be used and by using a real time value instead of splitting them in 5 mins, will involve more arrays. This would also lead to more computations, etc. etc. In my opinion an interval of 5 mins would be enough. As for the negative number, i tend to agree with you.

  6. Log in to comment