WIP: Draft: feat(frontend): Swap/Trade unfunded-pay acquire guidance (#678) #1184

Closed
PlasticDigits wants to merge 0 commits from 678-feat-frontend-swap-extreme-size-unfunded-pay-guidance-acquire-ust1-retail-slippage- into main
PlasticDigits commented 2026-08-27 00:44:42 +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)

Closes #678

## 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) Closes #678
PlasticDigits (Migrated from gitlab.com) closed this pull request 2026-08-27 00:45:06 +00:00
PlasticDigits commented 2026-08-27 00:45:09 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1185

mentioned in merge request !1185

Pull request closed

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!1184
No description provided.