Expose wrapped-token backing ratio on-chain, and consider a mint cap relative to treasury reserves #1208
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#1208
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?
The wrap mapper and treasury contracts do not expose the ratio between a wrapped token's total_supply and the native reserve held against it. Integrators must derive it by querying token_info on the cw20 and the bank balance of the treasury separately, and there is no event or query that signals when the ratio changes.
Because the cw20 minter can issue wrapped tokens without a corresponding wrap_deposit, total_supply can move independently of reserves within a single block range, and a holder has no on-chain way to observe this other than polling two unrelated endpoints. Redemption appears to be first-come-first-served against the reserve, so the ratio is material to anyone holding the wrapped asset.
Requests, in order of preference:
{"backing":{}}query to the treasury or mapper returning native_reserve, wrapped_supply and the derived ratio per wrapped denom.Item 2 alone would be a large improvement — it makes "wrapped supply" usable as an adoption metric, which it currently is not.
Adding a data point for the mint-cap half of this issue. Over the last 24 hours the cLUNC treasury's native reserve fell roughly 45%, including a single ~60% step inside one 90-minute window, taking the backing ratio from about 8% to about 4.6% against an unchanged supply profile. An integrator holding wrapped balances has no on-chain way to observe either the reserve or the ratio — both have to be reconstructed by querying the treasury's bank balance and dividing by cw20 total_supply, which is not something a contract can do on behalf of its users. A backing_ratio query on the wrap contract, and a mint path that cannot take the ratio below a configured floor, would let integrators set their own risk limits instead of discovering a move like this after the fact.
Follow-up data point on this request, 6 days on. The treasury reserve backing the wrapped LUNC token has now moved 4.56M → 21.78M → 52.08M over three days, while reported backing sits near 10% of wrapped supply, because supply includes a large admin-minted tranche that was never deposit-backed.
The point stands and is sharpened by the recovery: with no on-chain backing query, an integrator cannot distinguish "reserve grew 11x" from "supply grew faster than reserve" without reconstructing mint events by hand. A read-only
backing {}returning {reserve, supply, ratio} would make this a one-call check. A mint cap expressed relative to reserves would make it unnecessary.