feat: Phase 4 — /ust1 window UI, wrap-mapper wiring, secondary UST1 AMM pairs #502
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#502
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?
Summary
Integrate mainnet UST1 window, treasury-backed wraps (cLUNC / cUSTC), and secondary AMM pairs into the live CL8Y DEX at
https://dex.cl8y.com, including a dedicated/ust1page for always-on oracle mint/redeem.Phase 0 decisions (approved):
cmm-native-wrap).https://dex.cl8y.com/ust1(dedicated page; do not overload soft-launch/mintfaucet).Live soft-launch anchors:
https://dex.cl8y.com, indexerhttps://indexer.dex.cl8y.comterra1ejpgvv7g3hj0u6fpcnxhflqp84g0w3cnaskqkg5733ygwlmf963sfchseaterra1e7s0h9ftxakwca5gxspyt4haeuaqxds6swr08ul3tsepq7el924sprrsrwCurrent codebase
docs/runbooks/mainnet-soft-launch.mdSL5)scripts/deploy-dex-local.shPhase 1b/4c, routerSetWrapMapper, frontend wrap/swapfrontend-dapp/src/services/terraclassic/wrapMapper.ts,utils/constants.tsNATIVE_WRAPPED_PAIRS, Swap/Pool pathsunwrap_output,minimum_receivepost-fee (#469)/mintMintPage.tsx) — not UST1/ust1route, no window client)Why this is needed
Users on the live DEX need: (1) wrap/unwrap natives for CW20 markets, (2) a first-class UST1 mint/redeem UI against the oracle window, (3) optional AMM liquidity for price discovery around the peg. Without this phase, Phases 2–3 are operator-only and invisible at
dex.cl8y.com.Constraints / guardrails
/mintfor UST1; add/ust1(nav label clear vs faucet Mint).Send+ quote viaeffective_swap— not the AMM router for mint/redeem.set_wrap_mapperon production router required before native wrap swaps.AssetInfopairs).fee_bps/ limits / pause / oracle staleness; block submit when paused or oracle stale./ust1.VITE_*addresses for window, oracle (if needed), vFDUSD, UST1, wrap-mapper, cLUNC, cUSTC; redeploy frontend (+ indexer asset metadata if required).Relevant files
Frontend
frontend-dapp/src/App.tsx(add/ust1route)frontend-dapp/src/components/common/navItems.tsfrontend-dapp/src/pages/SwapPage.tsx,PoolPage.tsxfrontend-dapp/src/services/terraclassic/wrapMapper.ts,router.tsfrontend-dapp/src/utils/constants.ts,tokenRegistry.ts,tokenLogoAllowlist.ts(or equivalent)frontend-dapp/src/pages/Ust1Page.tsx(or similar) +services/terraclassic/ust1Window.tsContracts / deploy / docs
NATIVE_TOKEN_WRAPPING.mddocs/runbooks/mainnet-soft-launch.md(document post-SL5 wrap/UST1 track)docs/runbooks/cw20-whitelist-policy.mddocs/deployment-guide.md§ pair creationdocs/qa-templates/wrap-unwrap-test-pass.mdscripts/lib/mainnet-soft-launch-defaults.sh(do not silently fold economic wraps into soft-launch defaults)docker/frontend/Dockerfile, deployments env examplesSkills
skills/AGENTS_NATIVE_WRAP_TAX.md,AGENTS_FRONTEND_SWAP_SAFETY_CTA.md,AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.md,AGENTS_FRONTEND_DESIGN_SYSTEM.mdRecommended direction
A. On-chain / ops wiring (after Phase 2+3 addresses)
set_wrap_mapperon production router.set_discount_registryon new pairs if using fee tiers.B. Frontend — wraps
NATIVE_WRAPPED_PAIRS/VITE_*for cLUNC, cUSTC, wrap-mapper, treasury if needed.C. Frontend —
/ust1window UI (new)/ust1+ nav item (primary or More — product choice; must be discoverable).effective_swap(fee, limits, oracle age/rate); disable when paused/stale/over limit.D. Token metadata
E. Ship
Acceptance criteria
https://dex.cl8y.com/ust1serves UST1 ↔ vFDUSD mint/redeem UI (not the faucet).effective_swap; respects pause, stale oracle, per-tx and 24h limits./ust1with/mint.Test plan (happy / functional paths)
wrap-swap.spec.ts,wrap-pool.spec.ts) + new/ust1Playwright against local window deploy.docs/qa-templates/wrap-unwrap-test-pass.md; add ust1 window QA steps./ust1and wrap paths load without wrong-Node/Aw Snap issues.Test plan (attack / hack / abuse vectors)
/ust1route; no router call for window mintminimum_receiveignore on unwrap_output/mintused to spoof UST1Verification criteria
/ust1mint+redeem smoke txs recorded.make lint-frontend/make test-frontendgreen for changed code.Related
/ust1)mentioned in issue PlasticDigits2/ustr-cmm#5
Cross-repo tracking (Phase 0 approved)
/ust1UI + wraps + secondary AMMApproved params: window
fee_bps=100, per-tx 1000 UST1, 24h 10000 UST1; wrapfee_bps=100(1%). UI atdex.cl8y.com/ust1. Skipcmm-native-wrap. Phase 1 prerequisites confirmed.mentioned in issue #503
changed the description
Naming update
Wrapped token symbols are cLUNC and cUSTC (not
LUNC-C/USTC-C).LocalTerra / existing DEX code may still say
LUNC-C/USTC-C— Phase 3–4 implementation must mint and display cLUNC / cUSTC on mainnet and align frontend registry/env naming.Router ↔ wrap-mapper connected (mainnet)
Status:
SetWrapMappersucceeded. Production router now has wrap-mapper set (wasnullafter soft launch SL5).EAE9C840E388946E0DF4C9E0D1F9E5E3377F79911B2B39418F029F1B3B9C075429849291/2026-08-08T00:18:31Zterra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7terra1e7s0h9ftxakwca5gxspyt4haeuaqxds6swr08ul3tsepq7el924sprrsrwterra1xuuuhpmyd5t29ry7mydg7ra2q2phrwhx7j28nx7x9sjw6zznkumsz0nmd2Verified router
config:Auth lesson: first attempt with
--from cl8y2_adminfailedUnauthorized—SetWrapMapperrequires factoryconfig.governance(the multisig), not an EOA. Flow:--generate-onlyfrommultisig_2of3→ 2×tx sign --multisig→tx multisign→broadcast.Docs: recorded in
deployments/mainnet-soft-launch/deploy-trace.md+addresses.env(WRAP_MAPPER_ADDRESS) and a note ondocs/reference/governance-multisig.md.Unblocks Phase 4 wrap path wiring on the DEX; remaining #502 work is
/ust1UI, tokens/logos, and secondary AMM pairs.mentioned in commit
4dec7d938aProgress check — next AC step (after Phase 2 complete)
Upstream: ust1-window#19 is closed/complete. Phase 3 (ustr-cmm#5) is also closed; production router already has
wrap_mapperset (prior note on this issue).Published Phase 2 addresses (for Coolify / client):
terra1mnl9azefrqpmu888ar2u6zrcwr80hxlt3avf4300r576cw5ar7esvxsvj3terra1f0eqgy9w7e5e7up97vjudqwx38tesf8ylx75x2lv3nwm0clry0pqmgfy72terra1fmht0t6svq3n24zx03nkfja0m40zhfyyxkdcvlrkl6u7gfe6aagq4gch8n(code 11568)terra1zxwpzpzpleatqn39r00grau4yt29sld8pw78s7ktvjafnj5nsaxq0h3rh2(code 11566)#502 AC status: wrap-mapper-on-router is done; everything else still open. No
/ust1route or window client in this repo yet.Next step to move AC forward: ship the dedicated
/ust1frontend (route + nav distinct from/mint,ust1Windowclient via CW20Send+effective_swapquotes/gates, UST1/vFDUSD metadata/logos) and wire CoolifyVITE_*to the addresses above. That unblocks the first three ACs (live mint/redeem UI, quote parity, UI deposit/withdraw smoke). Parallel/follow-on: mainnet wrap env + Swap wrap UX (AC #4/#8), then secondary AMM pair or product waiver (AC #5).mentioned in issue #506
marked as related to #506
mentioned in issue #507
marked as related to #507
mentioned in issue #508
marked as related to #508
Split implementation issues (from Phase 4 AC next steps)
/ust1UI (route, nav ≠/mint, window client, UST1/vFDUSD logos)All three relate_to this issue. Prefer landing work on the child issues; keep #502 as the Phase 4 umbrella AC tracker.
#508 secondary AMM — Path B interim waiver (for Phase 4 AC)
Child #508 ships Path A create/seed tooling + LocalTerra rehearsal, but defers live columbus-5 pair create/seed until UST1 inventory exists (
total_supplywas 0; deployer balances 0).Canonical waiver:
deployments/ust1-secondary-pair/PRODUCT_WAIVER.mdRevisit: fund LP wallet (typically after
/ust1window mint) →./scripts/add-ust1-secondary-pair.sh→ record pair/txs on #508 and flip this AC to Path A.This satisfies #502 “secondary pair or explicit product waiver” via the waiver path until inventory unblocks Path A.
mentioned in merge request !1046
mentioned in merge request !1045
Production smoke —
/ust1mint + redeemCoolify rebuild with wrap + UST1
VITE_*confirmed (bundle + LCD). Window path smokes below.A90EEC4DB2E03943B7504421AD889017ED62BC968B12DA8B3EDD7E1A087E6284630BE3BE276C093DFB22671745D6E12B5D306CA431D91CDCDD66538C6479EE9A29868589/2026-08-09T07:59:38Z29868591/2026-08-09T07:59:50Zcode=0code=0terra1xsecn4snv94ezcez0z3vq8an9j4h4kxxcydp8lSend→ ust1-windowdepositSend→ ust1-windowwithdraw(min_vfdusd_out)Window contract:
terra1zxwpzpzpleatqn39r00grau4yt29sld8pw78s7ktvjafnj5nsaxq0h3rh2.AC progress (window track)
https://dex.cl8y.com/ust1mint/redeem UI live (post Coolify)effective_swapvs UI quote (optional note if captured)fee_bps=200)Still open for #502: wrap smokes (both denoms), then remaining checklist / close umbrella when wrap ACs done.
Production smoke — wrap / unwrap (LUNC ↔ cLUNC)
Verified on columbus-5 after Coolify wrap env +
UNWRAP_GAS_LIMIT=800kfix.8221906F421B4E50E7AB5AC9D1651BBE9318FEACB9E5127BBC803DA06D2CEF0CA5786E3FC231E06C27960E3417D9ABDE85294BA087E6C30E3D0D8584678D76402986888129869214/2026-08-09T09:01:44Zcode=0code=0terra1xsecn4snv94ezcez0z3vq8an9j4h4kxxcydp8lwrap_depositSend→ wrap-mapperunwrap→ treasuryinstant_withdraw400000/ used307155800000/ used566802(~29% headroom; matches LCD sim ~562k)fee_bps=200)Checks
wrap_mapperset; wrap env baked in Coolifyfee_bps=200(UI should show 2%, not legacy 1% docs)AC progress (wrap track)
fee_bps=200)Production smoke — wrap / unwrap (USTC ↔ cUSTC)
9F74FD84628C0885F9D95D1290B486C07EFAC56DAAF305E745D44F723945D4032C76F19AF74292734648D752E12C5305895758418CAE0616D2A2C5C52DE2022529869249/2026-08-09T09:05:15Z29869252/2026-08-09T09:05:33Zcode=0code=0terra1xsecn4snv94ezcez0z3vq8an9j4h4kxxcydp8lwrap_deposit(uusd)Send→ mapperunwrap→ treasuryinstant_withdraw(uusd)fee_bps=200)400000/ used305527800000/ used560330(~30% headroom)Together with prior LUNC wrap/unwrap smokes, both denoms are covered for #502 wrap ACs.
AC met, wrap fee onchain 2% due to 1.5% tax raise by terraclassic validator govenrnace (not us), closing. Note that ust1 apirs are not yet created.
mentioned in merge request !1048
mentioned in issue #574
marked as related to #574
mentioned in issue #575
marked as related to #575
mentioned in issue #599