W7-C5 follow-up: Replace max_adjust_steps developer copy with trader-friendly gas presets (Low / Medium / High / Custom) #204
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#204
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue Summary
Split from #156 (W7-C5 expiry polish — MR !732 addressed the expiry gaps; this item was explicitly left out of scope).
The Advanced → Book insert walk limit control on
/tradeand/limitstill uses developer-facing language (max_adjust_steps (on-chain + docs)) and raw numeric presets (16,32,64,128). Traders cannot tell what the setting does or how it affects gas cost vs reliability when the pair walks the on-chain order book to find an insert slot.Per maintainer direction on #156: expose Low / Medium / High gas presets plus Custom, and explain the tradeoff in plain language (higher setting → more gas, better chance of placement on deep books).
Background
PlaceLimitOrder.max_adjust_steps— caps how many book-head steps the pair contract may walk when linking a new order (docs/limit-orders.md).LIMIT_ORDER_MAX_ADJUST_STEPS_DEFAULTinlimitOrderExpiry.ts).pair.rs).LimitOrderAdvancedLimitSettings.tsx:[16, 32, 64, 128]with no gas framing.Acceptance criteria
max_adjust_steps, “on-chain + docs”, or other internal identifiers in primary UI copy. Docs link may remain but anchor text must be human-readable (e.g. “How book placement gas works”).1…256); preset buttons show which tier is active without exposing raw numbers unless Custom is selected.max_adjust_stepsinteger viaplaceLimitOrder/placeLimitOrderWithAllowance— no contract changes required./trade(TradeOrderTicket) and/limit(LimitOrdersPage) share the same component/behavior (already true viaLimitOrderAdvancedLimitSettings).docs/limit-orders.md(dApp retail form bullet) anddocs/frontend.mdif applicable updated to describe Low/Medium/High/Custom instead of raw preset numbers.Verification checklist
/trade→ Limit tab → expand Advanced → confirm Low / Medium / High / Custom presets (no16/32/64/128labels, nomax_adjust_stepsin visible copy).1…256; invalid input falls back safely.max_adjust_stepsmatches the mapped integer./limitpage.npm testinfrontend-dapp— new/updated tests pass; full suite green.Recommended fixes
limitOrderExpiry.ts(or adjacent util), e.g.:low→ 16medium→ 32 (default)high→ 64 or 128 (pick one “high” value and document why; 128 is max of current presets)custom→ user-entered integerLimitOrderAdvancedLimitSettings.tsx:STEP_PRESETSnumeric buttons with tier buttons; show numeric input only in Custom mode.max_adjust_steps (on-chain + docs)with plain language + link tolimit-orders.md.{ tier, customSteps }inuseLimitOrderFormand derivemaxSteps, or keepmaxStepsnumber + derived active tier — keep a single source of truth for broadcast.LimitOrderAdvancedLimitSettings.test.tsx(or extend existing trade/limit form tests) for preset mapping and Custom clamp.docs/limit-orders.md§ dApp retail form describing Low/Medium/High/Custom and gas tradeoff.Suggested copy (draft — adjust in MR):
Relevant files
frontend-dapp/src/components/trade/LimitOrderAdvancedLimitSettings.tsxfrontend-dapp/src/utils/limitOrderExpiry.tsLIMIT_ORDER_MAX_ADJUST_STEPS_DEFAULT,LIMIT_ORDER_MAX_ADJUST_STEPS_MAX_UIfrontend-dapp/src/hooks/useLimitOrderForm.tsmaxStepsstate + reset behaviorfrontend-dapp/src/components/trade/TradeOrderTicket.tsx/tradefrontend-dapp/src/pages/LimitOrdersPage.tsx/limitfrontend-dapp/src/services/terraclassic/pair.tsmax_adjust_stepsin hook msgfrontend-dapp/src/services/terraclassic/__tests__/transactions.test.ts32in tx shapedocs/limit-orders.mddocs/frontend.mdmax_adjust_stepsdefaultsmartcontracts/contracts/pair/src/orderbook.rs,smartcontracts/packages/dex-common/src/pair.rsSeverity / Impact
P2 Polish — UX clarity for Advanced limit settings; no change to on-chain semantics. Split from W7-C5 (#156).
/cc @PlasticDigits @totdking
mentioned in issue #156
mentioned in commit
94a1a508a2Implementation complete (merged to
main@94a1a50)Replaced developer-facing max_adjust_steps copy with trader-friendly Low / Medium / High / Custom placement gas presets on
/tradeand/limit(sharedLimitOrderAdvancedLimitSettings).What changed
max_adjust_stepsin visible UI).max_adjust_stepsinteger via existing formmaxSteps— no contract changes.LimitOrderAdvancedLimitSettings.test.tsx+ preset helpers inlimitOrderExpiry.test.ts(fullfrontend-dappsuite green: 618 tests).docs/limit-orders.md,docs/frontend.md, newskills/AGENTS_FRONTEND_LIMIT_ORDER_PLACEMENT_GAS.md; cross-links inAGENTS_TERRACLASSIC_GAS.mdandAGENTS_FRONTEND_LIMIT_ORDER_PRICE.md.Verification checklist
/trade→ Limit tab → Advanced → confirm Low / Medium / High / Custom (no16/32/64/128button labels, nomax_adjust_stepsin visible copy)max_adjust_stepsmatches mapped integer/limitpagenpm testinfrontend-dapp— suite green@brouie — please verify the above on your side when you have a moment. Leaving this issue open until sign-off.
/cc @PlasticDigits
Verified on
mainat3226630— merged locally and pushed to origin/main.Reopened: fix is merged to
mainbut this issue stays open until QA/verification is complete. (Previously closed in error during repo cleanup.)Verification checklist
/trade→ Limit tab → Advanced → confirm Low / Medium / High / Custom (no16/32/64/128button labels, nomax_adjust_stepsin visible copy)max_adjust_stepsmatches mapped integer/limitpagenpm testinfrontend-dapp— suite greenIssue
cc: @PlasticDigits
mentioned in commit
50b9131127QA verification complete (@
50b9131onmain)Completed remaining checklist items on LocalTerra (infra left running; frontend dev server shut down after smoke).
What was done
frontend-dapp/e2e/limit-orders-gas-presets-tx.spec.ts: on/limits, simulated dev wallet places a bid with each Low / Medium / High / Custom (64) preset; LCD tx JSON is decoded viatxJsonPlaceLimitMaxAdjustStepsand asserts CW20place_limit_order_batchhook integers 16 / 32 / 128 / 64.bash scripts/qa/verify-glab-204-limit-gas-presets.sh./limits(port 5176): Advanced shows Placement gas (book walk), Low / Medium / High / Custom (Medium default), helper copy + How book placement gas works link — nomax_adjust_stepsin visible UI.npm testinfrontend-dapp: 716/716 green.skills/AGENTS_FRONTEND_LIMIT_ORDER_PLACEMENT_GAS.md,skills/AGENTS_E2E_LIMIT_ORDERS_TX.md.Note on #232: current LocalTerra pair accepts
place_limit_order_batch(retail path); legacyplace_limit_orderhook correctly fails. Limit placement via dApp succeeded for all four presets — #232 is a separate contract/legacy-hook issue, not a blocker for #204 preset wiring.Verification checklist (final)
/trade→ Limit → Advanced → Low / Medium / High / Custom (no raw step labels / nomax_adjust_stepsin UI) — @totdking + code reviewmax_adjust_stepsmatches mapped integer (16 / 32 / 128 / custom)/limitspagenpm testinfrontend-dapp— suite green/cc @PlasticDigits @totdking
mentioned in issue #261
mentioned in issue #337