go
go copied to clipboard
services/horizon: open an endpoint for circulating supply
What problem does your feature solve?
Right now there's not an endpoint that gives an aggregate amount of lumens held by accounts.
An example of when this is needed is for our alert if the total supply of lumens is unexpected, which checks to make sure the amount of lumens in circulation is correct. This calculation can currently be done with a Hubble query, but Hubble atm is updated at a delay, so we can't make this check in real time.
note: we can make the calculation using the below equation from docs
TotalSupply = circulatingSupply + upgradeReserve + feePool + sdfMandate
Horizon makes every value available except for the circulatingSupply
. Because of that, we can't check that that circulatingSupply
value is correct using Horizon alone.
What would you like to see?
Having an endpoint that gives us an aggregate amount of lumens held in circulation, ie circulating supply
. With this endpoint we can check it against what we expect at a high frequency (at least, close to real time), and ensure the network is operating as we expect.
What alternatives are there?
the endpoint could also be total supply
(from the above equation), based off of account balance aggregation. As opposed to totalSupply calculated from 100B + inflation - burned
, which is already possible. With that value one could calculate the circulatingSupply.
see slack convo for more details
@acharb Just confirming from this slack convo that you would still be ok if Hubble performed this check instead of Horizon? Will there be any drawback to a 15-30 min delay in latency?