feat: invert /trade UST1 pair display to other-side USD (#524) #1057

Merged
PlasticDigits merged 2 commits from feat/524-trade-ust1-pair-invert into main 2026-08-15 13:04:40 +00:00
PlasticDigits commented 2026-08-15 12:58:14 +00:00 (Migrated from gitlab.com)

Summary

  • Default /trade and /charts UST1-as-asset_0 markets to the other token’s Price (USD) (cUSTC / USTR), with a pair-orientation pill and ticket invert icon sharing one sessionStorage-keyed state.
  • Remove the Order ticket eyebrow. Ticket heading is Buy {displayBase}. Bid/ask stay a separate radiogroup; invert is not LimitOrderSideFlipButton and does not steal PairSearchSelect click.
  • Convert display quote-per-display-base back to factory token1/token0 (and display Buy → factory ask when inverted) on place, update-price, crossing/price gates, and market quote/submit. Indexer #522 math is unchanged.

Closes #524

Test plan

  • make verify-issue-524 (run twice)
  • Vitest: invert helper, USD/OHLC, TradePage UST1 default + pill/ticket sync + pair-switch isolation, PriceChart pill + XSS text nodes
  • Reviewer: open /trade on columbus-5 UST1/cUSTC and confirm Last is cUSTC dollars, not ~$1
  • Click pill then ticket invert icon — chart, Last, and Buy {token} stay in sync
  • Place an inverted Buy cUSTC limit (sim wallet) and confirm on-chain/indexer price is factory quote-per-base, not 1/P
  • Pair search still opens from the combobox; invert does not fire on combobox click
  • /charts UST1 pair uses the same default + pill
  • Non-UST1 pairs default factory; invert still works
  • Keyboard: Tab to pill and icon, Enter/Space toggles; axe on /trade + /charts
## Summary - Default `/trade` and `/charts` UST1-as-`asset_0` markets to the **other token’s** Price (USD) (cUSTC / USTR), with a pair-orientation pill and ticket invert icon sharing one `sessionStorage`-keyed state. - Remove the **Order ticket** eyebrow. Ticket heading is **Buy {displayBase}**. Bid/ask stay a separate radiogroup; invert is not `LimitOrderSideFlipButton` and does not steal `PairSearchSelect` click. - Convert display quote-per-display-base back to factory `token1/token0` (and display Buy → factory ask when inverted) on place, update-price, crossing/price gates, and market quote/submit. Indexer `#522` math is unchanged. Closes #524 ## Test plan - [x] `make verify-issue-524` (run twice) - [x] Vitest: invert helper, USD/OHLC, TradePage UST1 default + pill/ticket sync + pair-switch isolation, PriceChart pill + XSS text nodes - [ ] Reviewer: open `/trade` on columbus-5 UST1/cUSTC and confirm Last is cUSTC dollars, not ~$1 - [ ] Click pill then ticket invert icon — chart, Last, and **Buy {token}** stay in sync - [ ] Place an inverted Buy cUSTC limit (sim wallet) and confirm on-chain/indexer price is factory quote-per-base, not `1/P` - [ ] Pair search still opens from the combobox; invert does not fire on combobox click - [ ] `/charts` UST1 pair uses the same default + pill - [ ] Non-UST1 pairs default factory; invert still works - [ ] Keyboard: Tab to pill and icon, Enter/Space toggles; axe on `/trade` + `/charts`
PlasticDigits commented 2026-08-15 13:04:11 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 96efefde - fix: reciprocate limit price on any pair invert toggle

Compare with previous version

added 1 commit <ul><li>96efefde - fix: reciprocate limit price on any pair invert toggle</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/339/diffs?diff_id=1963838066&start_sha=50412afb415812888429d4f4003647826c442108)
PlasticDigits commented 2026-08-15 13:04:28 +00:00 (Migrated from gitlab.com)

mentioned in issue #524

mentioned in issue #524
PlasticDigits commented 2026-08-15 13:04:40 +00:00 (Migrated from gitlab.com)

mentioned in commit a0a75d5d61

mentioned in commit a0a75d5d6116f409bfe088263881c47703e900d0
PlasticDigits (Migrated from gitlab.com) merged commit a0a75d5d61 into main 2026-08-15 13:04:40 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1057
No description provided.