From 5ce4f6d20b5110b9b11fad3aec4147f99770c6a4 Mon Sep 17 00:00:00 2001 From: Ira Miller Date: Mon, 23 Sep 2024 11:31:24 -0600 Subject: [PATCH 1/4] provide better documentation for marker nav cmd. --- x/marker/client/cli/tx.go | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/x/marker/client/cli/tx.go b/x/marker/client/cli/tx.go index 694c79a4c..980f50d43 100644 --- a/x/marker/client/cli/tx.go +++ b/x/marker/client/cli/tx.go @@ -1053,11 +1053,38 @@ $ %[1]s tx marker account-data hotdogcoin --%[4]s`, // GetCmdAddNetAssetValues returns a CLI command for adding/updating marker net asset values. func GetCmdAddNetAssetValues() *cobra.Command { cmd := &cobra.Command{ - Use: "add-net-asset-values " + attrcli.AccountDataFlagsUse, + Use: "add-net-asset-values ", Aliases: []string{"add-navs", "anavs"}, - Short: "Add/updates net asset values for a marker", - Example: fmt.Sprintf(`$ %[1]s tx marker add-net-asset-values hotdogcoin 1usd,1;2nhash,3`, - version.AppName), + Short: "Provide net asset values for a marker", + Long: ` +Proved net asset valuations for a marker. Net asset values are expressed as a ratio +between an amount of coin paid (price) and a volume of token which are equivalent. + +The denomination of the amount paid (price) must exist on chain as a separate marker +or be supplied as a [usd] integer which is valued in mils (0.001) USD. The volume +is supplied as an integer count of the current token. +`, + Example: fmt.Sprintf(` + Set a value of $1 = 1markercoin (Note USD is denominated in mils) + $ %[1]s tx %[2]s add-net-asset-values markercoin 1000usd,1 + + Provide more than one valuation in a single call + $ %[1]s tx %[2]s add-net-asset-values markercoin 1000usd,1;5000000000nhash,1 + + Valuations for larger trades with volumes greater than 1 + $ %[1]s tx %[2]s add-net-asset-values markercoin 100000usd,199;1000stake,19 + + All values must be represented as whole integers. If a decimal value is required + then the ratio between the price and volume must be adjusted to achieve the decimal + required. + + Note: When the valuations are recorded, each will indicate the address of the admin + who provided the value. This will be published in the associated event data and + captured in the NAV record. For NAVs set by other modules such as x/exchange the + protocol will indicate these sources. This separates estabished values from + the owner (self-attestation) from those set through blockchain transactions. + `, + version.AppName, types.ModuleName), Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) From 95ef09fb7f77959a66ea1e4723e5872043a662fe Mon Sep 17 00:00:00 2001 From: Ira Miller Date: Mon, 23 Sep 2024 12:06:42 -0600 Subject: [PATCH 2/4] updated description based on coderabbit suggestion --- x/marker/client/cli/tx.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/x/marker/client/cli/tx.go b/x/marker/client/cli/tx.go index 980f50d43..167123f87 100644 --- a/x/marker/client/cli/tx.go +++ b/x/marker/client/cli/tx.go @@ -1057,12 +1057,21 @@ func GetCmdAddNetAssetValues() *cobra.Command { Aliases: []string{"add-navs", "anavs"}, Short: "Provide net asset values for a marker", Long: ` -Proved net asset valuations for a marker. Net asset values are expressed as a ratio -between an amount of coin paid (price) and a volume of token which are equivalent. +Provide net asset valuations for a marker. Net asset values are used to establish +the relative value of the marker in relation to other assets or currencies. -The denomination of the amount paid (price) must exist on chain as a separate marker -or be supplied as a [usd] integer which is valued in mils (0.001) USD. The volume -is supplied as an integer count of the current token. +Net asset values are expressed as a ratio between an amount of coin paid (price) +and a volume of the marker's tokens which are considered equivalent in value. + +The denomination of the amount paid (price) must either: +1) Exist on-chain as a separate marker, or +2) Be supplied as [1000usd], an integer valued in mils (1000 mils = $1 USD). + +The volume is supplied as an integer count of the current marker's tokens. + +IMPORTANT: All values must be represented as whole integers. If a decimal value +is required, adjust the ratio between the price and volume to achieve the +desired precision. `, Example: fmt.Sprintf(` Set a value of $1 = 1markercoin (Note USD is denominated in mils) From 051af657a45c506c54f94b8194c12f7c94b024e2 Mon Sep 17 00:00:00 2001 From: Ira Miller Date: Mon, 23 Sep 2024 13:25:06 -0600 Subject: [PATCH 3/4] spelling fixes. --- x/marker/client/cli/tx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/marker/client/cli/tx.go b/x/marker/client/cli/tx.go index 167123f87..39da6f9d6 100644 --- a/x/marker/client/cli/tx.go +++ b/x/marker/client/cli/tx.go @@ -1053,7 +1053,7 @@ $ %[1]s tx marker account-data hotdogcoin --%[4]s`, // GetCmdAddNetAssetValues returns a CLI command for adding/updating marker net asset values. func GetCmdAddNetAssetValues() *cobra.Command { cmd := &cobra.Command{ - Use: "add-net-asset-values ", + Use: "add-net-asset-values ", Aliases: []string{"add-navs", "anavs"}, Short: "Provide net asset values for a marker", Long: ` @@ -1090,7 +1090,7 @@ desired precision. Note: When the valuations are recorded, each will indicate the address of the admin who provided the value. This will be published in the associated event data and captured in the NAV record. For NAVs set by other modules such as x/exchange the - protocol will indicate these sources. This separates estabished values from + protocol will indicate these sources. This separates established values from the owner (self-attestation) from those set through blockchain transactions. `, version.AppName, types.ModuleName), From e99647910e993755043c843e7c12055184b2f2be Mon Sep 17 00:00:00 2001 From: Ira Miller Date: Mon, 23 Sep 2024 15:52:01 -0600 Subject: [PATCH 4/4] add missing changelog --- .changelog/unreleased/improvements/2128-marker-nav-docs.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/unreleased/improvements/2128-marker-nav-docs.md diff --git a/.changelog/unreleased/improvements/2128-marker-nav-docs.md b/.changelog/unreleased/improvements/2128-marker-nav-docs.md new file mode 100644 index 000000000..684c68bc5 --- /dev/null +++ b/.changelog/unreleased/improvements/2128-marker-nav-docs.md @@ -0,0 +1 @@ +* Address missing documentation on marker nav command [#2134](https://github.com/provenance-io/provenance/issues/2128). \ No newline at end of file