Skip to content

Ability to query total liquid supply in the system #7774

Closed
@devashishdxt

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions