-
Notifications
You must be signed in to change notification settings - Fork 20
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
Total supply (current chain and all chains) for fungible-v2 tokens #21
Comments
In my opinion, standards should be kept minimal (i.e. transfer-create is superfluous). It's unclear if some excessively granular design is always beneficial, but it helps when everything isn't all or nothing (progressive upgrades / wide compatibility / ...). (interface poly-metadata-v0
(defschema entry key:string value:string)
; negative values => unavailable
(defschema token-details
id:string ; (= ticker)
entries:[object{entry}] ; non-abbreviated name, descriptions, links, icons, etc
local-supply:decimal
supply:decimal
exact-supply:bool ; indicates if supply is an estimation or actual
genesis:time)
(defun token:object{token-details} ( token:string ))
; this is slow, but useful outside Tx context? (could be paginated)
; (defun tokens:[object{token-details}] ())
) Or alternatively if there is no use case for these within other modules (front-end only) (interface poly-metadata-v0
; numeric values encoded as string
(defschema entry key:string value:string)
(defun token-details:[object{entry}] ( token:string ))) maybe name can be confused with NFT's immutable metadata, such that some clear distinction is needed |
Having a separate interface is a good idea. Just to clarify - were you thinking to have this implemented on a contract alongside the fungible-v2 token interface or on a separate class that stores metadata for tokens? In particular asking because I'm not sure why there is a need to take |
I think the team wrote at some point fungible and poly-fungibles interfaces will be merged (which is good, but maybe I misread so don't take my words for it). If this is the case, metadata standards should be designed around it. Module references with multiple interfaces are something like (interface metadata-v0
(defun query:[string] ( path:[string] )
@doc "return result, or list supported inputs following path (view on depth n+1)" ))
(defun queries:[[string]] ( path:[string] for:[string] )
@doc "same as above, view on depth n+1->n+2" ))
; e.g.
(awa.query ["tokens"]) ; -> ["AWA"]
(awa.query ["tokens" "AWA"]) ; -> ["ticker" "supply-estimation" "supply-estimation-error" "genesis" "local-supply" ...]
(awa.queries ["tokens" "AWA"] ["supply-estimation" "notfound"]) ; -> [["666.66"] []]
; since database reads are cached, this should be fine not sure but once we have dapps interacting with lots of random modules, such things will be required for decent UX. Then it would need to be curated to mitigate "undesirable content", but this is better solved separately
Both, it's not mutually exclusive. DEX contracts can accept tokens without metadata, since it would be just a front-end thing. but other dapps can be more restrictive |
The main benefit I think is to help Dapps scale. For Kadena it is theoretical as there isn't a DEX live outside of beta, but it seems like other ecosystems use this metadata. For example ERC-20 defines total supply and optionally the name and symbol. Having this provides a much nicer UX for Dapps like uniswap/pancake swap then if it wasn't available (particularly name + symbol).
Also, having this data to be purely stored to DEXs or other sources, even if via an interface implemented on the DEX creates issues around
|
also pagination can be solved by either having metadata standards for unchanging chunks (easy to cache) or interval queries (start / limit). i don't really know |
What about this as an alteration to the proposal?
|
One thing - is that I'm not sure about the naming as poly-metadata, is Kadena moving towards an ERC-1155 standard which combines NFT + non NFT tokens into one? If so then could be quite good. Though right now as there's a difference between the two, could be good to keep them separate |
Abstract
This proposal adds the ability to get the total supply of tokens on the chain and across all chains to the current fungible-v2 interface.
This will help other tools (such as exchanges, coin trackers and Dapps) track supply and market cap over time and help tokens launched on Kadena be integrated into such systems in the future.
Specification
Two new methods are proposed.
1. total-local-supply
This returns the available supply on the current chain.
2. total-global-supply
This returns the total supply across all the chains
References
The text was updated successfully, but these errors were encountered: