-
Notifications
You must be signed in to change notification settings - Fork 350
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
Problem: Undecided future of x/supply
module
#716
Comments
Having this tracked in the explorer sounds like a good idea. @calvinaco @ysong42 what do you think? |
Currently, the |
this is heavy task in the chain-itself, how about
like elastic search, for an example once all balance is updated in client level, sum all values can be done in database level. |
Yes, I think it make senses to index on explorer. The indexer is capable and designed to keep track of all on-chain events, even if that would means heavy computation at runtime. Having been said, this is also a commonly needed features on Cosmos SDK chains, so I saw in the issue on Cosmos SDK it is considered a wanted feature too. While this can be done on the indexer, we can see if it still brings a huge benefits if it can be done inside the node software. |
@calvinaco The solution to do this in indexer is only temporary. Eventually, this should become available directly in Cosmos SDK's |
Closing this issue in favour of #720 and crypto-com/chain-indexing#700. |
The current
x/supply
module tracks liquid supply of a given token using the following formula:where,
total_supply
: Total supply of adenom
which is obtained fromx/bank
module.unvested_supply
: The sum of tokens locked in vesting accounts (x/supply
maintains a static list of vesting accounts configured ingenesis.json
, it does not support adding/removing vesting accounts).module_account_balance
: The sum of tokens locked in module accounts of different modules (x/supply
maintains a static list of module accounts that it uses to fetch total tokens locked in module accounts)Current module account list:
To accurately calculate
liquid_supply
,x/supply
module needs updated list of all the vesting accounts and module accounts. Also, for all the vesting accounts and module accounts, it loops over them and fetches their balance one-by-one (which'll not be efficient if there are a lot of vesting accounts).There are following available options:
x/supply
and rely on the solution developed under Ability to query total liquid supply in the system cosmos/cosmos-sdk#7774. For the short-term, we can add ability to calculate liquid supply in explorer.The text was updated successfully, but these errors were encountered: