fix: gate CL8Y fee-tier chrome on pair discount_registry (#537) #1066

Merged
PlasticDigits merged 2 commits from fix/537-pair-fee-tier-gate into main 2026-08-17 03:36:38 +00:00
PlasticDigits commented 2026-08-17 01:03:55 +00:00 (Migrated from gitlab.com)

Summary

  • Closes #537. Swap / Pool / Trade fee chrome and useLimitOrderMakerFeeRates no longer advertise a wallet get_discount unless the pair DISCOUNT_REGISTRY is set and matches VITE_FEE_DISCOUNT_ADDRESS (invariant I14).
  • Unwired pairs show full fee_bps / full maker place fee with no strikethrough, and hide the pair-scoped Hold-CL8Y CTA. Hybrid quotes with trader were already execute-aligned; this is chrome-only.
  • LCD probe uses raw key discount_registry (ZGlzY291bnRfcmVnaXN0cnk=) with a get_discount_registry fallback for future wasm. Probe failure is fail-closed (full fee in the UI).

Parent ops wiring remains #535 (out of scope here).

Test plan

  • make verify-issue-537 (unit + docs/skills grep; retest in-script)
  • Vitest: pairDiscountRegistry helpers + LCD probe, useLimitOrderMakerFeeRates wired/unwired/mismatch, Pool + Swap fee chrome
  • Regression: SwapPage.test.tsx, PoolPage.test.tsx, TradePage.test.tsx (103 tests)
  • python3 scripts/check_fee_discount_tier_docs.py
  • Manual: registered tier-9 wallet on an unwired pair (if any remain) — Fee row is plain 1.80%, no strikethrough; Place limit maker fee is 90 bps not 0
  • Manual: wired gem pair still strikethroughs the tier discount
  • Manual: /trade pre-submit maker place bps matches on-chain maker_fee_amount for unwired vs wired

Issue criteria

  • Gate Swap / Pool / Trade fee-tier display and useLimitOrderMakerFeeRates on pair registry being set (and matching the configured contract)
  • Unwired pair: show full fee_bps / full maker place fee; do not strikethrough a phantom discount
  • Do not invent a client-side discount that the pair will not apply
  • Tests for unwired vs wired pair
  • Invariants documented (I14 / F537-1–F537-6) and crosslinked (docs/, skills/AGENTS_FRONTEND_PAIR_FEE_DISCOUNT.md, AGENTS.md)

Not in this MR

  • On-chain SetDiscountRegistry* wiring (#535) — closed ops work
  • Pair GetDiscountRegistry QueryMsg / CreatePair inherit (live 1.13.0 wasm still has no query variant; raw key is the probe)
  • Indexer pair-registry field (not required for the dApp gate)

Follow-up (only if needed)

  • Ship pair GetDiscountRegistry with the CreatePair inherit issue so the dApp can drop the raw-state path on LCDs that 403 /raw/.
## Summary - Closes [#537](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/537). Swap / Pool / Trade fee chrome and `useLimitOrderMakerFeeRates` no longer advertise a wallet `get_discount` unless the **pair** `DISCOUNT_REGISTRY` is set and matches `VITE_FEE_DISCOUNT_ADDRESS` (invariant **I14**). - Unwired pairs show full `fee_bps` / full maker place fee with **no** strikethrough, and hide the pair-scoped Hold-CL8Y CTA. Hybrid quotes with `trader` were already execute-aligned; this is chrome-only. - LCD probe uses raw key `discount_registry` (`ZGlzY291bnRfcmVnaXN0cnk=`) with a `get_discount_registry` fallback for future wasm. Probe failure is fail-closed (full fee in the UI). Parent ops wiring remains [#535](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/535) (out of scope here). ## Test plan - [x] `make verify-issue-537` (unit + docs/skills grep; retest in-script) - [x] Vitest: `pairDiscountRegistry` helpers + LCD probe, `useLimitOrderMakerFeeRates` wired/unwired/mismatch, Pool + Swap fee chrome - [x] Regression: `SwapPage.test.tsx`, `PoolPage.test.tsx`, `TradePage.test.tsx` (103 tests) - [x] `python3 scripts/check_fee_discount_tier_docs.py` - [ ] Manual: registered tier-9 wallet on an unwired pair (if any remain) — Fee row is plain `1.80%`, no strikethrough; Place limit maker fee is 90 bps not 0 - [ ] Manual: wired gem pair still strikethroughs the tier discount - [ ] Manual: `/trade` pre-submit maker place bps matches on-chain `maker_fee_amount` for unwired vs wired ## Issue criteria - [x] Gate Swap / Pool / Trade fee-tier display and `useLimitOrderMakerFeeRates` on pair registry being set (and matching the configured contract) - [x] Unwired pair: show full `fee_bps` / full maker place fee; do not strikethrough a phantom discount - [x] Do not invent a client-side discount that the pair will not apply - [x] Tests for unwired vs wired pair - [x] Invariants documented (I14 / F537-1–F537-6) and crosslinked (`docs/`, `skills/AGENTS_FRONTEND_PAIR_FEE_DISCOUNT.md`, `AGENTS.md`) ## Not in this MR - On-chain `SetDiscountRegistry*` wiring ([#535](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/535)) — closed ops work - Pair `GetDiscountRegistry` QueryMsg / CreatePair inherit (live 1.13.0 wasm still has no query variant; raw key is the probe) - Indexer pair-registry field (not required for the dApp gate) ## Follow-up (only if needed) - Ship pair `GetDiscountRegistry` with the CreatePair inherit issue so the dApp can drop the raw-state path on LCDs that 403 `/raw/`.
PlasticDigits commented 2026-08-17 03:36:05 +00:00 (Migrated from gitlab.com)

added 3 commits

  • 11e17f1f...651cb642 - 2 commits from branch main
  • 395416d0 - merge: resolve #537 docs after factory discount registry on main

Compare with previous version

added 3 commits <ul><li>11e17f1f...651cb642 - 2 commits from branch <code>main</code></li><li>395416d0 - merge: resolve #537 docs after factory discount registry on main</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/348/diffs?diff_id=1964733875&start_sha=11e17f1f76a301dea4c776f12e809b8c23ffc950)
PlasticDigits commented 2026-08-17 03:36:38 +00:00 (Migrated from gitlab.com)

mentioned in commit c4c2b78dd2

mentioned in commit c4c2b78dd22ff98ccc0bd4d664ace631108ed259
PlasticDigits (Migrated from gitlab.com) merged commit c4c2b78dd2 into main 2026-08-17 03:36:38 +00:00
PlasticDigits commented 2026-08-17 03:42:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #537

mentioned in issue #537
PlasticDigits commented 2026-08-17 03:42:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #533

mentioned in issue #533
PlasticDigits commented 2026-08-17 03:42:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #538

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