fix(trading): show order slippage separately from fees and reference-price deviation #1500

Closed
opened 2026-10-14 03:02:38 +00:00 by PlasticDigits · 4 comments
Owner

Problem and why this change is needed

Swap displays a total fair-reference/net-output difference as “Price difference … — trading costs”, “wrapping costs” or “different pricing”. This combines order size/book pricing with fees, wrapper losses and reference divergence. It does not give users the requested order-slippage metric. Bundle corrected metric semantics, cost disclosure and concise consistent copy in one implementation. The retail summary must show order slippage separately from trading fees; detailed fees/costs belong in the single DETAILS disclosure.

Investigation baseline: reviewed repository HEAD (efb5fba29d3dc401d0d026d8b683db8054458920) (2026-10-14 UTC). This report is a sanitized technical synthesis. No reporter identity, conversation, supplied screenshot, wallet actor/context digest, credential, private endpoint or workstation information is attached. Reported live symptoms are distinguished from independently observed/source-confirmed behavior.

Current codebase and independently confirmed behavior

  • frontend-dapp/src/utils/swapRouteSlippage.ts:49–85 computes 100 × abs(fair − net) / max(fair, net) with checked raw integer threshold handling. Despite routeSlippage variable names, this is symmetric fair-reference deviation including output losses/costs, not order slippage alone.
  • utils/cw20RouteSolveQuote.ts and utils/nativeWrapRouteSolve.ts populate routeSlippagePercent from delivered net and reference output. pages/SwapPage.tsx:1181–1238 uses this value for display and 5/30/99 review/guard decisions.
  • utils/routeEconomicExplanation.ts validates signed common-output attribution and selects its dominant cause. components/swap/SwapImpactAside.tsx:26–43 attaches that cause to the entire aggregate percentage. Thus a percentage containing several effects is followed by a phrase such as “trading costs” or the vague “different pricing”. components/trade/TradeMarketOrderPanel.tsx shares this component and economic logic.
  • indexer/src/api/local_quote/attribution.rs already separates wrapper_loss, trading_cost, market_movement, reference_divergence as signed raw final-output units. They telescope to fair_amount_out − net_amount_out. This arithmetic bridge is advisory; it is not an independent oracle or a fee-free executable quote. market_movement can be favorable with book execution and is not safely interchangeable with the aggregate fair-reference percentage.
  • Fresh anonymous API controls on 2026-10-14 returned validated amount-specific quotes: native USTC→CL8Y at 132 units had aggregate deviation about 3.8063%, dominated by wrapper loss; CL8Y→USTC at 132 had about 8.5474% from combined market/fee/wrapper effects; CL8Y→cLUNC at 13 had about 8.8770%, dominated by reference divergence. These are new backend observations, not reproduction of the historical screenshot cohort or independent browser/deployed-contract acceptance. No transaction was signed.
  • Relevant files: backend api/local_quote/attribution.rs, protection.rs, local_quote.rs (response construction), diagnostics.rs, db_orderbook_sim.rs, local_wrapper_quote.rs and indexer/tests/scenarios/route_cost_attribution_1483.rs; frontend files above plus types/index.ts, utils/localRouteQuote.ts, utils/localWrapperOnlyQuote.ts, utils/routeEconomicExplanation.test.ts, utils/swapRouteSlippage.test.ts, components/swap/SwapImpactAside.test.tsx, pages/SwapPage.test.tsx, Trade tests and docs/route-solver.md.

Relevant source links: swapRouteSlippage.ts, routeEconomicExplanation.ts, SwapImpactAside.tsx, attribution.rs.

  1. Introduce explicitly named values for expected order slippage, trading fees, selected slippage protection, and fair-reference risk deviation. Realized execution slippage is a later measurement and must not be claimed by a pre-trade estimate. A small displayed order-slippage value never proves a safe fair reference.
  2. Specify the order-slippage numerator and denominator from selected-route original fee-free pool/book pricing and exact amount. Exclude pool/book commissions, buy/sell taxes, hook charges, wrapping/unwrap loss, network gas and independent-reference divergence. Define supported hybrid/book behavior, favorable improvement, rounding/residue and multihop normalization explicitly. Use checked raw final-output-unit boundaries, not summed per-hop percentages or the existing fair/net percentage under a new label. Do not assume market_movement / fair_amount_out is correct when the reference itself diverges; independently establish the selected-route baseline/denominator.
  3. Reuse validated original-cohort stage evidence where sufficient. If a new bounded versioned API diagnostic is needed, bind it to exact input, selected operations, policy, generation, observation and expiry; specify it in API/docs and reject malformed or unsupported values. Missing attribution must never display 0% or grant execution permission. Keep independently priceable supported quotes distinct from unavailable advisory metrics according to existing admission rules.
  4. The compact row should read Slippage X% Fee Y% token → token…, using truthful concise labels. Define the fee percentage's basis; aggregate multihop fees with exact common-unit economics rather than adding fee bps. Show canonical raw/human trading, tax/hook and wrapper costs with denomination in DETAILS, and network fee once separately in LUNC. Unknown costs remain visibly unavailable; no double counting or treating gas as output loss.
  5. Remove ambiguous “Price difference … — trading costs/wrapping costs/different pricing” retail notices. Give the actual reason for a necessary refusal/consent in concise copy; DETAILS may explain reference comparison under an accurately named separate label. Do not present total costs or reference divergence as order slippage. Preserve required consent/Expert/refusal behavior on the original economic safeguards, with wording explaining what the user is reviewing.
  6. Keep route ranking by exact delivered net for all supported identities/amounts. Neither the new slippage display nor a lower-fee route may override a better eligible net outcome. Do not special-case the reported assets, amount sizes or an intermediate route.

Constraints and guardrails

This product requirement explicitly supersedes RC1483-2's “only retail percentage” presentation rule and RC1483-7's old “Price difference”/“Signing details” copy placement; update associated docs/agent instructions. It does not replace the signed raw-attribution reconciliation contract, independently admitted reference quality (including the $10 total-TVL and separate $100 independently priced hub-depth floors), economic admission thresholds or signing controls. Preserve genuine >5% consent, >30% Expert and ≥99% nonwaivable fair-deviation refusal independently of the new displayed order metric, including favorable reference differences. Preserve quote-relative selected tolerance, separately derived execution market ceiling, exact upward-rounded positive post-hook/hop/final floors, gross route-local funding/tax credit, original expiry/context, wrapper policy, unknown offline-budget refusal and fee/Max/signing parity. Requests remain offline with existing search/resource limits and independently scheduled observations. Diagnostics cannot authorize signing; network fees remain external to delivered swap output and principal.

Acceptance criteria

  • AC1: A documented, independently verified order-slippage definition excludes every cost and reference-divergence class above, remains amount/route-specific and handles direct, multihop and supported book/hybrid execution.
  • AC2: Pure fee/wrapper/tax/hook loss with zero order pricing movement cannot inflate the displayed order-slippage value. Pure reference divergence is not called order slippage. Pure size/book effects change the metric without hiding fees; favorable/mixed effects remain signed/truthful.
  • AC3: Slippage, Fee and actual token route share the requested row. Costs are disclosed in one DETAILS panel; gas appears once separately. No vague “different pricing” or aggregate-cost-as-slippage notice remains in Swap/shared Trade.
  • AC4: All values bind the same exact original cohort and operations; reconciliation and denominators are checked. Unavailable/malformed/overflow metrics never become zero or executable permission. Same-intent refresh uses the same displayed economic snapshot until a new valid quote arrives.
  • AC5: Existing reference quality, delivered-net ranking, 5/30/99 protections, policy/floors/funding and offline fee/signing/refund guards pass unchanged. A cosmetically smaller metric cannot make an unsafe route executable.
  • AC6: Documentation, types, API, consumer validation, risk wording and agent guidance distinguish order slippage, protection tolerance, trading/wrapping/tax/network cost and fair-reference deviation consistently.

Test plan for all paths

Economic group Independent fixtures/checks
Isolated components Zero-fee finite-size pool movement; fee-only no-size-loss; wrapper-only and unwrap-loss-only; sell/buy tax and supported hook loss; pure reference divergence; favorable book pricing; mixed and offsetting components. Calculate stage raw amounts independently and compare denominators, signs and rounding.
Route shapes Direct versus 2/3/4 pool hops; natural eligible intermediates; pool-only and supported hybrid/manual splits; book-only/mixed orders, residue and maker caps; native gross versus matched-credit wrapped versus equal-gross wrapped; supported receive sizing and direct wrap/unwrap. Unsupported families explicitly refuse.
Amount/identity Both directions, arbitrary identities plus USTC↔CL8Y and CL8Y↔cLUNC controls; 1 raw/dust/small/ordinary/large, mixed 6/18/9/12 decimals, Uint128 limits; cached small→large and reverse. No symbol/amount exceptions or scaled executable quotes.
Risk/freshness Exact 5/30/99 boundaries ±1 raw unit and favorable fair deviation; malformed/missing attribution/reference; initial and background refresh, original expiry and new-intent race; consistent Swap/Trade review and fixed layout on desktop/phone.
Execution Owned supported funded fixtures independently reconcile actual wallet net, fees/principal and rejected-floor atomic rollback. Verify quote/protection/minimum/fee passed to signing rather than only the rendered label. Physical signed gas remains a separate actual receipt.

Attack, hack and abuse test plan

Forge a cheap/zero/slightly negative fee or slippage, signed raw components, denominator, method/version, dominant cause, token decimals, route boundaries, expiry or generation; mismatched/overflow/noncanonical fields must fail closed at the relevant boundary. Use adversarial spot/reference divergence and tiny liquidity to make order slippage look small while fair risk is extreme: 5/30/99 and reference admission must still operate. Replay advisory economics across amount/native credit/actor/tier/mode/operations; no diagnostic can change authorization, ranking or reviewed signing. Fuzz cyclic/repeated assets, overlong hops/plans, huge book/reserve values and hostile labels/errors for bounded work, no panics/XSS and no unexpected provider calls. Test genuine freeze/pause/blacklist, supported tax/hook settlement, hook floor and refund ownership, fee-envelope errors and no-resend recovery.

Verification criteria

Run make verify-issue-1483, 1489, 1473, 1480, 1452 and applicable reference/floor/tax/launch checks after adding meaningful independent metric fixtures. Repeat stable final source in owned disposable fixtures. Actual Swap/Trade desktop/phone checks must show the new row/cost semantics with valid matched quote provenance; API arithmetic alone cannot attest UI, independent reference truth or funded settlement. Separately attest deployed frontend/backend/root and contract artifacts for live claims; useful socket/browser clocks remain ≤500ms/≤750ms from original inputs. Complete feasible checks first; unavailable workflow holds or verification prerequisites do not block implementation/reporting. Keep skipped acceptance unchecked and preserve executed failures; no safeguard weakening, invented 0% or suppressed failure is an acceptable workaround.

Follow-up to #1483 with explicit revised presentation requirements. Preserve #1480 offline fees, #1473 quote-relative policy/outcomes, #1479 reference quality and #1489 exact-net promotion. Coordinate with #1498 for the single row/DETAILS layout and #1499 for stable quote lifecycle. This issue owns metric definitions/cost attribution and risk wording.

Completed baseline verification and retained limits

Unchanged reviewed source efb5fba29d3dc401d0d026d8b683db8054458920; independent first/retest checks on 2026-10-14 UTC. Owned disposable Postgres had a dedicated QA role/admin-owned marked control database and fresh per-process child databases; its containers were removed. The final repository working tree is clean. These are baseline investigation checks, not implementation/acceptance of this issue.

Command Final observed result Scope
make verify-issue-1483 PASS WITH SKIPS: 21 PASS, 0 FAIL, 2 SKIP Attribution/ranking/validation/components/types; funded and deployed acceptance separate.
make verify-issue-1489 PASS WITH SKIPS: 20 PASS, 0 FAIL, 2 SKIP Producer/discovery/adoption/resource regressions; deployed/funded scope separate.
make verify-issue-1480 PASS WITH SKIPS: 10 PASS, 0 FAIL, 3 SKIP Offline budget/fee/native-balance/signing guards; owned funded calibration and physical signing unverified.
make verify-issue-1473 corrected, scoped retest PASS WITH SKIPS: 17 PASS, 0 FAIL, 2 SKIP Full named source/socket/frontend groups; 482 frontend tests in each internal first/retest. Browser fixture explicitly limited to 120 rows per viewport at 5% protection, private output, truncated:true; not the full matrix.
make verify-issue-1452 final full local run PASS: 14 PASS, 0 FAIL, 0 SKIP Named local source/socket/frontend/controlled-browser/types checks, including 518 frontend tests in each first/retest; deployed/funded acceptance remains separate.

The scoped #1473 production-build browser fixture completed 240 rows across desktop/phone: 220 useful quotes, 20 typed blockers, zero fixture failures, 114 quote requests and zero provider requests. Its original-input-through-render useful timing was p50/p95/p99/max 89.7/149.1/166.7/169.8ms against 750ms. Directions actually exercised were UST1→CL8Y, CL8Y→UST1 and USTC→CL8Y at 5%; no complete pair/protection corpus is claimed. The fixture uses synthetic pinned pool economics and zero-fee native wrappers, not production settlement or nonzero-wrapper-cost acceptance.

Retained failures: the initial #1473 run finished FAIL (14 PASS, 3 FAIL, 2 SKIP). Two configured-default fixture assertions failed in both first/retest (480/482 frontend tests passed); explicit fixture-aligned CL8Y configuration subsequently passed all 482 twice, plus a standalone 16-test retest. The initial full browser attempt failed writing its receipt with ENOSPC; its generated truncated QA file was restored from a pre-run backup. The initial #1452 run was interrupted during the disk-space incident; the later full local run above is separate. Passing later/subset tests do not erase these failures or certify the failed full browser matrix. No shared build/user data was deleted to obtain a pass.

Live evidence remains narrower: the anonymous API sample has 12 useful responses, one typed unsupported outcome and two no-response probe failures. One useful HTTP duration was 849.278ms (above the separate 500ms target); transport classes were not captured, so this is retained rather than claimed as initialized socket acceptance. Phone/desktop live DOM transitions reproduce the presentation failures but do not independently validate every response. Initial browser setup/timeouts and the stopped independent deployment attester remain failed/incomplete; a later public health read matches the reviewed backend SHA only. Exact frontend/root/contracts, full sustained live matrix, physical wallets and funded execution remain unverified. No incomplete acceptance criterion is checked, and related open issues are not closed by these source passes.

## Problem and why this change is needed Swap displays a total fair-reference/net-output difference as “Price difference … — trading costs”, “wrapping costs” or “different pricing”. This combines order size/book pricing with fees, wrapper losses and reference divergence. It does not give users the requested order-slippage metric. Bundle corrected metric semantics, cost disclosure and concise consistent copy in one implementation. The retail summary must show order slippage separately from trading fees; detailed fees/costs belong in the single DETAILS disclosure. Investigation baseline: [reviewed repository HEAD](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/efb5fba29d3dc401d0d026d8b683db8054458920) (`efb5fba29d3dc401d0d026d8b683db8054458920`) (2026-10-14 UTC). This report is a sanitized technical synthesis. No reporter identity, conversation, supplied screenshot, wallet actor/context digest, credential, private endpoint or workstation information is attached. Reported live symptoms are distinguished from independently observed/source-confirmed behavior. ## Current codebase and independently confirmed behavior - `frontend-dapp/src/utils/swapRouteSlippage.ts:49–85` computes `100 × abs(fair − net) / max(fair, net)` with checked raw integer threshold handling. Despite routeSlippage variable names, this is symmetric fair-reference deviation including output losses/costs, not order slippage alone. - `utils/cw20RouteSolveQuote.ts` and `utils/nativeWrapRouteSolve.ts` populate `routeSlippagePercent` from delivered net and reference output. `pages/SwapPage.tsx:1181–1238` uses this value for display and 5/30/99 review/guard decisions. - `utils/routeEconomicExplanation.ts` validates signed common-output attribution and selects its dominant cause. `components/swap/SwapImpactAside.tsx:26–43` attaches that cause to the entire aggregate percentage. Thus a percentage containing several effects is followed by a phrase such as “trading costs” or the vague “different pricing”. `components/trade/TradeMarketOrderPanel.tsx` shares this component and economic logic. - `indexer/src/api/local_quote/attribution.rs` already separates `wrapper_loss`, `trading_cost`, `market_movement`, `reference_divergence` as signed raw final-output units. They telescope to `fair_amount_out − net_amount_out`. This arithmetic bridge is advisory; it is not an independent oracle or a fee-free executable quote. `market_movement` can be favorable with book execution and is not safely interchangeable with the aggregate fair-reference percentage. - Fresh anonymous API controls on 2026-10-14 returned validated amount-specific quotes: native USTC→CL8Y at 132 units had aggregate deviation about 3.8063%, dominated by wrapper loss; CL8Y→USTC at 132 had about 8.5474% from combined market/fee/wrapper effects; CL8Y→cLUNC at 13 had about 8.8770%, dominated by reference divergence. These are new backend observations, not reproduction of the historical screenshot cohort or independent browser/deployed-contract acceptance. No transaction was signed. - Relevant files: backend `api/local_quote/attribution.rs`, `protection.rs`, `local_quote.rs` (response construction), `diagnostics.rs`, `db_orderbook_sim.rs`, `local_wrapper_quote.rs` and `indexer/tests/scenarios/route_cost_attribution_1483.rs`; frontend files above plus `types/index.ts`, `utils/localRouteQuote.ts`, `utils/localWrapperOnlyQuote.ts`, `utils/routeEconomicExplanation.test.ts`, `utils/swapRouteSlippage.test.ts`, `components/swap/SwapImpactAside.test.tsx`, `pages/SwapPage.test.tsx`, Trade tests and `docs/route-solver.md`. Relevant source links: [swapRouteSlippage.ts](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/efb5fba29d3dc401d0d026d8b683db8054458920/frontend-dapp/src/utils/swapRouteSlippage.ts), [routeEconomicExplanation.ts](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/efb5fba29d3dc401d0d026d8b683db8054458920/frontend-dapp/src/utils/routeEconomicExplanation.ts), [SwapImpactAside.tsx](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/efb5fba29d3dc401d0d026d8b683db8054458920/frontend-dapp/src/components/swap/SwapImpactAside.tsx), [attribution.rs](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/efb5fba29d3dc401d0d026d8b683db8054458920/indexer/src/api/local_quote/attribution.rs). ## Recommended direction and metric contract 1. Introduce explicitly named values for **expected order slippage**, **trading fees**, **selected slippage protection**, and **fair-reference risk deviation**. Realized execution slippage is a later measurement and must not be claimed by a pre-trade estimate. A small displayed order-slippage value never proves a safe fair reference. 2. Specify the order-slippage numerator and denominator from selected-route original fee-free pool/book pricing and exact amount. Exclude pool/book commissions, buy/sell taxes, hook charges, wrapping/unwrap loss, network gas and independent-reference divergence. Define supported hybrid/book behavior, favorable improvement, rounding/residue and multihop normalization explicitly. Use checked raw final-output-unit boundaries, not summed per-hop percentages or the existing fair/net percentage under a new label. Do not assume `market_movement / fair_amount_out` is correct when the reference itself diverges; independently establish the selected-route baseline/denominator. 3. Reuse validated original-cohort stage evidence where sufficient. If a new bounded versioned API diagnostic is needed, bind it to exact input, selected operations, policy, generation, observation and expiry; specify it in API/docs and reject malformed or unsupported values. Missing attribution must never display 0% or grant execution permission. Keep independently priceable supported quotes distinct from unavailable advisory metrics according to existing admission rules. 4. The compact row should read `Slippage X% Fee Y% token → token…`, using truthful concise labels. Define the fee percentage's basis; aggregate multihop fees with exact common-unit economics rather than adding fee bps. Show canonical raw/human trading, tax/hook and wrapper costs with denomination in DETAILS, and network fee once separately in LUNC. Unknown costs remain visibly unavailable; no double counting or treating gas as output loss. 5. Remove ambiguous “Price difference … — trading costs/wrapping costs/different pricing” retail notices. Give the actual reason for a necessary refusal/consent in concise copy; DETAILS may explain reference comparison under an accurately named separate label. Do not present total costs or reference divergence as order slippage. Preserve required consent/Expert/refusal behavior on the original economic safeguards, with wording explaining what the user is reviewing. 6. Keep route ranking by exact delivered net for all supported identities/amounts. Neither the new slippage display nor a lower-fee route may override a better eligible net outcome. Do not special-case the reported assets, amount sizes or an intermediate route. ## Constraints and guardrails This product requirement explicitly supersedes RC1483-2's “only retail percentage” presentation rule and RC1483-7's old “Price difference”/“Signing details” copy placement; update associated docs/agent instructions. It does **not** replace the signed raw-attribution reconciliation contract, independently admitted reference quality (including the $10 total-TVL and separate $100 independently priced hub-depth floors), economic admission thresholds or signing controls. Preserve genuine >5% consent, >30% Expert and ≥99% nonwaivable fair-deviation refusal independently of the new displayed order metric, including favorable reference differences. Preserve quote-relative selected tolerance, separately derived execution market ceiling, exact upward-rounded positive post-hook/hop/final floors, gross route-local funding/tax credit, original expiry/context, wrapper policy, unknown offline-budget refusal and fee/Max/signing parity. Requests remain offline with existing search/resource limits and independently scheduled observations. Diagnostics cannot authorize signing; network fees remain external to delivered swap output and principal. ## Acceptance criteria - [ ] AC1: A documented, independently verified order-slippage definition excludes every cost and reference-divergence class above, remains amount/route-specific and handles direct, multihop and supported book/hybrid execution. - [ ] AC2: Pure fee/wrapper/tax/hook loss with zero order pricing movement cannot inflate the displayed order-slippage value. Pure reference divergence is not called order slippage. Pure size/book effects change the metric without hiding fees; favorable/mixed effects remain signed/truthful. - [ ] AC3: Slippage, Fee and actual token route share the requested row. Costs are disclosed in one DETAILS panel; gas appears once separately. No vague “different pricing” or aggregate-cost-as-slippage notice remains in Swap/shared Trade. - [ ] AC4: All values bind the same exact original cohort and operations; reconciliation and denominators are checked. Unavailable/malformed/overflow metrics never become zero or executable permission. Same-intent refresh uses the same displayed economic snapshot until a new valid quote arrives. - [ ] AC5: Existing reference quality, delivered-net ranking, 5/30/99 protections, policy/floors/funding and offline fee/signing/refund guards pass unchanged. A cosmetically smaller metric cannot make an unsafe route executable. - [ ] AC6: Documentation, types, API, consumer validation, risk wording and agent guidance distinguish order slippage, protection tolerance, trading/wrapping/tax/network cost and fair-reference deviation consistently. ## Test plan for all paths | Economic group | Independent fixtures/checks | | --- | --- | | Isolated components | Zero-fee finite-size pool movement; fee-only no-size-loss; wrapper-only and unwrap-loss-only; sell/buy tax and supported hook loss; pure reference divergence; favorable book pricing; mixed and offsetting components. Calculate stage raw amounts independently and compare denominators, signs and rounding. | | Route shapes | Direct versus 2/3/4 pool hops; natural eligible intermediates; pool-only and supported hybrid/manual splits; book-only/mixed orders, residue and maker caps; native gross versus matched-credit wrapped versus equal-gross wrapped; supported receive sizing and direct wrap/unwrap. Unsupported families explicitly refuse. | | Amount/identity | Both directions, arbitrary identities plus USTC↔CL8Y and CL8Y↔cLUNC controls; 1 raw/dust/small/ordinary/large, mixed 6/18/9/12 decimals, Uint128 limits; cached small→large and reverse. No symbol/amount exceptions or scaled executable quotes. | | Risk/freshness | Exact 5/30/99 boundaries ±1 raw unit and favorable fair deviation; malformed/missing attribution/reference; initial and background refresh, original expiry and new-intent race; consistent Swap/Trade review and fixed layout on desktop/phone. | | Execution | Owned supported funded fixtures independently reconcile actual wallet net, fees/principal and rejected-floor atomic rollback. Verify quote/protection/minimum/fee passed to signing rather than only the rendered label. Physical signed gas remains a separate actual receipt. | ## Attack, hack and abuse test plan Forge a cheap/zero/slightly negative fee or slippage, signed raw components, denominator, method/version, dominant cause, token decimals, route boundaries, expiry or generation; mismatched/overflow/noncanonical fields must fail closed at the relevant boundary. Use adversarial spot/reference divergence and tiny liquidity to make order slippage look small while fair risk is extreme: 5/30/99 and reference admission must still operate. Replay advisory economics across amount/native credit/actor/tier/mode/operations; no diagnostic can change authorization, ranking or reviewed signing. Fuzz cyclic/repeated assets, overlong hops/plans, huge book/reserve values and hostile labels/errors for bounded work, no panics/XSS and no unexpected provider calls. Test genuine freeze/pause/blacklist, supported tax/hook settlement, hook floor and refund ownership, fee-envelope errors and no-resend recovery. ## Verification criteria Run `make verify-issue-1483`, `1489`, `1473`, `1480`, `1452` and applicable reference/floor/tax/launch checks after adding meaningful independent metric fixtures. Repeat stable final source in owned disposable fixtures. Actual Swap/Trade desktop/phone checks must show the new row/cost semantics with valid matched quote provenance; API arithmetic alone cannot attest UI, independent reference truth or funded settlement. Separately attest deployed frontend/backend/root and contract artifacts for live claims; useful socket/browser clocks remain ≤500ms/≤750ms from original inputs. Complete feasible checks first; unavailable workflow holds or verification prerequisites do not block implementation/reporting. Keep skipped acceptance unchecked and preserve executed failures; no safeguard weakening, invented 0% or suppressed failure is an acceptable workaround. ## Related work Follow-up to #1483 with explicit revised presentation requirements. Preserve #1480 offline fees, #1473 quote-relative policy/outcomes, #1479 reference quality and #1489 exact-net promotion. Coordinate with [#1498](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1498) for the single row/DETAILS layout and [#1499](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1499) for stable quote lifecycle. This issue owns metric definitions/cost attribution and risk wording. ## Completed baseline verification and retained limits Unchanged reviewed source `efb5fba29d3dc401d0d026d8b683db8054458920`; independent first/retest checks on 2026-10-14 UTC. Owned disposable Postgres had a dedicated QA role/admin-owned marked control database and fresh per-process child databases; its containers were removed. The final repository working tree is clean. These are baseline investigation checks, not implementation/acceptance of this issue. | Command | Final observed result | Scope | | --- | --- | --- | | `make verify-issue-1483` | PASS WITH SKIPS: 21 PASS, 0 FAIL, 2 SKIP | Attribution/ranking/validation/components/types; funded and deployed acceptance separate. | | `make verify-issue-1489` | PASS WITH SKIPS: 20 PASS, 0 FAIL, 2 SKIP | Producer/discovery/adoption/resource regressions; deployed/funded scope separate. | | `make verify-issue-1480` | PASS WITH SKIPS: 10 PASS, 0 FAIL, 3 SKIP | Offline budget/fee/native-balance/signing guards; owned funded calibration and physical signing unverified. | | `make verify-issue-1473` corrected, scoped retest | PASS WITH SKIPS: 17 PASS, 0 FAIL, 2 SKIP | Full named source/socket/frontend groups; 482 frontend tests in each internal first/retest. Browser fixture explicitly limited to 120 rows per viewport at 5% protection, private output, `truncated:true`; not the full matrix. | | `make verify-issue-1452` final full local run | PASS: 14 PASS, 0 FAIL, 0 SKIP | Named local source/socket/frontend/controlled-browser/types checks, including 518 frontend tests in each first/retest; deployed/funded acceptance remains separate. | The scoped #1473 production-build browser fixture completed 240 rows across desktop/phone: 220 useful quotes, 20 typed blockers, zero fixture failures, 114 quote requests and zero provider requests. Its original-input-through-render useful timing was p50/p95/p99/max 89.7/149.1/166.7/169.8ms against 750ms. Directions actually exercised were UST1→CL8Y, CL8Y→UST1 and USTC→CL8Y at 5%; no complete pair/protection corpus is claimed. The fixture uses synthetic pinned pool economics and zero-fee native wrappers, not production settlement or nonzero-wrapper-cost acceptance. Retained failures: the initial #1473 run finished **FAIL (14 PASS, 3 FAIL, 2 SKIP)**. Two configured-default fixture assertions failed in both first/retest (480/482 frontend tests passed); explicit fixture-aligned CL8Y configuration subsequently passed all 482 twice, plus a standalone 16-test retest. The initial full browser attempt failed writing its receipt with `ENOSPC`; its generated truncated QA file was restored from a pre-run backup. The initial #1452 run was interrupted during the disk-space incident; the later full local run above is separate. Passing later/subset tests do not erase these failures or certify the failed full browser matrix. No shared build/user data was deleted to obtain a pass. Live evidence remains narrower: the anonymous API sample has 12 useful responses, one typed unsupported outcome and two no-response probe failures. One useful HTTP duration was 849.278ms (above the separate 500ms target); transport classes were not captured, so this is retained rather than claimed as initialized socket acceptance. Phone/desktop live DOM transitions reproduce the presentation failures but do not independently validate every response. Initial browser setup/timeouts and the stopped independent deployment attester remain failed/incomplete; a later public health read matches the reviewed backend SHA only. Exact frontend/root/contracts, full sustained live matrix, physical wallets and funded execution remain unverified. No incomplete acceptance criterion is checked, and related open issues are not closed by these source passes.
Author
Owner

Implementation merged in PR #1501, main revision 9dfa373f989ca9684c00ce40bc0525265243dfe9 (2026-10-14 UTC). Woodpecker PR pipeline #456 passed, including secrets, contracts, full frontend, indexer library/Postgres and required functional checks.

Completed source/local scope:

  • Restore genuine advanced Trade entry and stable active-navigation history.
  • One stable Swap summary/status and DETAILS disclosure, positive anonymous minimum and one separate LUNC network fee.
  • Original-cohort unexpired retention, original expiry/recovery and missing-versus-unsupported producer classification.
  • Independent signed fee-free pool/book metrics, original maker-term binding and separate fees/costs/fair-reference safeguards.
  • Relevant source verifiers, meaningful first/retest fixtures, 4,250 complete controlled desktop/phone rows (zero failures/provider RPC), funded pool/native/tax/invoice checks, docs and agent invariants.
  • Exact deployed artifact/live sustained acceptance: Coolify deployment and final probes are now running.
  • Complete physical-wallet/production settlement and unmeasured funded/shape scopes: remain separate and unclaimed.

Individual acceptance criteria are not closed by this shared source summary. Evidence, retained failures and remaining scope and the individual QA checklists are included in main. The initial documentation/owned-fixture failures were corrected and retested; prior failures remain recorded. Final issue-specific live results will follow; this issue remains open until all body/comment criteria pass.

Implementation merged in [PR #1501](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1501), main revision `9dfa373f989ca9684c00ce40bc0525265243dfe9` (2026-10-14 UTC). Woodpecker PR pipeline #456 passed, including secrets, contracts, full frontend, indexer library/Postgres and required functional checks. Completed source/local scope: - [x] Restore genuine advanced Trade entry and stable active-navigation history. - [x] One stable Swap summary/status and DETAILS disclosure, positive anonymous minimum and one separate LUNC network fee. - [x] Original-cohort unexpired retention, original expiry/recovery and missing-versus-unsupported producer classification. - [x] Independent signed fee-free pool/book metrics, original maker-term binding and separate fees/costs/fair-reference safeguards. - [x] Relevant source verifiers, meaningful first/retest fixtures, 4,250 complete controlled desktop/phone rows (zero failures/provider RPC), funded pool/native/tax/invoice checks, docs and agent invariants. - [ ] Exact deployed artifact/live sustained acceptance: Coolify deployment and final probes are now running. - [ ] Complete physical-wallet/production settlement and unmeasured funded/shape scopes: remain separate and unclaimed. Individual acceptance criteria are not closed by this shared source summary. [Evidence, retained failures and remaining scope](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/trading-1497-1500/RESULTS.md) and the individual QA checklists are included in main. The initial documentation/owned-fixture failures were corrected and retested; prior failures remain recorded. Final issue-specific live results will follow; this issue remains open until all body/comment criteria pass.
Author
Owner

Producer follow-up PR #1502 is merged into main 14055610ebe86fd3640ff85e8adc15e16785c6dd; required CI #458 passed all eight steps. Main and the feature worktree are synchronized.

  • Independent scheduled tax/router/denom observations preserve completed fields when an unrelated read times out. Mapper/treasury capabilities use the same bounded rule.
  • Original two-second phases, two permits/four RPS, eight-second outer deadline, original freshness, offline requests and fail-closed signing remain enforced.
  • Thirteen producer tests and the real LCD shared-budget check pass first/retest; broader lifecycle/attribution/provider source/socket checks pass available scopes.
  • The exact controlled-browser step passes fresh first/retest (40 samples each; maxima 49.9/48.0ms below unchanged 250ms). The earlier full #1452 command remains recorded as FAIL for its isolated 401.2ms transport/scheduling sample; it was not relabeled or hidden.
  • New deployment/live first/retest: Coolify deployment is in progress. The earlier 9dfa live latency and unresolved observer/readiness failures remain recorded separately.
  • Complete physical-wallet, contract/oracle and all-family acceptance: remaining scope stays unchecked.

See release results and invariant links. This is source/CI completion, not a claim that every issue criterion passed. Final issue-specific live results will follow; the issues remain open.

Producer follow-up [PR #1502](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1502) is merged into main `14055610ebe86fd3640ff85e8adc15e16785c6dd`; required [CI #458](https://ci.cl8y.com/repos/7/pipeline/458/1) passed all eight steps. Main and the feature worktree are synchronized. - [x] Independent scheduled tax/router/denom observations preserve completed fields when an unrelated read times out. Mapper/treasury capabilities use the same bounded rule. - [x] Original two-second phases, two permits/four RPS, eight-second outer deadline, original freshness, offline requests and fail-closed signing remain enforced. - [x] Thirteen producer tests and the real LCD shared-budget check pass first/retest; broader lifecycle/attribution/provider source/socket checks pass available scopes. - [x] The exact controlled-browser step passes fresh first/retest (40 samples each; maxima 49.9/48.0ms below unchanged 250ms). The earlier full #1452 command remains recorded as FAIL for its isolated 401.2ms transport/scheduling sample; it was not relabeled or hidden. - [ ] New deployment/live first/retest: Coolify deployment is in progress. The earlier 9dfa live latency and unresolved observer/readiness failures remain recorded separately. - [ ] Complete physical-wallet, contract/oracle and all-family acceptance: remaining scope stays unchecked. See [release results and invariant links](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/trading-1497-1500/RESULTS.md). This is source/CI completion, not a claim that every issue criterion passed. Final issue-specific live results will follow; the issues remain open.
Author
Owner

Final QA/evidence PR #1503 merged into main 4bd3e8d31485613d6c3ddca62abbac1a1f6e6469; required CI #460 passed all eight steps. Main and the worktree are clean and synchronized with origin/main. Application runtime inputs did not change in this QA-only merge; the actual deployed revision remains the attested 14055610… below.

Fixes merged in PR #1501 and PR #1502. Both Coolify applications finished at independently attested release 14055610ebe86fd3640ff85e8adc15e16785c6dd; required CI pipelines 456/458 each passed all eight steps. Later helper/evidence changes do not claim a newer application deployment.

  • Implemented independently checked selected-route original fee-free pricing versus original chained spot denominator, signed order slippage and separate common-output trading fees.
  • Exact original input/operations/policy/generation/observations/expiry and bounded original maker terms bind diagnostics; unused-maker inconsistency and manual-policy alignment regressions pass. Original 5/30/99 fair-risk/signing protections were unaffected by the minor advisory discrepancy.
  • AC6: Types/API/consumer/risk wording/docs/agent invariants distinguish order slippage, protection, costs and reference deviation.
  • Source and controlled geometry/matrix checks; owned pool first/retest 24+24 settlements, native 12+12 settlements and 48 actual floor-rejection rollbacks. These synthetic budgets are not production gas calibration.
  • Complete AC1–AC5/full live contract/oracle/shape/amount corpus, independent same-cohort matching-credit settlement, native-output/tax/hook/populated-book and physical signed gas.
  • Full live timing/freshness acceptance retains native and observer failures; no threshold, original clock or signing guard was weakened.

A current-release physical-wallet card is queued through the inbox-assigner skill on cl8y-pm, linked to operator tracking #143. Its ready command consumes OpenBao credentials privately and prepares one reviewed attempt. It explicitly supersedes the earlier obsolete 9dfa card; the assigner cannot withdraw that older card. No mainnet transaction was signed by the agent.

Results, retained failed runs and invariant links. All issue bodies and current comments were reviewed. No complete acceptance claim: this issue stays open for the unchecked scope.

QA provenance limit: final V5 tools pass 27/27 regressions first/retest; no new full live trial was run after those corrections. Executed V4 driver/clock hashes and raw receipts were retained, but their exact source bytes were not archived. This limits exact replay; original failed live verdicts remain unchanged.

Final QA/evidence [PR #1503](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1503) merged into main `4bd3e8d31485613d6c3ddca62abbac1a1f6e6469`; [required CI #460](https://ci.cl8y.com/repos/7/pipeline/460/1) passed all eight steps. Main and the worktree are clean and synchronized with origin/main. Application runtime inputs did not change in this QA-only merge; the actual deployed revision remains the attested `14055610…` below. Fixes merged in [PR #1501](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1501) and [PR #1502](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1502). Both Coolify applications finished at independently attested release `14055610ebe86fd3640ff85e8adc15e16785c6dd`; required CI pipelines 456/458 each passed all eight steps. Later helper/evidence changes do not claim a newer application deployment. - [x] Implemented independently checked selected-route original fee-free pricing versus original chained spot denominator, signed order slippage and separate common-output trading fees. - [x] Exact original input/operations/policy/generation/observations/expiry and bounded original maker terms bind diagnostics; unused-maker inconsistency and manual-policy alignment regressions pass. Original 5/30/99 fair-risk/signing protections were unaffected by the minor advisory discrepancy. - [x] AC6: Types/API/consumer/risk wording/docs/agent invariants distinguish order slippage, protection, costs and reference deviation. - [x] Source and controlled geometry/matrix checks; owned pool first/retest 24+24 settlements, native 12+12 settlements and 48 actual floor-rejection rollbacks. These synthetic budgets are not production gas calibration. - [ ] Complete AC1–AC5/full live contract/oracle/shape/amount corpus, independent same-cohort matching-credit settlement, native-output/tax/hook/populated-book and physical signed gas. - [ ] Full live timing/freshness acceptance retains native and observer failures; no threshold, original clock or signing guard was weakened. A current-release physical-wallet card is queued through the inbox-assigner skill on [cl8y-pm](https://pm.cl8y.com/inbox), linked to [operator tracking #143](https://git.cl8y.com/PlasticDigits/cl8y-pm/issues/143). Its ready command consumes OpenBao credentials privately and prepares one reviewed attempt. It explicitly supersedes the earlier obsolete 9dfa card; the assigner cannot withdraw that older card. No mainnet transaction was signed by the agent. [Results, retained failed runs and invariant links](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/trading-1497-1500/RESULTS.md). All issue bodies and current comments were reviewed. No complete acceptance claim: this issue stays open for the unchecked scope. QA provenance limit: final V5 tools pass 27/27 regressions first/retest; no new full live trial was run after those corrections. Executed V4 driver/clock hashes and raw receipts were retained, but their exact source bytes were not archived. This limits exact replay; original failed live verdicts remain unchanged.
Author
Owner

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

Separate signed order slippage, trading fees, actual route and fair-reference safeguards are implemented and deployed. Remaining 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. Separate signed order slippage, trading fees, actual route and fair-reference safeguards are implemented and deployed. Remaining 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.
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#1500
No description provided.