bug(pricing): recover rejected USTR reference and propagate protocol LP and Swap readiness #1511

Closed
opened 2026-10-15 08:22:10 +00:00 by PlasticDigits · 2 comments
Owner

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 /health revision: 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:

  • At 08:12:33 UTC, GET https://indexer.dex.cl8y.com/api/v1/hub-prices returned healthy numeric cUSTC, cLUNC and UST1 entries. USTR returned price_usd:null, quality:"divergent", divergence_pct:"14.04830945380059799100", reference_at:"2026-10-06T11:56:58.141387+00:00", as_of:null and max_age_seconds:20. A second /hub-prices/ustr read 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.
  • At 08:12:34 UTC, GET /api/v1/protocol/top-pairs returned the canonical UST1/USTR market with volume_usd_30d:"15360.733387029600830397", but omitted both liquidity_usd and volume_per_tvl. Other returned markets had numeric values.
  • Factory pair: 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.
  • Four anonymous route GETs at 08:14:24–26 UTC returned HTTP 503: USDT→USTR targeting raw output 1000000000000000000, USTR→USDT offering the same raw amount, UST1→USTR offering 1000000, and USTR→UST1 offering 1000000000000000000. All used max_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.rs derives 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_mark compares 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_prices applies containment, suppresses rejected marks, retains reference state, and prevents unqualified UST1 from anchoring USTR. indexer/src/api/hub_prices.rs::entry_for exposes a null price with reference quality and divergence metadata.
  • frontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsx renders absent/nonpositive price as —; useProtocolHubPricesQuery.ts polls every 30 seconds. This display is the endpoint's null value, not evidence of a token-label lookup failure.
  • indexer/src/indexer/protocol_tvl.rs requires 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.rs joins the scheduled pair-liquidity stamps; the API omits absent LP/ratio, and ProtocolTopPairs.tsx formats 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::observe admits only usable marks into the frozen local quote generation. unavailable_reason maps an absent mark without qualified structural-exclusion evidence to missing_observations. The economic-floor exclusion census does not by itself prove a divergent hub's condition. Review local_quote/diagnostics.rs, local_quote/ingestion.rs and publication before changing classification.
  • frontend-dapp/src/utils/routeQuoteErrors.ts, hooks/useQuotePricingDataPending.ts, hooks/useQuoteErrorRecovery.ts, hooks/useRouteSolveProgress.ts and pages/SwapPage.tsx intentionally 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.

  1. Capture a bounded, read-only, consistent snapshot of the effective policy, canonical identities/decimals, candidate reserves and original heights/times, anchor quorum, stored reference and source transitions. Establish when/why USTR crossed the bound; separate a market repricing from stale inputs, unit errors, source selection or manipulation. Current observations cannot reconstruct missing history.
  2. Implement/document an evidence-backed recovery path. Existing scoped maintenance may be appropriate after independently reviewed evidence: preserve original reference rows, identify the exact affected identity/scope, make application explicit and auditable, support rollback, and re-enter normal confirmation. Automate engineering/evidence work where possible. If legitimate repeated repricing needs a new reference model, design it as a separate explicit policy version with independent corroboration/manipulation tests. A waiting period or current reserve ratio alone is insufficient evidence. Do not automatically reset/ratchet on divergence, restart, outage or user requests.
  3. Carry a bounded original-time policy outcome from the independently scheduled producer into the local quote generation when authoritative evidence proves a reference rejection. Use an existing allowlisted policy-excluded outcome where semantically correct, or a reviewed fixed typed reason. Unknown, incomplete, stale or capacity-limited evidence remains recoverable missing/stale data. No provider prose or diagnostic panel in the normal retail flow.
  4. Recover the unchanged active input after genuinely eligible scheduled publication without re-entry/reload; revoke unsafe execution immediately on genuine new negatives. LP stamps and VOL/LP should recover through ordinary atomic valuation publication when both supported legs qualify. Preserve honest nulls otherwise.

Constraints and guardrails

  • Preserve O1391, Q1380, LF1453, SM1479, TQ1473 and LQ1452. The separate $10 economic total-TVL floor is not a reduction of the $100 independently priced hub-leg requirement.
  • No token/address exception, UST1=$1 assumption, USTR=2.5×USTC fallback, chart/last-trade reference substitution, reference-free signing or unreviewed threshold increase. Spot remains non-oracle-grade. No public reset endpoint.
  • Requests read local observations only: zero request-triggered RPC, chain/provider validation or ingestion; preserve bounded provider/search/cache/concurrency work, original 20-second observations, 180-second configuration expiry and atomic compatible generations. Diagnostics never renew timestamps.
  • Preserve raw amount/tax/hook/funding economics, positive hop/post-hook/final floors, exact UI tolerance, ≥99% nonwaivable protection, Expert controls, pinned reviewed transactions and unknown-budget rejection.
  • Both supported valuation legs must qualify; absent prices never become zero, 2×-leg estimates, complete coverage or fabricated history. Volume history and live LP value have different time/provenance semantics.
  • QA owns disposable state. Never reset shared chain/database state, mutate production references during investigation, expose actor identifiers or publish raw logs/conversations/screenshots.

Acceptance criteria

  • Explain the reproduced USTR divergence with exact identity, original input/reference provenance and a bounded timeline, explicitly identifying unavailable history.
  • Provide a reviewed, reproducible safe recovery procedure/implementation with scoped backup, audit, rollback and re-confirmation; no automatic reference ratchet. Valid evidence permits recovery; insufficient evidence continues to reject safely.
  • Fresh authoritative policy rejection yields a truthful bounded non-executable API/UI outcome; absent/stale/incomplete observations remain recoverable waits. HTTP 200 health or idle route search is never called quote readiness.
  • When eligible observations return, current USTR, UST1/USTR LP and VOL/LP recover consistently; the unchanged Swap intent recovers automatically. Supported-price loss removes affected current valuations/signing eligibility without contaminating other markets.
  • All applicable direct/routed/native exact-input and receive-target paths preserve original economics, expiry and signing protections.

Test plan: functional, failure and recovery paths

  • Unit: below/at/above 10% divergence; initial 60-second confirmation, repeated/out-of-order/same-time/future observations, source switching/pinning, independent USTC movement, missing anchor, both decimal orientations and numeric limits. Confirm reference identity/value/time never ratchet.
  • Disposable DB/API: consistent producer publication and quote cohorts; admitted→divergent→stale/absent evidence→eligible recovery, producer restart/cancellation, replayed generations, pending fees/books, concurrent publication and rollback. Assert policy evidence cannot outlive its original window or splice with newer reserves/anchors.
  • Valuation: both supported legs present/missing, genuine zero/decrease, reserves missing/stale, unsupported-only markets, pair-stamp removal/recovery, null LP and null VOL/LP, total/partial quality and unchanged historical volume. No self-valued backing or 2× outage substitution.
  • Quote matrix: USDT↔USTR, UST1↔USTR, cUSTC↔USTR and routed native USTC/LUNC families; both exact input and exact receive where supported; 1 raw unit, 1 human token, ordinary and reserve-exceeding amounts, 1/5/30% tolerance, pool-only/hybrid and genuine unsupported inverse modes. Assert exact raw output/floors or the correct typed blocker and zero quote RPC.
  • Desktop/phone: anonymous and connected contexts, initial policy rejection versus transient warm-up, idle beyond 20/180 seconds, same-intent recovery, amount/token/direction/protection changes, obsolete responses, expiry, active confirmation and pinned review. Reserve stable form geometry and one truthful action.

Test plan: attack, hack and abuse vectors

  • Manipulate canonical reserves above/below the bound, alternate USTR source pools, repeatedly oscillate/restart to attempt reference ratcheting, and vary USTC/UST1 upstream prices. No current unsafe mark or executable fair output may be manufactured.
  • Symbol/contract/denom spoofing, contradictory identities, 6/18 decimal swaps, zero/negative/oversized numbers, malicious timestamps and replayed anchors must fail closed. Candidate self-valued TVL cannot satisfy independent depth.
  • Flood quote/progress/malformed reason requests and cancel clients: fixed work/response/concurrency caps, released permits, no request ingestion or remote calls. Expired policy evidence cannot permanently deny an unrelated/newly qualified identity.
  • Attempt unauthorized/public reset and cross-market reference deletion; reject wrong scope/identity and retain audit/rollback evidence. Inject hostile provider bodies/URLs/HTML; expose only fixed reason classes, no secrets or actor data.
  • Try using historical/indicative/display-retained amounts to sign after policy rejection or expiry; validate that mutation remains blocked and failed funded execution rolls back completely in owned fixtures.

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 relevant make verify-issue-1452/make verify-issue-1464 regressions 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

  • Live bounded read-only reproduction and repeat: USTR divergent with null USD; missing top-pair LP/ratio; four quote HTTP 503 outcomes and one repeated exact-output missing_observations response, 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.
  • The complete indexer library run selected by make verify-issue-1473 passed 843 tests with one intentionally ignored test. The oracle/hub/economic/protocol-TVL library groups selected by make verify-issue-1391 passed 31/32/13/20 tests respectively. The six-file frontend group selected by make verify-issue-1479 passed 155 tests, and the four-file protocol group selected by make verify-issue-1380 passed 97 tests.
  • Broader 1391, 1453, 1479, 1473 and 1380 verifier 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 first 1479 harness 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 configured cargo test --locked --manifest-path indexer/Cargo.toml --test book_snapshot_loop -- --test-threads=1 retest then passed all 22 tests (0 failed), including provider/observation recovery. Full implementation verification remains future work.
  • No source fix, production reference reset, deployment, funded transaction, full live browser matrix or historical reconstruction was performed. Those omissions do not hold issue publication; acceptance remains unchecked.
## 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](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/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 `/health` revision: `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: - At 08:12:33 UTC, `GET https://indexer.dex.cl8y.com/api/v1/hub-prices` returned healthy numeric cUSTC, cLUNC and UST1 entries. USTR returned `price_usd:null`, `quality:"divergent"`, `divergence_pct:"14.04830945380059799100"`, `reference_at:"2026-10-06T11:56:58.141387+00:00"`, `as_of:null` and `max_age_seconds:20`. A second `/hub-prices/ustr` read 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. - At 08:12:34 UTC, `GET /api/v1/protocol/top-pairs` returned the canonical UST1/USTR market with `volume_usd_30d:"15360.733387029600830397"`, but omitted both `liquidity_usd` and `volume_per_tvl`. Other returned markets had numeric values. - Factory pair: `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. - Four anonymous route GETs at 08:14:24–26 UTC returned HTTP 503: USDT→USTR targeting raw output `1000000000000000000`, USTR→USDT offering the same raw amount, UST1→USTR offering `1000000`, and USTR→UST1 offering `1000000000000000000`. All used `max_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.rs` derives 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_mark` compares 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_prices` applies containment, suppresses rejected marks, retains reference state, and prevents unqualified UST1 from anchoring USTR. `indexer/src/api/hub_prices.rs::entry_for` exposes a null price with reference quality and divergence metadata. - `frontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsx` renders absent/nonpositive price as `—`; `useProtocolHubPricesQuery.ts` polls every 30 seconds. This display is the endpoint's null value, not evidence of a token-label lookup failure. - `indexer/src/indexer/protocol_tvl.rs` requires 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.rs` joins the scheduled pair-liquidity stamps; the API omits absent LP/ratio, and `ProtocolTopPairs.tsx` formats 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::observe` admits only usable marks into the frozen local quote generation. `unavailable_reason` maps an absent mark without qualified structural-exclusion evidence to `missing_observations`. The economic-floor exclusion census does not by itself prove a divergent hub's condition. Review `local_quote/diagnostics.rs`, `local_quote/ingestion.rs` and publication before changing classification. - `frontend-dapp/src/utils/routeQuoteErrors.ts`, `hooks/useQuotePricingDataPending.ts`, `hooks/useQuoteErrorRecovery.ts`, `hooks/useRouteSolveProgress.ts` and `pages/SwapPage.tsx` intentionally 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](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/c3e216842fe3bac00e2c71bb967950e004b3a6cf). Related: [#1391](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1391) fixed-reference containment, [#1380](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1380) valuation quality, [#1453](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1453) reserve reliability, [#1479](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1479) policy evidence, [#1499](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1499) quote lifecycle. This issue covers the freshly reproduced USTR fixed-reference availability gap, rather than reopening those entire scopes. ## Recommended direction 1. Capture a bounded, read-only, consistent snapshot of the effective policy, canonical identities/decimals, candidate reserves and original heights/times, anchor quorum, stored reference and source transitions. Establish when/why USTR crossed the bound; separate a market repricing from stale inputs, unit errors, source selection or manipulation. Current observations cannot reconstruct missing history. 2. Implement/document an evidence-backed recovery path. Existing scoped maintenance may be appropriate after independently reviewed evidence: preserve original reference rows, identify the exact affected identity/scope, make application explicit and auditable, support rollback, and re-enter normal confirmation. Automate engineering/evidence work where possible. If legitimate repeated repricing needs a new reference model, design it as a separate explicit policy version with independent corroboration/manipulation tests. A waiting period or current reserve ratio alone is insufficient evidence. Do not automatically reset/ratchet on divergence, restart, outage or user requests. 3. Carry a bounded original-time policy outcome from the independently scheduled producer into the local quote generation when authoritative evidence proves a reference rejection. Use an existing allowlisted policy-excluded outcome where semantically correct, or a reviewed fixed typed reason. Unknown, incomplete, stale or capacity-limited evidence remains recoverable missing/stale data. No provider prose or diagnostic panel in the normal retail flow. 4. Recover the unchanged active input after genuinely eligible scheduled publication without re-entry/reload; revoke unsafe execution immediately on genuine new negatives. LP stamps and VOL/LP should recover through ordinary atomic valuation publication when both supported legs qualify. Preserve honest nulls otherwise. ## Constraints and guardrails - Preserve O1391, Q1380, LF1453, SM1479, TQ1473 and LQ1452. The separate $10 economic total-TVL floor is not a reduction of the $100 independently priced hub-leg requirement. - No token/address exception, UST1=$1 assumption, USTR=2.5×USTC fallback, chart/last-trade reference substitution, reference-free signing or unreviewed threshold increase. Spot remains non-oracle-grade. No public reset endpoint. - Requests read local observations only: zero request-triggered RPC, chain/provider validation or ingestion; preserve bounded provider/search/cache/concurrency work, original 20-second observations, 180-second configuration expiry and atomic compatible generations. Diagnostics never renew timestamps. - Preserve raw amount/tax/hook/funding economics, positive hop/post-hook/final floors, exact UI tolerance, ≥99% nonwaivable protection, Expert controls, pinned reviewed transactions and unknown-budget rejection. - Both supported valuation legs must qualify; absent prices never become zero, 2×-leg estimates, complete coverage or fabricated history. Volume history and live LP value have different time/provenance semantics. - QA owns disposable state. Never reset shared chain/database state, mutate production references during investigation, expose actor identifiers or publish raw logs/conversations/screenshots. ## Acceptance criteria - [ ] Explain the reproduced USTR divergence with exact identity, original input/reference provenance and a bounded timeline, explicitly identifying unavailable history. - [ ] Provide a reviewed, reproducible safe recovery procedure/implementation with scoped backup, audit, rollback and re-confirmation; no automatic reference ratchet. Valid evidence permits recovery; insufficient evidence continues to reject safely. - [ ] Fresh authoritative policy rejection yields a truthful bounded non-executable API/UI outcome; absent/stale/incomplete observations remain recoverable waits. HTTP 200 health or idle route search is never called quote readiness. - [ ] When eligible observations return, current USTR, UST1/USTR LP and VOL/LP recover consistently; the unchanged Swap intent recovers automatically. Supported-price loss removes affected current valuations/signing eligibility without contaminating other markets. - [ ] All applicable direct/routed/native exact-input and receive-target paths preserve original economics, expiry and signing protections. ## Test plan: functional, failure and recovery paths - Unit: below/at/above 10% divergence; initial 60-second confirmation, repeated/out-of-order/same-time/future observations, source switching/pinning, independent USTC movement, missing anchor, both decimal orientations and numeric limits. Confirm reference identity/value/time never ratchet. - Disposable DB/API: consistent producer publication and quote cohorts; admitted→divergent→stale/absent evidence→eligible recovery, producer restart/cancellation, replayed generations, pending fees/books, concurrent publication and rollback. Assert policy evidence cannot outlive its original window or splice with newer reserves/anchors. - Valuation: both supported legs present/missing, genuine zero/decrease, reserves missing/stale, unsupported-only markets, pair-stamp removal/recovery, null LP and null VOL/LP, total/partial quality and unchanged historical volume. No self-valued backing or 2× outage substitution. - Quote matrix: USDT↔USTR, UST1↔USTR, cUSTC↔USTR and routed native USTC/LUNC families; both exact input and exact receive where supported; 1 raw unit, 1 human token, ordinary and reserve-exceeding amounts, 1/5/30% tolerance, pool-only/hybrid and genuine unsupported inverse modes. Assert exact raw output/floors or the correct typed blocker and zero quote RPC. - Desktop/phone: anonymous and connected contexts, initial policy rejection versus transient warm-up, idle beyond 20/180 seconds, same-intent recovery, amount/token/direction/protection changes, obsolete responses, expiry, active confirmation and pinned review. Reserve stable form geometry and one truthful action. ## Test plan: attack, hack and abuse vectors - Manipulate canonical reserves above/below the bound, alternate USTR source pools, repeatedly oscillate/restart to attempt reference ratcheting, and vary USTC/UST1 upstream prices. No current unsafe mark or executable fair output may be manufactured. - Symbol/contract/denom spoofing, contradictory identities, 6/18 decimal swaps, zero/negative/oversized numbers, malicious timestamps and replayed anchors must fail closed. Candidate self-valued TVL cannot satisfy independent depth. - Flood quote/progress/malformed reason requests and cancel clients: fixed work/response/concurrency caps, released permits, no request ingestion or remote calls. Expired policy evidence cannot permanently deny an unrelated/newly qualified identity. - Attempt unauthorized/public reset and cross-market reference deletion; reject wrong scope/identity and retain audit/rollback evidence. Inject hostile provider bodies/URLs/HTML; expose only fixed reason classes, no secrets or actor data. - Try using historical/indicative/display-retained amounts to sign after policy rejection or expiry; validate that mutation remains blocked and failed funded execution rolls back completely in owned fixtures. ## 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 relevant `make verify-issue-1452`/`make verify-issue-1464` regressions 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 - Live bounded read-only reproduction and repeat: USTR `divergent` with null USD; missing top-pair LP/ratio; four quote HTTP 503 outcomes and one repeated exact-output `missing_observations` response, 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. - The complete indexer library run selected by `make verify-issue-1473` passed 843 tests with one intentionally ignored test. The oracle/hub/economic/protocol-TVL library groups selected by `make verify-issue-1391` passed 31/32/13/20 tests respectively. The six-file frontend group selected by `make verify-issue-1479` passed 155 tests, and the four-file protocol group selected by `make verify-issue-1380` passed 97 tests. - Broader `1391`, `1453`, `1479`, `1473` and `1380` verifier 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 first `1479` harness 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 configured `cargo test --locked --manifest-path indexer/Cargo.toml --test book_snapshot_loop -- --test-threads=1` retest then passed all 22 tests (0 failed), including provider/observation recovery. Full implementation verification remains future work. - No source fix, production reference reset, deployment, funded transaction, full live browser matrix or historical reconstruction was performed. Those omissions do not hold issue publication; acceptance remains unchecked.
Author
Owner

Source review: the reported USTR fixed-reference availability blocker was addressed by merged PR #1526, implementation commit 90b5b0b6985947b9c341650196cbde791bec921e, merged into main as 77597ad9. Reviewed current checkout: 6c07c2f5fa05989ba440e995b93929f59730fd70.

  • refresh_hub_marks publishes fresh positive reserve spots without the old 10% fixed-reference rejection. hub_guard was removed, and migration 20261016120000_drop_hub_price_references.sql drops the reference table. API provenance now reports live-reserve-spot-v1; oracle-safety policy/docs were updated accordingly.
  • Local quote reference observation reads qualified hub marks in a repeatable-read snapshot. Protocol valuation still requires both supported legs, and top-pair LP values use scheduled liquidity stamps. Existing Swap recovery watches new quote generations and refetches the unchanged current intent.
  • Canonical identities, independent oracle anchors, observation freshness, positive values and the independent priced-leg depth floor remain enforced in the reviewed source.

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.

Source review: the reported USTR fixed-reference availability blocker was addressed by merged PR [#1526](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1526), implementation commit [`90b5b0b6985947b9c341650196cbde791bec921e`](https://git.cl8y.com/code/cl8y-dex-terraclassic/commit/90b5b0b6985947b9c341650196cbde791bec921e), merged into main as `77597ad9`. Reviewed current checkout: `6c07c2f5fa05989ba440e995b93929f59730fd70`. - `refresh_hub_marks` publishes fresh positive reserve spots without the old 10% fixed-reference rejection. `hub_guard` was removed, and migration `20261016120000_drop_hub_price_references.sql` drops the reference table. API provenance now reports `live-reserve-spot-v1`; oracle-safety policy/docs were updated accordingly. - Local quote reference observation reads qualified hub marks in a repeatable-read snapshot. Protocol valuation still requires both supported legs, and top-pair LP values use scheduled liquidity stamps. Existing Swap recovery watches new quote generations and refetches the unchanged current intent. - Canonical identities, independent oracle anchors, observation freshness, positive values and the independent priced-leg depth floor remain enforced in the reviewed source. 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.
Author
Owner

policy change approved

policy change approved
Sign in to join this conversation.
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#1511
No description provided.