Economic pairs (cLUNC/UST1, UST1/cUSTC, UST1/USTR) have no discount registry attached — CL8Y tier discount not applied on swaps or limit placement #535
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#535
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
Reading
discount_registryraw state on every factory pair (/cosmwasm/wasm/v1/contract/<pair>/raw/ZGlzY291bnRfcmVnaXN0cnk=): the 10 gem pairs return the registry addressterra1wcczsdk7jwj99n3my6wx8wr4ee0hn6yaapgd792lgx5elrdtrn2scfnecz; UST1/cUSTC, UST1/USTR and cLUNC/UST1 returnnull.instantiatesetsDISCOUNT_REGISTRY = None(paircontract.rs) and onlySetDiscountRegistry/SetDiscountRegistryAll/SetDiscountRegistryBatchon the factory wires it, so any pair created after the last registry sweep is unwired — which is exactly the three economic pairs launched 08-14/15.Effect
lookup_effective_fee_bps_cachedreturns(fee_bps, None)→ swaps charge the full 180 bps and limit placement paysmaker_fee_bps(180)= 90 bps, regardless of CL8Y tier.Observed: tier-9 wallet (registry
get_discountreturnsdiscount_bps 9500/limit_discount_bps 10000) placing on UST1/USTR after the 1.13.0 migrate — tx0944E85F3BD54EC9A75FC3A5E6A99A8BAC96DFA7E79D4BFAED3CF0914AB256EE:effective_fee_bps: 180,maker_fee_amount: 9000on 1,000,000 escrowed. Same 180 bps on every cLUNC/UST1 and UST1/cUSTC placement over the last 24h; the fee is not refunded on cancel.Fix
Owner tx
SetDiscountRegistryAll { registry }(orBatch) on the factory. Longer term, consider havingcreate_pairpass the factory's registry into the pair at instantiate so future listings don't need a manual sweep.Note
The dApp fee-tier UI shows the tier discount as active on these pairs, so takers are quoted a fee they don't actually get.
Investigate proposed direction for leo - track immediate ops here, and for a deploy+migrate to fix fguture problems open a new issue
mentioned in issue #536
marked as related to #536
mentioned in issue #537
marked as related to #537
Direction
Agreed. Immediate ops stay on this issue. Follow-ups:
CreatePairsnapshots the discount registry (deploy + migrate) so new listings are not unwired.None.On-chain check (2026-08-17)
Factory
terra1ejpgvv7g3hj0u6fpcnxhflqp84g0w3cnaskqkg5733ygwlmf963sfchseahas 13 pairs. Governance is the 2-of-3terra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7(cl8ydeploycannot sign this).Raw
discount_registry:terra1klwuxas6x7p6fjde60kq70t0hu86wvt3fvyr2vgs0nn32fnv0q4qwznwp4terra1wcczsdk7jwj99n3my6wx8wr4ee0hn6yaapgd792lgx5elrdtrn2scfneczterra1ceprjsxp86ggftf5e38wwt34l83e5gq7penkdnv4wsatkwcs8v6qccw55fnullterra16vxrhpvpcucu05y0nr862vf9hnqeh274uaff4s7hz4n0ea74006qf5hgqynullterra1su5363453fj326u4t0kqar30f35cm3n0dc9yksg379u6875z350s4mm7h4nullDo not use
SetDiscountRegistryAll. PAIR_COUNT 13 > All cap 10 (DiscountRegistryAllTooManyPairs, #242). Use three targetedset_discount_registrytxs (preferred) or twoset_discount_registry_batchtxs (limit10, thenstart_after9).Signer:
./scripts/multisig-2of3-host-tx.sh(multisig_2of3+multisig1/multisig2).Ops complete — verified 2026-08-17
Full factory sweep via
set_discount_registry_batch(All cap is 10; factory has 13 pairs). Signed by 2-of-3terra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7.2011B3C7…CB850F9Astart_after: null,limit: 10pairs_updated=10,has_more=true,next_start_after=9BB6C483C…A1FDB28Cstart_after: 9,limit: 10pairs_updated=3,has_more=false(UST1/cUSTC, UST1/USTR, cLUNC/UST1)Raw
discount_registryon all 13 factory pairs is nowterra1wcczsdk7jwj99n3my6wx8wr4ee0hn6yaapgd792lgx5elrdtrn2scfnecz(previouslynullon the three economic pairs).Already-paid place fees on those pairs are not refunded. New swaps and new placements will look up CL8Y tier.
Follow-ups stay open: #536 (CreatePair inherit), #537 (dApp UI gate). Closing this issue — ops scope done.
mentioned in commit
4d62c40091mentioned in merge request !1065
mentioned in merge request !1066
mentioned in issue #538
mentioned in merge request !1075
Thanks for the same-day ops on this (both batch txs verified) and for splitting the durable fixes into #536/#537 — swaps and placements on the economic pairs now pick up the CL8Y tier as expected.
mentioned in issue #598