ux: Pool fee badge — surface register CTA / eligibility (reporter confirmed discount works after /tiers) #476
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#476
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
Mainnet soft-launch bug report (Pool page, CORAL/PEARL): “fee reduction from CL8Y-cb holding isn't applied” while the UI shows FEE: 1.80%.
Investigation verdict: On-chain fee discount is implemented and live on columbus-5. The reporter’s symptom is expected when the wallet is not registered on
/tiers, holds a different token than the configuredcl8y_token, or when the UI only has the base pair fee to show. Pool lacks Swap’s unregistered CTA and registry-outage warning, so users reasonably conclude the feature is missing.Bundle related frontend/docs work here. Do not change the on-chain register+balance model unless product explicitly opens a separate contract RFC.
Current codebase
On-chain (working)
terra1wcczsdk7jwj99n3my6wx8wr4ee0hn6yaapgd792lgx5elrdtrn2scfnecz— tiers 0–9 + 255;cl8y_token=terra16wtml2q66g82fdkx66tap0qjkahqwp4lwq3ngtygacg5q0kzycgqvhpax3Register { tier_id }on/tiers(EOA self-register for tiers 1–9). Holding alone →discount_bps: 0effective_fee_bps = fee_bps * (10000 - discount_bps) / 10000; fail-closed to fullfee_bpsif registry query fails (#365)traderon hops when trustedVerified production:
dex.cl8y.combundle embedsVITE_FEE_DISCOUNT_ADDRESS; indexerGET /api/v1/health/fee-discountreturnsfee_discount_registry_ok: true.Frontend gaps
PoolPage.tsx)getTraderDiscountwhen wallet + env set;FeeDisplayshows strikethrough only ifdiscount_bps > 0. No “Hold CL8Y… → /tiers” CTA. No registry-outage banner (#374).SwapPage.tsx)unregistered+ registry-outage warningTiersPage.tsx)tokenRegistry.tslists CL8Y as 6 decimals; chain/docs use 18./tiers“Hold X CL8Y” can display wrong amounts (lookupByCW20(…).decimals ?? 18).FeeDisplaywithdiscountBps === 0→ plain1.80%— matches the screenshot for an unregistered (or wrong-token) connected wallet.Related issues / docs
docs/reference/fee-discount-tiers.md(#198)traderparity: #238 / #245skills/AGENTS_FEE_DISCOUNT_TIERS.mddeployments/mainnet-soft-launch/deploy-trace.mdWhy a new implementation is needed
Users on Pool (and reporters saying “CL8Y-cb”) cannot tell whether:
Without Pool parity + explicit eligibility copy, soft-launch support load and “feature broken” reports will continue even when on-chain discount works.
Constraints / guardrails
Register) in this issue — registration is intentional (security-model / anti-gaming). That would be a separate contract ADR.cl8y_tokeneligibility here — product/governance decision tracked in the companion ops/docs issue if needed.feeDiscountRegistryWarninghelpers — no parallel status logic.FeeDisplaymath; only improve empty/unregistered/outage states and copy.Relevant files
frontend-dapp/src/pages/PoolPage.tsxfrontend-dapp/src/pages/SwapPage.tsxfrontend-dapp/src/pages/TiersPage.tsxfrontend-dapp/src/components/ui/FeeDisplay.tsxfrontend-dapp/src/utils/feeDiscountRegistryWarning.tsfrontend-dapp/src/services/terraclassic/feeDiscount.tsget_discount/get_registrationfrontend-dapp/src/utils/tokenRegistry.tsfrontend-dapp/src/utils/constants.tsVITE_FEE_DISCOUNT_ADDRESS,VITE_CL8Y_TOKEN_ADDRESSdocs/frontend.mddocs/reference/fee-discount-tiers.mdQA_TEMPLATE.md§ 3.1.3frontend-dapp/src/pages/SwapPage.feeDiscountRegistryBanner.test.tsxRecommended direction
unregistered, show the same “Hold CL8Y to reduce swap fees →” link to/tiersnear the pool fee badge (or pool list header)./tiers: discount applies only after register, and only the configured CL8Y CW20 (VITE_CL8Y_TOKEN_ADDRESS/ fee-discountconfig.cl8y_token) counts — not arbitrarily named “CL8Y-cb” holdings unless that address matches.shouldShowFeeDiscountRegistryWarning/ banner text on Pool when registered + LCD/indexer unhealthy (same as Swap #374).discount_bps > 0(keepFeeDisplayas source of truth for the %).tokenRegistry.tsto 18 (or address-keyed override) + unit test so/tiersHold amounts matchmin_cl8y_balancewei.docs/frontend.md/ FAQ pointing reporters to/tiers+ explorer link forcl8y_token.Acceptance criteria
/tiers(CTA or equivalent), not only a bare1.80%.FeeDisplaypath), covered by automated test.Test plan (all paths)
/tiersdiscount_bps > 0VITE_FEE_DISCOUNT_ADDRESSemptyfee_discount_registry_ok: false/tiersHold labels after decimals fixfee-tier-tx.spec.ts/ Pool QA 3.1.3Unit:
PoolPagetests mirroringSwapPage.feeDiscountRegistryBanner.test.tsx;tokenRegistry/ Tiers formatting tests.Test plan (attack / hack / abuse vectors)
Register+ balance OKget_discountstays 0; register fails or deregisters — UI must not invent a discount/tierson same originconfig.cl8y_token/ env address, not a free-text symbol aloneVerification criteria
cd frontend-dapp && npm run test:runcovers new Pool + decimals tests.make verify-issue-365still passes after sharing warning util on Pool.get_registration/get_discount/ CW20balancefor their wallet against fee-discountcl8y_tokenbefore claiming on-chain failure.mentioned in issue #477
Investigation notes (bug report triage)
Reporter symptom: Pool CORAL/PEARL shows
FEE: 1.80%; claim that CL8Y-cb holding fee reduction is not applied.Not a missing on-chain feature. Fee discount is live on soft-launch mainnet (registry + pair wiring + production
VITE_FEE_DISCOUNT_ADDRESSindex.cl8y.combundle; indexer fee-discount health OK).Most likely explanations for 1.80% badge:
/tiers(holding alone does nothing)cl8y_tokenCompanion: #477 (token identity docs +
indexer.env.exampledryrun stubs).mentioned in commit
408940320dmentioned in merge request !1013
mentioned in commit
6f8987d028Reporter follow-up
Confirmed: on-chain + UI discount work after
/tiersregister. The Pool1.80%badge was expected for an unregistered wallet, not a broken fee-discount path.Keeping this issue open as UX / discoverability only (Pool CTA, eligibility copy, outage parity) so the next user does not hit the same confusion. Not a functional defect.
changed title from
fix/ux: Pool fee badge shows base 1.80% — clarify CL8Y fee discount requires register + eligible CW20toux: Pool fee badge — surface register CTA / eligibility (reporter confirmed discount works after /tiers)mentioned in issue #542
mentioned in issue #547
mentioned in issue #651