feat(frontend): Swap/Trade unfunded-pay acquire guidance (#678) #1185

Merged
PlasticDigits merged 2 commits from feat/678-swap-acquire-guidance into main 2026-08-27 04:54:43 +00:00
PlasticDigits commented 2026-08-27 00:45:01 +00:00 (Migrated from gitlab.com)

Summary

  • Swap and Trade market share evaluateSwapPayAcquireGuidance so oversized/unfunded pay amounts no longer look like an executable offer.
  • Disconnected quotes are marked Quote only (no Min received promise, no confirm-again). Connected UST1 shortfalls get a one-sentence status plus Get UST1 → /ust1?direction=deposit&amount= from inverse effective_swap math, clamped to per-tx / rolling remaining.
  • /ust1 prefills direction + amount only; hostile query strings are ignored. 5% / 30% / 99% / Expert Mode gates are unchanged. U1: Guide is /ust1, never AMM-as-mint.

Closes #678.

Test plan

  • make verify-issue-678 (run + retest, PASS=7)
  • Inverse deposit + helper matrix + /ust1 prefill unit tests
  • SwapPage + TradeMarketOrderPanel acquire component tests
  • Existing SwapPage.test.tsx (#293 Expert Mode) + Ust1Page.test.tsx + Trade submit snapshot still pass
  • Manual: disconnected 50k UST1 → LUNC looks like a quote; connect empty UST1 → Guide lands on /ust1 with a legal deposit (≤ 1,000 UST1 / remaining 24h)
  • Manual: funded small swap has no acquire chrome; confirm-again / Expert Mode still work
  • Optional LocalTerra E2E when window + wrap env are present (e2e/ust1-window.spec.ts happy path without query params)
## Summary - Swap and Trade market share `evaluateSwapPayAcquireGuidance` so oversized/unfunded pay amounts no longer look like an executable offer. - Disconnected quotes are marked **Quote only** (no Min received promise, no confirm-again). Connected UST1 shortfalls get a one-sentence status plus **Get UST1** → `/ust1?direction=deposit&amount=` from inverse `effective_swap` math, clamped to per-tx / rolling remaining. - `/ust1` prefills `direction` + `amount` only; hostile query strings are ignored. 5% / 30% / 99% / Expert Mode gates are unchanged. U1: Guide is `/ust1`, never AMM-as-mint. Closes #678. ## Test plan - [x] `make verify-issue-678` (run + retest, PASS=7) - [x] Inverse deposit + helper matrix + `/ust1` prefill unit tests - [x] SwapPage + TradeMarketOrderPanel acquire component tests - [x] Existing `SwapPage.test.tsx` (#293 Expert Mode) + `Ust1Page.test.tsx` + Trade submit snapshot still pass - [ ] Manual: disconnected 50k UST1 → LUNC looks like a quote; connect empty UST1 → Guide lands on `/ust1` with a legal deposit (≤ 1,000 UST1 / remaining 24h) - [ ] Manual: funded small swap has no acquire chrome; confirm-again / Expert Mode still work - [ ] Optional LocalTerra E2E when window + wrap env are present (`e2e/ust1-window.spec.ts` happy path without query params)
PlasticDigits commented 2026-08-27 00:45:08 +00:00 (Migrated from gitlab.com)

Correct source branch for #678 (replaces empty-branch draft !1184).

Correct source branch for #678 (replaces empty-branch draft !1184).
PlasticDigits commented 2026-08-27 04:54:23 +00:00 (Migrated from gitlab.com)

added 19 commits

  • 88cc86f5...82ae5b9b - 18 commits from branch main
  • 5391dc38 - Merge origin/main into feat/678-swap-acquire-guidance.

Compare with previous version

added 19 commits <ul><li>88cc86f5...82ae5b9b - 18 commits from branch <code>main</code></li><li>5391dc38 - Merge origin/main into feat/678-swap-acquire-guidance.</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/467/diffs?diff_id=1986968104&start_sha=88cc86f54e0baf97ba9b04b4db5600c063153474)
PlasticDigits commented 2026-08-27 04:54:44 +00:00 (Migrated from gitlab.com)

mentioned in commit 36d64528b9

mentioned in commit 36d64528b934518688d19c6784d27257e1d70c5e
PlasticDigits (Migrated from gitlab.com) merged commit 36d64528b9 into main 2026-08-27 04:54:44 +00:00
PlasticDigits commented 2026-08-27 05:29:53 +00:00 (Migrated from gitlab.com)

mentioned in issue #686

mentioned in issue #686
PlasticDigits commented 2026-08-27 05:30:25 +00:00 (Migrated from gitlab.com)

mentioned in issue #678

mentioned in issue #678
PlasticDigits commented 2026-08-29 04:56:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #701

mentioned in issue #701
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!1185
No description provided.