Ability to query total liquid supply in the system #7774
Description
Summary
Support for querying total liquid supply, i.e., the total amount in the system which is immediately transferrable.
Problem Definition
What problems may be addressed by introducing this feature?
- Currently, there is no easy way to query total liquid supply other than (querying each module for the amounts stored in their module accounts + total unvested amount in vesting accounts) and subtracting it from total supply.
What benefits does the SDK stand to gain by including this feature?
- It'll be easy to query total liquid supply.
Are there any disadvantages of including this feature? No.
Proposal
Similar to the total supply, have hooks on bank module functions which transfers tokens from module accounts to account addresses and vice versa to keep track of total amounts stored in module accounts. In vesting module, keep track of all the vesting account addresses and add a function to calculate the total unvested amounts. Finally, when the user queries for liquid supply, calculate it by using above two values and subtracting it from total supply.
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned
Activity