Skip to content

Inconsistent price units: --price-per-tick is raw ECC while --deposit-shells is whole SHELL (same command) #118

Description

@latcomblockchain

Inconsistent price units across flags of the same command (--price-per-tick raw ECC vs --deposit-shells whole SHELL)

Not a correctness bug — every flag is individually documented — but the mixed unit conventions inside one command are an easy footgun. Hit it live during a v0.0.18 shellnet E2E.

dexdo provision mixes three unit systems in adjacent flags:

--price-per-tick   Tick price P in raw ECC[2] units; must be a positive multiple of PRICE_STEP(1 SHELL) [default: 1000000000]
--deposit-shells   Note ECC[2] allocation in whole SHELL, not raw nano/vmshell (1 SHELL = 1e9 raw) [...]
--max-ticks        Max ticks the deal TokenContract bounds to [default: 1024]

So in the same invocation the operator writes --deposit-shells 20 (= 20 SHELL) but must write --price-per-tick 1000000000 for 1 SHELL/tick. The natural attempt --price-per-tick 1 fails pre-flight:

price 1 raw ... is not a whole multiple of PRICE_STEP = 1000000000 raw (1 SHELL)

dexdo buyer --max-price-per-tick is the same (raw ECC, default 1000000000).

Why it bites:

  • Adjacent flags of one command read in different units (whole SHELL vs raw nano), which is exactly where users don't re-read the help.
  • The DEX.DO terminal presents the buy ticket as Price/tick: [1] SHELL, so a human copying "1 SHELL/tick" into the raw CLI gets rejected. (The terminal itself converts SHELL→raw internally, so this is specifically about the raw CLI surface for hand-driven use.)

Suggestions (any one):

  1. Accept whole-SHELL for --price-per-tick / --max-price-per-tick the way --deposit-shells does (with the same fail-closed floor/overflow handling), so all money flags in a command share one unit; or
  2. Accept an explicit unit suffix (1shell / 1000000000raw); or
  3. If raw must stay, rename to make it unmissable (e.g. --price-per-tick-raw) and echo the SHELL equivalent in the help/error (= 1 SHELL).

Environment: published dexdo 0.0.18 aarch64-macos, live shellnet 4.0.30, doctor PASS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions