bug(swap): investigate native LUNC to USTR impact and reconcile route costs #1483

Closed
opened 2026-10-12 10:26:33 +00:00 by PlasticDigits · 5 comments
Owner

Summary and scope

Investigate the remaining high-impact warning on native LUNC → cLUNC → UST1 → USTR after the quote/gas changes in #1481 and #1482. An anonymized mobile report shows approximately 13% impact and a second-click confirmation. This is a reported pricing/clarity concern, not proof that the warning or quote is mathematically wrong.

Post-deployment feedback indicates improvements on CL8Y→USTR, CL8Y→USTC, USTC→USTR, CL8Y→UST1 and UST1→USTR. These are qualitative control observations, not funded execution or complete wallet acceptance. Original pay amount, selected protection, quote generation/time, wallet/app version and frontend artifact are unavailable. Do not infer the original input from the receive or fee display.

Only technical findings and independently selected public test inputs are published here. No conversation, screenshot, reporter name/identifier, wallet balance, actor address or reporter-linked transaction history is included.

Bundle native impact attribution, reference verification, bounded route comparison and consistent retail explanation in this issue. Keep gas-family calibration/device inspection in #1480, independent small-market reference integrity in #1479, and external-DEX integration/design in #1330. This issue does not require adding a third-party DEX or multi-path splitting.

Current codebase

Source reviewed: d65228c2970a1ec7b11d81000d3f83ceb58132c4. Public backend /health.git_sha before/after the investigation: 0395459971312c31f87d502ef7822733a7250238, the application revision documented by #1482. Backend health is not independent attestation of the reporter's frontend, wallet or contract artifact.

  • indexer/src/api/local_quote.rs evaluates checked, amount-specific net pool/book returns, fees, taxes and hooks from scheduled cached observations. Candidates use independently qualified reference inputs; slippage_percent is symmetric fair-reference deviation: 100 × abs(fair − delivered_net) / max(fair, delivered_net). It flags both worse and suspiciously better results. It is neither the selected tolerance nor exclusively AMM size impact.
  • Native composition in final_response compares delivered output with the fair value of authorized gross native input, retaining wrap/unwrap losses. Using a fee-reduced reference to erase wrapper costs would weaken the ≥99% guard. local_wrapper_quote.rs observes mapping/configuration independently and applies exact integer wrap/unwrap fees, limits and taxes.
  • local_reference_quote.rs binds asset identities, decimals, provenance and original freshness; scheduled hub prices/economic marks/quorum/census now use one read-only repeatable-read snapshot. Economic total-TVL floor is $10; independent hub priced-leg depth remains $100. Existing economic marks are spot-derived; the lower reporting floor does not certify an independent token oracle.
  • SwapPage.tsx and TradeMarketOrderPanel.tsx prefer route-level deviation. SwapImpactAside.tsx labels that figure “Price impact”. The same metric drives >5% confirmation, >30% Expert and nonwaivable ≥99% protection. The UI does not give an independently reconciled explanation of wrapper costs, trading fees, size impact and reference/spot divergence.
  • Reviewed local execution stays offline. offlineSwapBudget.ts uses generic legacy/v1 family budgets; fee display, Max, native reserve and signing share the plan. A legacy two-hop route plus wrap uses 800,000 + 2×2,400,000 + 400,000 + 400,000 = 6,400,000 gas; at 28.325 uluna/gas that is 181.28 LUNC. This identifies a current estimate class, not the original signed gas. Network fee is separate from the quoted fair-output deviation and is not a remedy for a price warning.

Investigation: public read-only observations

On 2026-10-12 UTC, bounded anonymous GET /api/v1/route/solve probes used exact raw amounts, pool_only=true for native and matching cLUNC controls, max_spread=0.05, protection_policy=quote_relative_v1, and no trader/sender, signing or broadcast. Reference percentages were independently recalculated from published fair/net raw integers; executable shape, original expiry and positive quote-relative floors passed client validation. There were 31 bounded health/quote reads plus one hop-detail quote, paced between cases. Observations are sequential, not an atomic cross-request reserve/reference cohort.

Independently chosen LUNC input Credited cLUNC Native fair-reference deviation Matching credited-cLUNC deviation
1 0.98 1.8369% 0.1662%
100 98 2.7446% 0.7598%
1,000 980 5.3225% 3.3903%
4,000 3,920 13.0385% 11.2637%
5,000 4,900 15.3252% 13.5972%
10,000 9,800 25.1297% 23.6017%

For each matched-credit comparison, native and cLUNC quotes returned identical net raw output and 5% minimum receive. Wrapping retained 98% of gross input in this observed configuration. The 4,000 input is a new test case, not a reconstruction of the original reported input. Similar magnitude was observed, not an exact historical reproduction.

A further 4,000-LUNC quote reported 13.0061% with these published hop scalars:

Pool leg Commission / pre-commission pool return AMM spread / ideal pool return Sell/buy tax scalars
cLUNC→UST1 approximately 1.8% approximately 10.8047% zero / zero
UST1→USTR approximately 1.8% approximately 0.000902% zero / zero

This points to the first pool leg as the dominant observed size-dependent component. These are quote-derived diagnostics, not independent same-cohort reserve/contract attestation. Per-hop percentages have different bases and must not simply be added to the route percentage; wrapper fees, compounded trading costs and reference/spot divergence must reconcile in common units.

Other controls returned validated HTTP200 quotes: CL8Y0.1→USTR (~5.0184%), USTC1→USTR (~5.4898%), CL8Y0.1→UST1 (~3.2769%) and UST1 1→USTR (~1.8048%). CL8Y0.1→native USTC and USTR1/10→native LUNC returned typed 422 unsupported_semantics in this anonymous scope. Those results do not establish a new regression or reproduce the original successful control contexts. Unsupported native-output capabilities must stay explicit.

solve/best at 1,000/10,000 LUNC returned the same net amounts as the earlier solve samples. Their percentages differed slightly at different request times; same-generation equivalence was not established, so this is not claimed as an endpoint inconsistency or proof of unrestricted optimality.

Why implementation is needed

The remaining gap is actionable attribution and verified route/reference quality. A trader sees a high aggregate “Price impact” figure but cannot distinguish unavoidable wrapper/trading costs, amount-dependent reserve movement, reference/spot divergence or a genuinely inferior selected route. Gas improvements cannot answer that question, and positive qualitative feedback cannot establish it either.

Implement generic, bounded economic attribution and a compact truthful explanation. Correct amount math, reference admission or route selection only if independently pinned evidence proves an error. If the warning is legitimate, preserve it and explain the dominant constraint; any better route must actually be executable and deliver more net output for the same authorized input. Do not manufacture a lower percentage as the acceptance target.

Relevant files

  • indexer/src/api/local_quote.rs, local_quote/protection.rs, local_quote/diagnostics.rs, local_quote/skeletons.rs, local_quote/reverse.rs: composition, candidate ranking, ceilings/floors, rejection and bounded alternatives.
  • indexer/src/api/local_reference_quote.rs, local_wrapper_quote.rs, local_hook_pricing.rs, route_slippage.rs; indexer/src/indexer/hub_usd.rs, economic_usd.rs, oracle.rs; indexer/src/db/queries/hub_prices.rs: original-time references, source quality and wrapper/economic observations.
  • frontend-dapp/src/pages/SwapPage.tsx, components/swap/SwapImpactAside.tsx, SwapPreSubmitSummary.tsx, components/trade/TradeMarketOrderPanel.tsx; utils/swapRouteSlippage.ts, slippageConstraint.ts, localRouteQuote.ts, swapPayAcquireGuidance.ts: consistent value/copy, review and signing gates.
  • frontend-dapp/src/services/terraclassic/offlineSwapBudget.ts, swapNetworkFee.ts, router.ts, terraBroadcast.ts: preserve reviewed execution plan and separation of gas from price protection.
  • indexer/tests/route_local_quotes_1452.rs, api_route_solve.rs, api_route_exact_output.rs, reference_cohort_1479.rs; frontend-dapp/src/utils/swapRouteSlippage.test.ts, actual Swap/Trade tests; scripts/qa/probe-issue-1473.py, browser-live-trading-quotes-1473.cjs.
  • docs/route-solver.md, docs/frontend.md, docs/indexer-invariants.md, docs/qa/issue-1479, docs/qa/issue-1480; applicable skills/AGENTS_LOCAL_SWAP_QUOTES.md, AGENTS_TRADING_QUOTE_OUTCOMES.md, AGENTS_SMALL_MARKET_REFERENCE.md, AGENTS_OFFLINE_SWAP_BUDGET.md, AGENTS_ORACLE_SAFETY.md, AGENTS_NET_EXECUTION_FLOORS.md.
  1. Capture an owned synthetic fixture with exact original reserves, fees, wrapper credit, decimals, taxes/hooks, source quality/as-of, generation and original expiry. Compare native gross, matching credited cLUNC and equal-gross cLUNC separately. Reconcile raw returns, references and floors independently of solver helper outputs.
  2. Attribute wrapper loss, commissions/taxes/hooks, nonlinear AMM/book work and remaining reference/spot divergence in compatible units with an explicit formula/rounding contract. Keep network fee external to swap output unless a separately reviewed product objective explicitly says otherwise. Missing evidence means unavailable attribution, never zero cost/impact.
  3. Compare already supported direct and multihop factory candidates, including CL8Y intermediates only when naturally eligible. Verify solve, best, POST and supported receive sizing within existing work limits. Retain amount-specific net-output ranking; do not prioritize a route solely by a smaller displayed percentage. Native paths remain pool-only; compare wrapped hybrid routes separately.
  4. Surface one consistent fair-reference percentage and one compact, proven explanation of the dominant cause in actual Swap/Trade review. Keep detailed technical provenance in bounded API/test evidence. Do not add a retail pricing dashboard or conflicting adjacent percentages. Any proposed smaller amount needs a fresh valid quote proving the improvement.
  5. Diagnose genuine reference/selection/arithmetic errors before changing algorithms. Preserve legitimately high warnings, and keep indicative pricing outside signing. Align docs, API meanings and agent invariants with the final implementation.

Constraints and guardrails

  • No quote/input/refresh/review/preparation-triggered chain RPC, provider validation, simulation or calibration. Scheduled bounded ingestion owns observations; retained data retains its original time.
  • Generic behavior for all supported identities/amounts; no LUNC/USTR/CL8Y whitelist, fixed peg, address preference or fabricated oracle quality. Preserve $10 economic TVL versus $100 independently priced depth and the consistent reference snapshot.
  • Preserve >5% consent, >30% Expert and nonwaivable ≥99% guards, exact UI tolerance, upward-rounded positive hop/post-hook/final floors, original expiry/generation and context binding. No slippage increase or fee/reference omission to make warnings disappear.
  • Gas amount, gas price, gas fee, slippage tolerance, AMM spread and fair-reference deviation remain distinct. Higher gas never changes authorized principal or receive floors; unknown offline budget blocks signing.
  • Preserve gross route funding, tax parity, wallet debit bounds, native pay+uluna fee reserve, launch/blacklist/freeze/pause guards, one intentional submit flow and no automatic resend after included failure/unknown inclusion.
  • Native pool-only policy and unsupported unwrap capabilities remain enforced. No external-DEX integration, new on-chain authority, production state mutation/reset or shared QA database mutation in this scope.
  • Diagnostics are schema-bounded, public-field allowlisted and actor-free; no provider prose, secret, private endpoint or arbitrary upstream enum reaches retail copy or public receipts.

Acceptance criteria

  • AC1: Classify the remaining concern using pinned exact economics: legitimate amount-dependent loss, fixed trading/wrapper costs, reference divergence, stale/incompatible observations or inferior selection. State missing original-report details; do not claim historical reproduction from a similar screenshot percentage.
  • AC2: Generic native/wrapped attribution reconciles raw delivered net output and independently qualified fair output with documented rounding/error bounds; no duplicated wrapper/gas loss, additive-percent fiction, unsupported zero-impact fallback or reference-quality promotion.
  • AC3: Best eligible supported route wins by amount-specific delivered net under the unchanged objective and budgets. Direct/via-UST1/via-CL8Y alternatives and solve/best/POST/receive comparisons are same-cohort; unusable alternatives cannot erase a useful safe result. If current selection is already correct, retain it with proof.
  • AC4: Actual Swap and Trade show one consistent route percentage and a compact truthful explanation. Legitimate warnings and all 5/30/99 transitions stay functional; explanation cannot authorize signing or hide cost/unsupported/expiry blockers.
  • AC5: Source, cached API, review and signing retain zero quote-triggered provider calls, original expiry/context, exact gross input and positive floors. Owned funded supported native/wrapped cases settle with expected net and floor-rejected cases roll back economic state; gas inspection stays separate.
  • AC6: First/retest and expanded boundary/state/abuse cases pass with failed inputs retained. Separately attest deployed backend/frontend/root artifacts and publish initialized useful socket/browser timing, bounded logs and live results beyond 20-second/180-second replacement cycles. Unavailable device/contract/SQL evidence stays unchecked.
  • AC7: Update API, invariants, docs, issue/PR/checklist links and ./skills/ agent guidance. State remaining protocol, reference, wallet and verification limits; do not equate source tests or a quote HTTP200 with production settlement.

Test plan: supported, boundary and failure paths

Area Required coverage
Identity/direction/amount LUNC↔USTR, cLUNC↔USTR matched-credit and equal-gross controls; the five reported improved control families in both directions; unrelated assets. 6/18 and mixed precision, one raw unit, dust±1, 0.01/0.1/1/10/100/1000/4000/5000/10000, reserve-limited/Uint128 bounds; exact-input and supported receive sizing.
Execution/ranking Direct and one/two/three/four permitted factory hops, eligible UST1/CL8Y alternatives, legacy/v1 funding, wrap-only/unwrap-only/composed native where supported, tax-off/on, supported hooks/tiers; wrapped pool/hybrid/manual/greedy within their own caps and empty/populated/expired books. Native remains pool-only. Include legitimate high-impact best routes and a genuinely better eligible alternate.
Metric correctness Worse and suspiciously better fair deviations; favorable/unfavorable reference/spot offsets; fixed wrap fee and asymmetric wrap/unwrap fees; compounding fees/taxes/hooks, exact integer truncation/ceil, dust and 99% extremes. Per-hop different-denomination diagnostics must reconcile without naive summation.
Data/cache/state Compatible/incompatible original cohorts, source switching, stale/future/no-quorum/malformed references, below/at/above both independent floors, reserve/config/fee/wrapper changes and expiry boundaries. Same intent after new generation, cache hits/misses, failed ingestion retains old timestamps, search-done is not pricing-ready.
Human/agent entry flows Desktop/phone Swap and Trade, amount/pair/direction/receive/protection changes, deep links, repeat/refresh/rapid cancellation, >5% first/second click and cancel/requote; ≤5%, >30% Expert, ≥99% refusal. Fee/Max/pay+fee±1, insufficient balances, fee unavailable, input/account/tier changes during review, expired/stalled/rejected signing, atomic-wallet limits.
Settlement/recovery Owned funded positive 1/5/30% hop/final floors, exact post-tax/post-hook wallet net; rejected-floor reserve/LP rollback, pause/freeze/blacklist and unsupported capabilities. Inspect requested/signed fee separately, code11/unknown inclusion/no resend and sequence/concurrent submit behavior.

Test plan: attack, hack and abuse vectors

  • Reference manipulation: shift canonical reserve ratios, manipulate thin mark candidates, source switching, circular/self-valued backing, fake stable pegs, poisoned quality/quorum/as-of and old/new anchor-mark splices. A selected route cannot define its own independent reference or improve its own risk classification.
  • Identity/precision/arithmetic attacks: symbol/contract/denom spoofing, native/wrapped confusion, 6/18 decimal scaling, zero/negative/nonfinite/fractional/malformed/huge values and overflow. Symmetric favorable deviations and rounding at 5/30/99 must not bypass safeguards.
  • Metric tampering: forge costs, fair/net output, wrapper credit, hop count/mode, fees, floor, generation, expiry, actor/tier or attribution source; attempt a low displayed warning with unchanged unsafe economics. Explanation never supplies execution permission; indicative output remains non-signable.
  • Route/execution abuse: dense/cyclic/repeated-capable paths, malicious/unsupported token code/hooks, stale/expired makers, manufactured cheap-gas family, unsupported unwrap and arbitrary external DEX. Preserve caps, checked plan budgets, exact authorized funding, launch/refund rules and floors.
  • Resource/cache abuse: rapid edits, bursts, cancelled/deeper searches, many contexts, stale cached diagnostics and retry storms. Bound census/work/cache/concurrency; no input-driven calibration, hidden remote fallback, stale-time renewal or unbounded per-hop evidence.
  • Replay/disclosure/injection: wallet fee/body changes within documented trust boundaries, duplicate signing/resend, unknown inclusion; HTML/script/provider prose, private endpoints, actors/digests and secrets injected into diagnostics. Fixed bounded copy, private raw evidence and sanitized public receipts only.

Investigation verification and implementation verification criteria

Executed source checks during filing: native wrapper/fair-reference ≥99% regression 1/1 passed; route-slippage symmetric/reference arithmetic 3/3 passed; frontend route metric/protection/copy 24/24 passed. An earlier invocation matched only two frontend files (17 tests); it was corrected to the actual src/utils/swapRouteSlippage.test.ts path before claiming coverage. No code changes, production signing, broadcast, DB mutation or deployment was performed for this report.

These checks and public quote-derived hop ratios do not independently prove original reserves, reference provenance, optimality, physical wallet behavior or funded native settlement. The original ~13% report is not independently reproduced because its amount/context/artifact were not available. Private original atomic SQL and full device/contract evidence remain unavailable as documented in #1479/#1480, and no missing credential is bypassed to fabricate acceptance.

Implementation must run make verify-issue-1452, verify-issue-1473, verify-issue-1479, verify-issue-1480 and applicable 1464, 1453, 1391, 1398, 1381, 1390, 1396 checks with current checksums/source and owned isolated DB/chain fixtures. Add meaningful independent attribution/ranking/actual-entry tests, then fix failures, reset only owned affected fixtures and retest stable final source. Use separate revision/artifact attestation, bounded public probes/browser shards and classified Grafana/Loki/Prometheus evidence where provisioned. Keep initialized 500ms socket / temporary 750ms browser criteria, per-run resource caps and original measurement clocks.

Record UTC, exact source/deployment/tool/artifact revisions, scope, counts, p50/p95/p99/max, expected raw economics and failures/skips separately. Complete feasible checks first. Unavailable workflow/device/SQL/deployment tasks may be explicit SKIP but never complete an acceptance box; an executed failure remains FAIL. Human-only wallet/keyring/device actions belong in cl8y-pm, one action/card with at most five taps (reuse the existing fee-review card where applicable). Leave this issue open until every body/comment acceptance criterion has evidence.

## Summary and scope Investigate the remaining high-impact warning on native **LUNC → cLUNC → UST1 → USTR** after the quote/gas changes in [#1481](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1481) and [#1482](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1482). An anonymized mobile report shows approximately **13%** impact and a second-click confirmation. This is a reported pricing/clarity concern, **not proof that the warning or quote is mathematically wrong**. Post-deployment feedback indicates improvements on CL8Y→USTR, CL8Y→USTC, USTC→USTR, CL8Y→UST1 and UST1→USTR. These are qualitative control observations, not funded execution or complete wallet acceptance. Original pay amount, selected protection, quote generation/time, wallet/app version and frontend artifact are unavailable. Do not infer the original input from the receive or fee display. Only technical findings and independently selected public test inputs are published here. No conversation, screenshot, reporter name/identifier, wallet balance, actor address or reporter-linked transaction history is included. Bundle native impact attribution, reference verification, bounded route comparison and consistent retail explanation in this issue. Keep gas-family calibration/device inspection in [#1480](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1480), independent small-market reference integrity in [#1479](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1479), and external-DEX integration/design in [#1330](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1330). This issue does not require adding a third-party DEX or multi-path splitting. ## Current codebase Source reviewed: `d65228c2970a1ec7b11d81000d3f83ceb58132c4`. Public backend `/health.git_sha` before/after the investigation: `0395459971312c31f87d502ef7822733a7250238`, the application revision documented by #1482. Backend health is not independent attestation of the reporter's frontend, wallet or contract artifact. - `indexer/src/api/local_quote.rs` evaluates checked, amount-specific net pool/book returns, fees, taxes and hooks from scheduled cached observations. Candidates use independently qualified reference inputs; `slippage_percent` is **symmetric fair-reference deviation**: `100 × abs(fair − delivered_net) / max(fair, delivered_net)`. It flags both worse and suspiciously better results. It is neither the selected tolerance nor exclusively AMM size impact. - Native composition in `final_response` compares delivered output with the fair value of **authorized gross native input**, retaining wrap/unwrap losses. Using a fee-reduced reference to erase wrapper costs would weaken the ≥99% guard. `local_wrapper_quote.rs` observes mapping/configuration independently and applies exact integer wrap/unwrap fees, limits and taxes. - `local_reference_quote.rs` binds asset identities, decimals, provenance and original freshness; scheduled hub prices/economic marks/quorum/census now use one read-only repeatable-read snapshot. Economic total-TVL floor is **$10**; independent hub priced-leg depth remains **$100**. Existing economic marks are spot-derived; the lower reporting floor does not certify an independent token oracle. - `SwapPage.tsx` and `TradeMarketOrderPanel.tsx` prefer route-level deviation. `SwapImpactAside.tsx` labels that figure **“Price impact”**. The same metric drives >5% confirmation, >30% Expert and nonwaivable ≥99% protection. The UI does not give an independently reconciled explanation of wrapper costs, trading fees, size impact and reference/spot divergence. - Reviewed local execution stays offline. `offlineSwapBudget.ts` uses generic legacy/v1 family budgets; fee display, Max, native reserve and signing share the plan. A legacy two-hop route plus wrap uses `800,000 + 2×2,400,000 + 400,000 + 400,000 = 6,400,000` gas; at 28.325 uluna/gas that is **181.28 LUNC**. This identifies a current estimate class, not the original signed gas. **Network fee is separate from the quoted fair-output deviation** and is not a remedy for a price warning. ## Investigation: public read-only observations On 2026-10-12 UTC, bounded anonymous GET `/api/v1/route/solve` probes used exact raw amounts, `pool_only=true` for native and matching cLUNC controls, `max_spread=0.05`, `protection_policy=quote_relative_v1`, and no trader/sender, signing or broadcast. Reference percentages were independently recalculated from published fair/net raw integers; executable shape, original expiry and positive quote-relative floors passed client validation. There were 31 bounded health/quote reads plus one hop-detail quote, paced between cases. Observations are sequential, **not an atomic cross-request reserve/reference cohort**. | Independently chosen LUNC input | Credited cLUNC | Native fair-reference deviation | Matching credited-cLUNC deviation | | ---: | ---: | ---: | ---: | | 1 | 0.98 | 1.8369% | 0.1662% | | 100 | 98 | 2.7446% | 0.7598% | | 1,000 | 980 | 5.3225% | 3.3903% | | 4,000 | 3,920 | 13.0385% | 11.2637% | | 5,000 | 4,900 | 15.3252% | 13.5972% | | 10,000 | 9,800 | 25.1297% | 23.6017% | For each matched-credit comparison, native and cLUNC quotes returned **identical net raw output and 5% minimum receive**. Wrapping retained 98% of gross input in this observed configuration. The 4,000 input is a new test case, **not a reconstruction of the original reported input**. Similar magnitude was observed, not an exact historical reproduction. A further 4,000-LUNC quote reported 13.0061% with these published hop scalars: | Pool leg | Commission / pre-commission pool return | AMM spread / ideal pool return | Sell/buy tax scalars | | --- | ---: | ---: | --- | | cLUNC→UST1 | approximately 1.8% | approximately 10.8047% | zero / zero | | UST1→USTR | approximately 1.8% | approximately 0.000902% | zero / zero | This points to the first pool leg as the dominant observed size-dependent component. These are quote-derived diagnostics, **not independent same-cohort reserve/contract attestation**. Per-hop percentages have different bases and must not simply be added to the route percentage; wrapper fees, compounded trading costs and reference/spot divergence must reconcile in common units. Other controls returned validated HTTP200 quotes: CL8Y0.1→USTR (~5.0184%), USTC1→USTR (~5.4898%), CL8Y0.1→UST1 (~3.2769%) and UST1 1→USTR (~1.8048%). CL8Y0.1→native USTC and USTR1/10→native LUNC returned typed `422 unsupported_semantics` in this anonymous scope. Those results do not establish a new regression or reproduce the original successful control contexts. Unsupported native-output capabilities must stay explicit. `solve/best` at 1,000/10,000 LUNC returned the same net amounts as the earlier `solve` samples. Their percentages differed slightly at different request times; same-generation equivalence was not established, so this is not claimed as an endpoint inconsistency or proof of unrestricted optimality. ## Why implementation is needed The remaining gap is actionable attribution and verified route/reference quality. A trader sees a high aggregate “Price impact” figure but cannot distinguish unavoidable wrapper/trading costs, amount-dependent reserve movement, reference/spot divergence or a genuinely inferior selected route. Gas improvements cannot answer that question, and positive qualitative feedback cannot establish it either. Implement generic, bounded economic attribution and a compact truthful explanation. Correct amount math, reference admission or route selection **only if independently pinned evidence proves an error**. If the warning is legitimate, preserve it and explain the dominant constraint; any better route must actually be executable and deliver more net output for the same authorized input. Do not manufacture a lower percentage as the acceptance target. ## Relevant files - `indexer/src/api/local_quote.rs`, `local_quote/protection.rs`, `local_quote/diagnostics.rs`, `local_quote/skeletons.rs`, `local_quote/reverse.rs`: composition, candidate ranking, ceilings/floors, rejection and bounded alternatives. - `indexer/src/api/local_reference_quote.rs`, `local_wrapper_quote.rs`, `local_hook_pricing.rs`, `route_slippage.rs`; `indexer/src/indexer/hub_usd.rs`, `economic_usd.rs`, `oracle.rs`; `indexer/src/db/queries/hub_prices.rs`: original-time references, source quality and wrapper/economic observations. - `frontend-dapp/src/pages/SwapPage.tsx`, `components/swap/SwapImpactAside.tsx`, `SwapPreSubmitSummary.tsx`, `components/trade/TradeMarketOrderPanel.tsx`; `utils/swapRouteSlippage.ts`, `slippageConstraint.ts`, `localRouteQuote.ts`, `swapPayAcquireGuidance.ts`: consistent value/copy, review and signing gates. - `frontend-dapp/src/services/terraclassic/offlineSwapBudget.ts`, `swapNetworkFee.ts`, `router.ts`, `terraBroadcast.ts`: preserve reviewed execution plan and separation of gas from price protection. - `indexer/tests/route_local_quotes_1452.rs`, `api_route_solve.rs`, `api_route_exact_output.rs`, `reference_cohort_1479.rs`; `frontend-dapp/src/utils/swapRouteSlippage.test.ts`, actual Swap/Trade tests; `scripts/qa/probe-issue-1473.py`, `browser-live-trading-quotes-1473.cjs`. - `docs/route-solver.md`, `docs/frontend.md`, `docs/indexer-invariants.md`, `docs/qa/issue-1479`, `docs/qa/issue-1480`; applicable `skills/AGENTS_LOCAL_SWAP_QUOTES.md`, `AGENTS_TRADING_QUOTE_OUTCOMES.md`, `AGENTS_SMALL_MARKET_REFERENCE.md`, `AGENTS_OFFLINE_SWAP_BUDGET.md`, `AGENTS_ORACLE_SAFETY.md`, `AGENTS_NET_EXECUTION_FLOORS.md`. ## Recommended direction 1. Capture an owned synthetic fixture with exact original reserves, fees, wrapper credit, decimals, taxes/hooks, source quality/as-of, generation and original expiry. Compare native gross, matching credited cLUNC and equal-gross cLUNC separately. Reconcile raw returns, references and floors independently of solver helper outputs. 2. Attribute wrapper loss, commissions/taxes/hooks, nonlinear AMM/book work and remaining reference/spot divergence in compatible units with an explicit formula/rounding contract. Keep network fee external to swap output unless a separately reviewed product objective explicitly says otherwise. Missing evidence means unavailable attribution, never zero cost/impact. 3. Compare already supported direct and multihop factory candidates, including CL8Y intermediates only when naturally eligible. Verify `solve`, `best`, POST and supported receive sizing within existing work limits. Retain amount-specific net-output ranking; do not prioritize a route solely by a smaller displayed percentage. Native paths remain pool-only; compare wrapped hybrid routes separately. 4. Surface one consistent fair-reference percentage and one compact, proven explanation of the dominant cause in actual Swap/Trade review. Keep detailed technical provenance in bounded API/test evidence. Do not add a retail pricing dashboard or conflicting adjacent percentages. Any proposed smaller amount needs a fresh valid quote proving the improvement. 5. Diagnose genuine reference/selection/arithmetic errors before changing algorithms. Preserve legitimately high warnings, and keep indicative pricing outside signing. Align docs, API meanings and agent invariants with the final implementation. ## Constraints and guardrails - No quote/input/refresh/review/preparation-triggered chain RPC, provider validation, simulation or calibration. Scheduled bounded ingestion owns observations; retained data retains its original time. - Generic behavior for all supported identities/amounts; no LUNC/USTR/CL8Y whitelist, fixed peg, address preference or fabricated oracle quality. Preserve $10 economic TVL versus $100 independently priced depth and the consistent reference snapshot. - Preserve >5% consent, >30% Expert and nonwaivable ≥99% guards, exact UI tolerance, upward-rounded positive hop/post-hook/final floors, original expiry/generation and context binding. No slippage increase or fee/reference omission to make warnings disappear. - Gas amount, gas price, gas fee, slippage tolerance, AMM spread and fair-reference deviation remain distinct. Higher gas never changes authorized principal or receive floors; unknown offline budget blocks signing. - Preserve gross route funding, tax parity, wallet debit bounds, native pay+uluna fee reserve, launch/blacklist/freeze/pause guards, one intentional submit flow and no automatic resend after included failure/unknown inclusion. - Native pool-only policy and unsupported unwrap capabilities remain enforced. No external-DEX integration, new on-chain authority, production state mutation/reset or shared QA database mutation in this scope. - Diagnostics are schema-bounded, public-field allowlisted and actor-free; no provider prose, secret, private endpoint or arbitrary upstream enum reaches retail copy or public receipts. ## Acceptance criteria - [ ] AC1: Classify the remaining concern using pinned exact economics: legitimate amount-dependent loss, fixed trading/wrapper costs, reference divergence, stale/incompatible observations or inferior selection. State missing original-report details; do not claim historical reproduction from a similar screenshot percentage. - [ ] AC2: Generic native/wrapped attribution reconciles raw delivered net output and independently qualified fair output with documented rounding/error bounds; no duplicated wrapper/gas loss, additive-percent fiction, unsupported zero-impact fallback or reference-quality promotion. - [ ] AC3: Best eligible supported route wins by amount-specific delivered net under the unchanged objective and budgets. Direct/via-UST1/via-CL8Y alternatives and solve/best/POST/receive comparisons are same-cohort; unusable alternatives cannot erase a useful safe result. If current selection is already correct, retain it with proof. - [ ] AC4: Actual Swap and Trade show one consistent route percentage and a compact truthful explanation. Legitimate warnings and all 5/30/99 transitions stay functional; explanation cannot authorize signing or hide cost/unsupported/expiry blockers. - [ ] AC5: Source, cached API, review and signing retain zero quote-triggered provider calls, original expiry/context, exact gross input and positive floors. Owned funded supported native/wrapped cases settle with expected net and floor-rejected cases roll back economic state; gas inspection stays separate. - [ ] AC6: First/retest and expanded boundary/state/abuse cases pass with failed inputs retained. Separately attest deployed backend/frontend/root artifacts and publish initialized useful socket/browser timing, bounded logs and live results beyond 20-second/180-second replacement cycles. Unavailable device/contract/SQL evidence stays unchecked. - [x] AC7: Update API, invariants, docs, issue/PR/checklist links and `./skills/` agent guidance. State remaining protocol, reference, wallet and verification limits; do not equate source tests or a quote HTTP200 with production settlement. ## Test plan: supported, boundary and failure paths | Area | Required coverage | | --- | --- | | Identity/direction/amount | LUNC↔USTR, cLUNC↔USTR matched-credit and equal-gross controls; the five reported improved control families in both directions; unrelated assets. 6/18 and mixed precision, one raw unit, dust±1, 0.01/0.1/1/10/100/1000/4000/5000/10000, reserve-limited/Uint128 bounds; exact-input and supported receive sizing. | | Execution/ranking | Direct and one/two/three/four permitted factory hops, eligible UST1/CL8Y alternatives, legacy/v1 funding, wrap-only/unwrap-only/composed native where supported, tax-off/on, supported hooks/tiers; wrapped pool/hybrid/manual/greedy within their own caps and empty/populated/expired books. Native remains pool-only. Include legitimate high-impact best routes and a genuinely better eligible alternate. | | Metric correctness | Worse and suspiciously better fair deviations; favorable/unfavorable reference/spot offsets; fixed wrap fee and asymmetric wrap/unwrap fees; compounding fees/taxes/hooks, exact integer truncation/ceil, dust and 99% extremes. Per-hop different-denomination diagnostics must reconcile without naive summation. | | Data/cache/state | Compatible/incompatible original cohorts, source switching, stale/future/no-quorum/malformed references, below/at/above both independent floors, reserve/config/fee/wrapper changes and expiry boundaries. Same intent after new generation, cache hits/misses, failed ingestion retains old timestamps, search-done is not pricing-ready. | | Human/agent entry flows | Desktop/phone Swap and Trade, amount/pair/direction/receive/protection changes, deep links, repeat/refresh/rapid cancellation, >5% first/second click and cancel/requote; ≤5%, >30% Expert, ≥99% refusal. Fee/Max/pay+fee±1, insufficient balances, fee unavailable, input/account/tier changes during review, expired/stalled/rejected signing, atomic-wallet limits. | | Settlement/recovery | Owned funded positive 1/5/30% hop/final floors, exact post-tax/post-hook wallet net; rejected-floor reserve/LP rollback, pause/freeze/blacklist and unsupported capabilities. Inspect requested/signed fee separately, code11/unknown inclusion/no resend and sequence/concurrent submit behavior. | ## Test plan: attack, hack and abuse vectors - **Reference manipulation:** shift canonical reserve ratios, manipulate thin mark candidates, source switching, circular/self-valued backing, fake stable pegs, poisoned quality/quorum/as-of and old/new anchor-mark splices. A selected route cannot define its own independent reference or improve its own risk classification. - **Identity/precision/arithmetic attacks:** symbol/contract/denom spoofing, native/wrapped confusion, 6/18 decimal scaling, zero/negative/nonfinite/fractional/malformed/huge values and overflow. Symmetric favorable deviations and rounding at 5/30/99 must not bypass safeguards. - **Metric tampering:** forge costs, fair/net output, wrapper credit, hop count/mode, fees, floor, generation, expiry, actor/tier or attribution source; attempt a low displayed warning with unchanged unsafe economics. Explanation never supplies execution permission; indicative output remains non-signable. - **Route/execution abuse:** dense/cyclic/repeated-capable paths, malicious/unsupported token code/hooks, stale/expired makers, manufactured cheap-gas family, unsupported unwrap and arbitrary external DEX. Preserve caps, checked plan budgets, exact authorized funding, launch/refund rules and floors. - **Resource/cache abuse:** rapid edits, bursts, cancelled/deeper searches, many contexts, stale cached diagnostics and retry storms. Bound census/work/cache/concurrency; no input-driven calibration, hidden remote fallback, stale-time renewal or unbounded per-hop evidence. - **Replay/disclosure/injection:** wallet fee/body changes within documented trust boundaries, duplicate signing/resend, unknown inclusion; HTML/script/provider prose, private endpoints, actors/digests and secrets injected into diagnostics. Fixed bounded copy, private raw evidence and sanitized public receipts only. ## Investigation verification and implementation verification criteria Executed source checks during filing: native wrapper/fair-reference ≥99% regression **1/1 passed**; route-slippage symmetric/reference arithmetic **3/3 passed**; frontend route metric/protection/copy **24/24 passed**. An earlier invocation matched only two frontend files (17 tests); it was corrected to the actual `src/utils/swapRouteSlippage.test.ts` path before claiming coverage. No code changes, production signing, broadcast, DB mutation or deployment was performed for this report. These checks and public quote-derived hop ratios do not independently prove original reserves, reference provenance, optimality, physical wallet behavior or funded native settlement. The original ~13% report is not independently reproduced because its amount/context/artifact were not available. Private original atomic SQL and full device/contract evidence remain unavailable as documented in #1479/#1480, and no missing credential is bypassed to fabricate acceptance. Implementation must run `make verify-issue-1452`, `verify-issue-1473`, `verify-issue-1479`, `verify-issue-1480` and applicable `1464`, `1453`, `1391`, `1398`, `1381`, `1390`, `1396` checks with current checksums/source and owned isolated DB/chain fixtures. Add meaningful independent attribution/ranking/actual-entry tests, then fix failures, reset only owned affected fixtures and retest stable final source. Use separate revision/artifact attestation, bounded public probes/browser shards and classified Grafana/Loki/Prometheus evidence where provisioned. Keep initialized 500ms socket / temporary 750ms browser criteria, per-run resource caps and original measurement clocks. Record UTC, exact source/deployment/tool/artifact revisions, scope, counts, p50/p95/p99/max, expected raw economics and failures/skips separately. Complete feasible checks first. Unavailable workflow/device/SQL/deployment tasks may be explicit SKIP but never complete an acceptance box; an executed failure remains FAIL. Human-only wallet/keyring/device actions belong in cl8y-pm, one action/card with at most five taps (reuse the existing fee-review card where applicable). Leave this issue open until every body/comment acceptance criterion has evidence.
Author
Owner

PR #1484 merged normally to db46e30a5011ee4cbd1998c1c97a34d966b07003. Hosted pipelines 427 and 428 genuinely passed every mandatory job; no status fabrication, branch-protection change or forced merge was used. Both Coolify applications finished deploying that revision, with zero fatal build-log matches, and the independent backend/frontend/root attestation passed.

Implemented generic signed raw-output attribution and exact 5/30/99 thresholds, plus review-bound confirmation in both entry flows. A pinned regression proved that deeper search discarded a strictly better route below a 0.1% improvement cutoff; 997,000 → 997,498 raw now publishes correctly on the same cohort. Exact-amount cache keys already isolate small and large inputs; executable quotes are never linearly scaled.

Completed verification subsets:

  • Source first/retest: independent economics, amount/ranking/native controls, original context/expiry, positive floors and zero quote-triggered provider calls.
  • Owned native/wrapped first/retest: 12 exact settlements and 24 atomic floor rejections per round; custody, supply, principal, rate usage and output checks passed.
  • Expanded controlled browser: 4,250 scenarios, zero failures, 3,948 useful outputs; p50/p95/p99/max 88.4/146.2/164.1/236.3 ms against the named 750 ms criterion. Earlier disk-I/O and fixture failures remain recorded separately.
  • AC7 API/schema, invariants, documentation, agent instructions and checklist crosslinks; see results.
  • Complete original-report, production settlement, contract/device/atomic-wallet and every protocol-family acceptance. New public/synthetic inputs do not reconstruct the original report. This issue remains open.

A retail-copy audit found overlapping notices, technical terminology and speculative warning text. A follow-up is consolidating the actual blocker/confirmation into one concise notice, moving ordinary quote details into existing signing details and preserving every execution gate and required risk acknowledgement. Sustained deployed API/UI checks and bounded monitoring receipts follow; no production reserve/book/database state was reset.

PR [#1484](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1484) merged normally to `db46e30a5011ee4cbd1998c1c97a34d966b07003`. Hosted pipelines 427 and 428 genuinely passed every mandatory job; no status fabrication, branch-protection change or forced merge was used. Both Coolify applications finished deploying that revision, with zero fatal build-log matches, and the independent backend/frontend/root attestation passed. Implemented generic signed raw-output attribution and exact 5/30/99 thresholds, plus review-bound confirmation in both entry flows. A pinned regression proved that deeper search discarded a strictly better route below a 0.1% improvement cutoff; 997,000 → 997,498 raw now publishes correctly on the same cohort. Exact-amount cache keys already isolate small and large inputs; executable quotes are never linearly scaled. Completed verification subsets: - [x] Source first/retest: independent economics, amount/ranking/native controls, original context/expiry, positive floors and zero quote-triggered provider calls. - [x] Owned native/wrapped first/retest: 12 exact settlements and 24 atomic floor rejections per round; custody, supply, principal, rate usage and output checks passed. - [x] Expanded controlled browser: 4,250 scenarios, zero failures, 3,948 useful outputs; p50/p95/p99/max 88.4/146.2/164.1/236.3 ms against the named 750 ms criterion. Earlier disk-I/O and fixture failures remain recorded separately. - [x] AC7 API/schema, invariants, documentation, agent instructions and checklist crosslinks; see [results](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/issue-1483/RESULTS.md). - [ ] Complete original-report, production settlement, contract/device/atomic-wallet and every protocol-family acceptance. New public/synthetic inputs do not reconstruct the original report. This issue remains open. A retail-copy audit found overlapping notices, technical terminology and speculative warning text. A follow-up is consolidating the actual blocker/confirmation into one concise notice, moving ordinary quote details into existing signing details and preserving every execution gate and required risk acknowledgement. Sustained deployed API/UI checks and bounded monitoring receipts follow; no production reserve/book/database state was reset.
Author
Owner

The warning follow-up PR #1485 and verification correction PR #1488 are merged and deployed. Final main, frontend and backend revision: 4cb5736574072130e8e14a5ea2e297d3062e8212. Hosted CI 432 and 437 passed their mandatory jobs before normal merges. The worktree and local main include origin/main; existing unrelated local files were preserved.

Swap and Trade now say Price difference. Ordinary ≤5% information stays in existing Signing details; larger differences use one short factual notice with the required confirmation. Only the highest-priority current operational blocker is shown, while all independent execution guards remain enforced. Missing advisory breakdowns and disconnected-wallet balance checks no longer generate notices. Inline failures are not repeated in a toast. Exact 5/30/99 thresholds, Expert/risk acknowledgement, original context/expiry, fee review and unknown/included transaction handling remain intact. Unsupported advice to reduce the amount or increase tolerance was removed from price-protection errors.

The original implementation #1484 adds bounded signed raw-output attribution and fixes the deeper search's undocumented 0.1% publication cutoff: the pinned same-cohort 997,000 → 997,498 raw improvement now wins. Exact amount/generation cache keys already isolate small and large inputs; executable quotes are not scaled from a small cached quote. No external DEX, route splitting, new reference-quality class or quote-triggered RPC was introduced.

Completed verification subsets:

  • Stable source first/retest: make verify-issue-1483 21 PASS, 0 FAIL, 2 external acceptance SKIPs per round; 286 focused frontend tests each. Full frontend 3,365 tests passed twice. Related required verifiers and owned settlement/rollback subsets are documented in RESULTS.md. Earlier failures are retained with their fixes/retests.
  • Coolify frontend wrwkq60kzrrscprdprawvkuq and backend qpdhhugwf0vo8c0lm4eejgkh finished at the exact final revision. Build-log entries: 59/57; zero fatal-pattern matches. Independent backend/deployment/root attestation passed. Every external root script is covered, including both bootstrap files; the original incomplete checker failure is retained.
  • Live API, UTC 01:40:49–01:45:03 on 2026-10-13: 176 reads, 148 executable quotes, zero probe failures, two cycles separated by 185s. Required native 1/1,000/4,000 LUNC solve/best cases passed with reconciled attribution. Seven typed missing-observation responses occurred in cycle one and none in cycle two; dust and unsupported semantics remain explicit. Same-generation comparisons passed; different generations do not prove same-cohort optimality.
  • Actual desktop/phone Swap/Trade 18/18 first and 18/18 retest, separated by 210.213s from first end. Ordinary-detail opening/visibility and one-notice confirmation were verified according to each actual quote. Ordered root paths/hashes/byte lengths matched before/after. Zero writes, actor requests or measured provider requests. Clean committed checker HEAD equals final main; checker SHA256 658a262e90adad54dcedbe9637818e5c679f9fe6ca5cc2d4f7d4d704953a6276.
  • AC7: API/schema, rounding/invariants, documentation, issue/PR/checklist and ./skills/ crosslinks updated. The issue body now checks this criterion only.

Initialized useful timings, milliseconds (browser nearest-rank quantiles):

Run n p50 p95 p99 max Budget
Live API 148 283.378 284.565 284.748 284.910 500
Browser first 18 364.3 436.4 436.4 436.4 750
Browser retest 18 366.2 436.7 436.7 436.7 750

Bounded Grafana/Loki monitoring on logs.cl8y.com, 01:41:00–01:46:39 UTC: all 12 frontend error-pattern matches were HTTP200 access entries; no nginx error/404/5xx matches. Eight indexer matches comprise five 503 traces, one 502 response trace and two LCD admission/fee-registry failure entries. No panic/database/integrity matches were observed. The fee-registry health probe subsequently returned configured=true, healthy=true and zero consecutive LCD failures. These observations are retained; passing quote cases do not establish universal provider readiness. Prometheus is SKIP: no datasource provisioned; provider/history follow-up remains in #1464/#1456.

Remaining full acceptance:

  • AC1–AC6: original-report economics/context, original atomic SQL, independently attested production contract reserves/settlement, complete protocol-family/state/attack matrix and physical/atomic-wallet signing. Passing public quotes, synthetic funded fixtures and browser emulation do not complete these boxes. The independently chosen 4,000 LUNC case does not reconstruct the original report.
  • Human native-wallet outcome: queued cl8y-pm card “Verify a native quote in your wallet”, ID bf7eda77-d1e4-4658-ab6e-69d97088669d, in the inbox. Its exact-revision copy-paste preparation command uses scoped OpenBao credentials without printing them; the helper passed read-only preparation at final main. One deliberate submit/no resend remains human work. The API rejected the direct DEX link with HTTP400; the card uses existing PM tracking #143 and includes this DEX issue URL. Existing mobile fee-review card f2041acd-86a0-4a86-9b90-469196638b90 is reused for #1480; no duplicate was created.

Issue #1483 remains open. Full device/gas acceptance stays in #1480, independent reference integrity in #1479, and external-DEX design in #1330. No production reserve/book/database reset or automatic transaction resend was performed. Use the agent checklist and RC1483 invariants for follow-up.

The warning follow-up [PR #1485](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1485) and verification correction [PR #1488](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1488) are merged and deployed. Final main, frontend and backend revision: `4cb5736574072130e8e14a5ea2e297d3062e8212`. Hosted CI 432 and 437 passed their mandatory jobs before normal merges. The worktree and local main include origin/main; existing unrelated local files were preserved. Swap and Trade now say **Price difference**. Ordinary ≤5% information stays in existing Signing details; larger differences use one short factual notice with the required confirmation. Only the highest-priority current operational blocker is shown, while all independent execution guards remain enforced. Missing advisory breakdowns and disconnected-wallet balance checks no longer generate notices. Inline failures are not repeated in a toast. Exact 5/30/99 thresholds, Expert/risk acknowledgement, original context/expiry, fee review and unknown/included transaction handling remain intact. Unsupported advice to reduce the amount or increase tolerance was removed from price-protection errors. The original implementation [#1484](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1484) adds bounded signed raw-output attribution and fixes the deeper search's undocumented 0.1% publication cutoff: the pinned same-cohort 997,000 → 997,498 raw improvement now wins. Exact amount/generation cache keys already isolate small and large inputs; executable quotes are not scaled from a small cached quote. No external DEX, route splitting, new reference-quality class or quote-triggered RPC was introduced. Completed verification subsets: - [x] Stable source first/retest: `make verify-issue-1483` **21 PASS, 0 FAIL, 2 external acceptance SKIPs** per round; 286 focused frontend tests each. Full frontend **3,365 tests** passed twice. Related required verifiers and owned settlement/rollback subsets are documented in [RESULTS.md](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/issue-1483/RESULTS.md). Earlier failures are retained with their fixes/retests. - [x] Coolify frontend `wrwkq60kzrrscprdprawvkuq` and backend `qpdhhugwf0vo8c0lm4eejgkh` finished at the exact final revision. Build-log entries: 59/57; zero fatal-pattern matches. Independent backend/deployment/root attestation passed. Every external root script is covered, including both bootstrap files; the original incomplete checker failure is retained. - [x] Live API, UTC **01:40:49–01:45:03 on 2026-10-13**: 176 reads, 148 executable quotes, zero probe failures, two cycles separated by 185s. Required native 1/1,000/4,000 LUNC solve/best cases passed with reconciled attribution. Seven typed missing-observation responses occurred in cycle one and none in cycle two; dust and unsupported semantics remain explicit. Same-generation comparisons passed; different generations do not prove same-cohort optimality. - [x] Actual desktop/phone Swap/Trade **18/18 first and 18/18 retest**, separated by **210.213s** from first end. Ordinary-detail opening/visibility and one-notice confirmation were verified according to each actual quote. Ordered root paths/hashes/byte lengths matched before/after. Zero writes, actor requests or measured provider requests. Clean committed checker HEAD equals final main; checker SHA256 `658a262e90adad54dcedbe9637818e5c679f9fe6ca5cc2d4f7d4d704953a6276`. - [x] AC7: API/schema, rounding/invariants, documentation, issue/PR/checklist and `./skills/` crosslinks updated. The issue body now checks this criterion only. Initialized useful timings, milliseconds (browser nearest-rank quantiles): | Run | n | p50 | p95 | p99 | max | Budget | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Live API | 148 | 283.378 | 284.565 | 284.748 | 284.910 | 500 | | Browser first | 18 | 364.3 | 436.4 | 436.4 | 436.4 | 750 | | Browser retest | 18 | 366.2 | 436.7 | 436.7 | 436.7 | 750 | Bounded Grafana/Loki monitoring on logs.cl8y.com, **01:41:00–01:46:39 UTC**: all 12 frontend error-pattern matches were HTTP200 access entries; no nginx error/404/5xx matches. Eight indexer matches comprise five 503 traces, one 502 response trace and two LCD admission/fee-registry failure entries. No panic/database/integrity matches were observed. The fee-registry health probe subsequently returned configured=true, healthy=true and zero consecutive LCD failures. These observations are retained; passing quote cases do not establish universal provider readiness. Prometheus is **SKIP: no datasource provisioned**; provider/history follow-up remains in #1464/#1456. Remaining full acceptance: - [ ] AC1–AC6: original-report economics/context, original atomic SQL, independently attested production contract reserves/settlement, complete protocol-family/state/attack matrix and physical/atomic-wallet signing. Passing public quotes, synthetic funded fixtures and browser emulation do not complete these boxes. The independently chosen 4,000 LUNC case does not reconstruct the original report. - [ ] Human native-wallet outcome: queued cl8y-pm card **“Verify a native quote in your wallet”**, ID `bf7eda77-d1e4-4658-ab6e-69d97088669d`, in [the inbox](https://pm.cl8y.com/inbox). Its exact-revision copy-paste preparation command uses scoped OpenBao credentials without printing them; the helper passed read-only preparation at final main. One deliberate submit/no resend remains human work. The API rejected the direct DEX link with HTTP400; the card uses [existing PM tracking #143](https://git.cl8y.com/PlasticDigits/cl8y-pm/issues/143) and includes this DEX issue URL. Existing mobile fee-review card `f2041acd-86a0-4a86-9b90-469196638b90` is reused for #1480; no duplicate was created. **Issue #1483 remains open.** Full device/gas acceptance stays in #1480, independent reference integrity in #1479, and external-DEX design in #1330. No production reserve/book/database reset or automatic transaction resend was performed. Use [the agent checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/issue-1483/README.md) and [RC1483 invariants](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/skills/AGENTS_ROUTE_COST_ATTRIBUTION.md) for follow-up.
Author
Owner

New confirmed automatic-ranking regression is tracked in #1489. At the deployed 4cb57365 revision, independently selected 10,000 LUNC input returned 63.386134401366040994 USTR automatically, while the existing three-pool-hop quote endpoint returned 84.600140035321497618 USTR through cUSTC on matching generation/reference/observation/expiry and exact gross/credit. This is 33.467896% more net output; normal promotion is intermittent. The existing four-hop cap already permits the route.

The follow-up bundles generation dependency scope, deeper-job retry/fairness, bounded path discovery, native progress intent and truthful selected-route copy. Existing #1483 source verification again passed 21 groups with two acceptance skips, but does not cover the live failure under producer churn/contention. The live automatic-ranking counterexample remains FAIL. No source changes, signing or production reset were performed in this investigation; #1483 remains open.

New confirmed automatic-ranking regression is tracked in [#1489](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1489). At the deployed `4cb57365` revision, independently selected 10,000 LUNC input returned 63.386134401366040994 USTR automatically, while the existing three-pool-hop quote endpoint returned 84.600140035321497618 USTR through cUSTC on matching generation/reference/observation/expiry and exact gross/credit. This is 33.467896% more net output; normal promotion is intermittent. The existing four-hop cap already permits the route. The follow-up bundles generation dependency scope, deeper-job retry/fairness, bounded path discovery, native progress intent and truthful selected-route copy. Existing #1483 source verification again passed 21 groups with two acceptance skips, but does not cover the live failure under producer churn/contention. The live automatic-ranking counterexample remains FAIL. No source changes, signing or production reset were performed in this investigation; #1483 remains open.
Author
Owner

Closed at the user's request as part of consolidating issues #1449–#1500.

Amount-specific ranking and signed cost attribution are implemented, with the revised separate slippage/fee presentation delivered by #1501. Actual native recovery and protected wrapper rollout move to #1504.

Replacement: #1504

Wallet/device chores and verification-only holds are intentionally excluded. Historical failed receipts remain unchanged; this closure does not claim every old acceptance checkbox passed.

Closed at the user's request as part of consolidating issues #1449–#1500. Amount-specific ranking and signed cost attribution are implemented, with the revised separate slippage/fee presentation delivered by #1501. Actual native recovery and protected wrapper rollout move to #1504. Replacement: https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1504 Wallet/device chores and verification-only holds are intentionally excluded. Historical failed receipts remain unchanged; this closure does not claim every old acceptance checkbox passed.
Author
Owner

The 2026-10-15 repository reconciliation recovered the remaining local branch history and inspected the stale worktrees/stash. The browser lifecycle and execution-readiness merge commits introduce no new product changes relative to current main; newer policies and issue links are retained. The route-discovery stash is already incorporated by 1536631292 and subsequent actor-inventory safety corrections, so the stale snapshot was not reapplied.

Four differing historical QA records are preserved separately in docs/qa/merge-reconciliation-2026-10-15/recovered, with provenance/checksums in recovery-manifest.json. Current canonical receipts and artifact checksum lists remain in place. Private ignored configuration/artifacts and original recovery files were saved outside Git before the merged worktrees/branches/stash were removed. No production or shared database was reset, and no deployment/settlement claims are added. This completed implementation issue remains closed; outstanding live implementation work stays in its existing follow-up issues.

Final local verifiers passed: #1489 = 20 PASS / 0 FAIL / 2 explicit acceptance SKIP; #1483 = 21 PASS / 0 FAIL / 2 explicit acceptance SKIP. The first runs retained stale-database PoolTimedOut failures; complete reruns on a fresh owned fixture passed. The fixture was removed afterward. CI was explicitly skipped; details are in docs/qa/merge-reconciliation-2026-10-15/verification.json.

The 2026-10-15 repository reconciliation recovered the remaining local branch history and inspected the stale worktrees/stash. The browser lifecycle and execution-readiness merge commits introduce no new product changes relative to current main; newer policies and issue links are retained. The route-discovery stash is already incorporated by 1536631292e703bc0affcb8fd6309598ea71dc39 and subsequent actor-inventory safety corrections, so the stale snapshot was not reapplied. Four differing historical QA records are preserved separately in docs/qa/merge-reconciliation-2026-10-15/recovered, with provenance/checksums in recovery-manifest.json. Current canonical receipts and artifact checksum lists remain in place. Private ignored configuration/artifacts and original recovery files were saved outside Git before the merged worktrees/branches/stash were removed. No production or shared database was reset, and no deployment/settlement claims are added. This completed implementation issue remains closed; outstanding live implementation work stays in its existing follow-up issues. Final local verifiers passed: #1489 = 20 PASS / 0 FAIL / 2 explicit acceptance SKIP; #1483 = 21 PASS / 0 FAIL / 2 explicit acceptance SKIP. The first runs retained stale-database PoolTimedOut failures; complete reruns on a fresh owned fixture passed. The fixture was removed afterward. CI was explicitly skipped; details are in docs/qa/merge-reconciliation-2026-10-15/verification.json.
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#1483
No description provided.