fix(trading): quote supported amounts under selected protection #1474
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/cl8y-dex-terraclassic!1474
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/1473-trading-quotes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A supported trade could reject its own amount-specific quote when predicted AMM price impact exceeded the UI slippage percentage. Retail now requests an explicit quote-relative policy: the selected percentage protects net receive with positive rounded-up hop/final floors, while checked pinned market economics derive the separate router spread bound. The client independently validates the policy, integer bound, capability flags and original 20-second window before signing. Existing contracts support these messages; legacy API requests retain their original behavior.
Pricing applies to arbitrary supported pairs and exact amounts in both directions. Fresh trading entry defaults to native USTC → configured CL8Y by identity; explicit links, user choices and genuine factory ticket direction retain precedence. Retail shows a single executable receive quote. Fixed bounded public reasons and generation-based recovery replace internal validation copy and repeated unchanged error solves.
Addresses #1473. The issue remains open until all source/deployed/body/comment acceptance is established; this PR does not auto-close it.
Validation and release evidence are maintained in docs/qa/issue-1473/RESULTS.md, with the reproducible agent checklist and TQ1473 invariants. Run
make verify-issue-1473and the listed prerequisite verifiers. The shared corpus covers seven pairs, both directions, mixed decimals, raw/amount boundaries and 1%/5%/30% settings. Owned LocalTerra first/retest proofs each execute 24 direct/multihop cases with exact quoted net delivery and rejected-floor reserve/LP rollback.The user explicitly requested a temporary 750 ms initialized-browser criterion on 2026-10-11. Fresh controlled/deployed receipts name that budget; original 500 ms FAIL receipts retain their verdicts and AC7 now explicitly states 750 ms for now. Prior 500 ms acceptance remains unestablished. Socket latency stays at 500 ms, and economic protection percentages and resource/expiry limits are unchanged.
Final selected source scope: 15 PASS, 0 FAIL, 2 SKIP, combining the core first/retest and the separately executed full browser trial on the identical source fingerprint. Browser coverage is 4,250 scenarios, 3,948 useful quotes, 302 bounded rejections and zero provider requests; p50/p95/p99/max are 84.7/148.8/183.5/528.9 ms. Three measurements exceed the prior 500 ms target, so this is a fresh PASS only under the explicitly requested 750 ms criterion. Deployment, physical devices and complete tax/hook/native settlement coverage remain separate; the executed #1396 custom-bridge host-network failure remains documented.
Available prerequisites completed: #1452 14/0/0, #1453 composite 12/0/2, #1381 13/0/1 plus 11 owned chain checks repeated, #1392 composite 12/0/0, and the documented floor/guard/liveness/discovery/funded-reverse checks. The #1452 fixture now models independently produced observations with an exact 20-second expiry; its first/retest browser maxima are 50.8/52.8 ms at the unchanged 250 ms budget. Original failed fixtures and the separate #1396 custom-bridge host-access failures remain recorded.
Unavailable checks may be explicit SKIP with PASS WITH SKIPS for the stated tested scope; executed failures remain FAIL until corrected and rerun. Original browser latency and host QA networking failures remain recorded separately; source checks do not establish complete production acceptance.
Final review head:
09365d97a9529beccfa8c3fcb15be11d7ca983d2. The primary source fingerprint remains7d0df872c5d2f1b041f6e6f241973477aa6de6bd5d4235cdfce1ad9c3cde980b; the follow-ups record PR/prerequisite evidence, correct independently produced fixture expiry, and support the enrolled deployment broker. Hosted six-job verification is pending on this exact head.