bug(pricing): recover rejected USTR reference and propagate protocol LP and Swap readiness #1511
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#1511
Loading…
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?
Problem and why a new implementation is needed
On
/protocol, USTR/USD is blank, and the UST1/USTR row in Top pairs has 30-day volume but no V2 LP USD value or VOL/LP ratio. Swap also remains in a pricing wait for USDT→USTR with a receive target of 1 USTR. These related availability symptoms belong in one reference-policy/recovery issue. The separate Trade headline decimal defect is #1512.The live rejection is real: USTR currently exceeds the deliberately fixed hub-reference bound. A populated chart or an active factory pair does not establish a safe current reference. The work is to diagnose legitimate repricing versus manipulation, implement evidence-backed recovery and honest outcome propagation, and restore valuation/executable quotes only when their original safety requirements are satisfied. Simply displaying a number or disabling the guard is not acceptance.
This is an anonymized technical synthesis. No supplied conversation, screenshot, reporter identity, wallet, transaction, private endpoint or credential is published.
Investigation baseline and independently observed evidence
Reviewed source and live backend
/healthrevision:c3e216842fe3bac00e2c71bb967950e004b3a6cf(2026-10-15 UTC). Frontend artifact provenance was not independently attested, so screenshot behavior is reported evidence rather than an exact-revision browser acceptance claim.Bounded anonymous public GET observations:
GET https://indexer.dex.cl8y.com/api/v1/hub-pricesreturned healthy numeric cUSTC, cLUNC and UST1 entries. USTR returnedprice_usd:null,quality:"divergent",divergence_pct:"14.04830945380059799100",reference_at:"2026-10-06T11:56:58.141387+00:00",as_of:nullandmax_age_seconds:20. A second/hub-prices/ustrread at 08:15:51 UTC returned the same rejection. The 10% bound explains this missing mark; the evidence does not establish whether the market move is legitimate or malicious.GET /api/v1/protocol/top-pairsreturned the canonical UST1/USTR market withvolume_usd_30d:"15360.733387029600830397", but omitted bothliquidity_usdandvolume_per_tvl. Other returned markets had numeric values.terra16vxrhpvpcucu05y0nr862vf9hnqeh274uaff4s7hz4n0ea74006qf5hgqy; UST1 is asset_0 with 6 decimals, USTR asset_1 with 18. The pair endpoint reports active and not code-ID-frozen; these catalog flags do not certify price or executable readiness.1000000000000000000, USTR→USDT offering the same raw amount, UST1→USTR offering1000000, and USTR→UST1 offering1000000000000000000. All usedmax_spread=0.05,protection_policy=quote_relative_v1, maker cap 8, and no actor. A repeat USDT→USTR exact-output GET at 08:15:28 UTC returned HTTP 503{"error":"missing_observations"}. Only that repeat's reason was independently retained; do not infer reasons for the other four statuses.Reproduce without a wallet: open
/protocol, inspect USTR and the UST1/USTR top-pair row; open Swap with the pinned USDT/USTR identities and enter 1 USTR in Receive; correlate bounded API outcomes with hub/reference state. Historical candles/trades can remain available during current rejection and are not evidence of current fair-reference eligibility.Current codebase
indexer/src/indexer/hub_usd.rsderives USTR from eligible canonical reserve pairs against already-priced cUSTC or UST1, humanizes decimals, ranks independent priced-leg depth and preserves the separate $100 hub depth floor.indexer/src/indexer/hub_guard.rs::contain_markcompares the mark/USTC ratio against a persisted fixed reference. More than 10% divergence rejects the mark. Initial confirmation/source switching requires 60 seconds of distinct original observations; repeated divergence cannot reset the fixed reference.indexer/src/db/queries/hub_prices.rs::refresh_hub_pricesapplies containment, suppresses rejected marks, retains reference state, and prevents unqualified UST1 from anchoring USTR.indexer/src/api/hub_prices.rs::entry_forexposes a null price with reference quality and divergence metadata.frontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsxrenders absent/nonpositive price as—;useProtocolHubPricesQuery.tspolls every 30 seconds. This display is the endpoint's null value, not evidence of a token-label lookup failure.indexer/src/indexer/protocol_tvl.rsrequires both supported legs to have eligible prices. It must not fall back to 2× the remaining leg during a supported-hub outage.indexer/src/db/queries/protocol_top_pairs.rsjoins the scheduled pair-liquidity stamps; the API omits absent LP/ratio, andProtocolTopPairs.tsxformats them as dashes. Loss of the USTR mark therefore explains the valuation dependency; contemporaneous raw reserve/reference database evidence remains needed to exclude an additional reserve failure.indexer/src/api/local_reference_quote.rs::ReferencePrices::observeadmits only usable marks into the frozen local quote generation.unavailable_reasonmaps an absent mark without qualified structural-exclusion evidence tomissing_observations. The economic-floor exclusion census does not by itself prove a divergent hub's condition. Reviewlocal_quote/diagnostics.rs,local_quote/ingestion.rsand publication before changing classification.frontend-dapp/src/utils/routeQuoteErrors.ts,hooks/useQuotePricingDataPending.ts,hooks/useQuoteErrorRecovery.ts,hooks/useRouteSolveProgress.tsandpages/SwapPage.tsxintentionally show recoverable missing/stale data as a wait. A repeatedly known policy rejection can consequently look like generic warm-up unless original-time policy evidence is propagated correctly.Source tree: reviewed revision. Related: #1391 fixed-reference containment, #1380 valuation quality, #1453 reserve reliability, #1479 policy evidence, #1499 quote lifecycle. This issue covers the freshly reproduced USTR fixed-reference availability gap, rather than reopening those entire scopes.
Recommended direction
Constraints and guardrails
Acceptance criteria
Test plan: functional, failure and recovery paths
Test plan: attack, hack and abuse vectors
Verification criteria
Record final revision, UTC, commands, meaningful expected raw values, API statuses/reasons, original generations/timestamps and exact deployed backend/frontend artifacts. Run
make verify-issue-1391,make verify-issue-1380,make verify-issue-1453,make verify-issue-1479,make verify-issue-1473, and relevantmake verify-issue-1452/make verify-issue-1464regressions after implementation. Include desktop/phone recovery and bounded socket/browser latency receipts; loading/rejections are not useful quote successes. Preserve prior failures. Unavailable holds/gates do not prevent engineering or issue publication; unexecuted funded/device/deployment/history criteria remain explicitly unverified rather than PASS.Checks executed during investigation
divergentwith null USD; missing top-pair LP/ratio; four quote HTTP 503 outcomes and one repeated exact-outputmissing_observationsresponse, as recorded above.make verify-issue-524: PASS, 10 groups; its main display suite passed 181 tests despite the independent decimal reproduction failing twice. This is a coverage gap, not product acceptance.make verify-issue-1473passed 843 tests with one intentionally ignored test. The oracle/hub/economic/protocol-TVL library groups selected bymake verify-issue-1391passed 31/32/13/20 tests respectively. The six-file frontend group selected bymake verify-issue-1479passed 155 tests, and the four-file protocol group selected bymake verify-issue-1380passed 97 tests.1391,1453,1479,1473and1380verifier attempts were not all completed within this bounded investigation; no overall PASS is claimed. Some integration groups failed with missing dedicated QA credentials. A new owned loopback-only ephemeral Postgres and restricted marked QA control database were provisioned; subsequent disposable tests ran successfully, but that does not erase earlier failures or certify every suite. The first1479harness ended FAIL with 10 passing/2 failing groups because its socket prerequisite was not exported; a correctly configured repeat was started and remained partial. A separate correctly configuredcargo test --locked --manifest-path indexer/Cargo.toml --test book_snapshot_loop -- --test-threads=1retest then passed all 22 tests (0 failed), including provider/observation recovery. Full implementation verification remains future work.Source review: the reported USTR fixed-reference availability blocker was addressed by merged PR #1526, implementation commit
90b5b0b6985947b9c341650196cbde791bec921e, merged into main as77597ad9. Reviewed current checkout:6c07c2f5fa05989ba440e995b93929f59730fd70.refresh_hub_markspublishes fresh positive reserve spots without the old 10% fixed-reference rejection.hub_guardwas removed, and migration20261016120000_drop_hub_price_references.sqldrops the reference table. API provenance now reportslive-reserve-spot-v1; oracle-safety policy/docs were updated accordingly.This addresses the reported divergence blocker through a policy replacement, not the original issue's requested fixed-reference recovery procedure. In particular, #1511 explicitly said disabling the guard was not acceptance; #1526 intentionally removes it. The scoped backup/rollback/reconfirmation procedure and divergence-specific rejection propagation described here therefore cannot be marked implemented as written. The issue needs reconciliation with the newer merged policy before closure.
No tests, verification targets, live API/browser checks, deployments or database operations were run for this review, as requested. Actual deployed USTR/LP/VOL-LP recovery, same-intent browser recovery and the full economics/signing matrix remain unverified by this review. Leaving the issue open and its acceptance boxes unchanged.
policy change approved