Skip to content
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

provide better documentation for marker nav cmd. #2159

Merged
merged 5 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Address missing documentation on marker nav command [#2134](https://github.com/provenance-io/provenance/issues/2128).
iramiller marked this conversation as resolved.
Show resolved Hide resolved
44 changes: 40 additions & 4 deletions x/marker/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,11 +1053,47 @@ $ %[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 <denom> " + attrcli.AccountDataFlagsUse,
Use: "add-net-asset-values <denom> <valuation[;valuation...]>",
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: `
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.

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)
$ %[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 established 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)
Expand Down
Loading