Align hybrid swap quotes with hybrid on-chain execution (#418) #938
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!938
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-418-hybrid-quote-alignment"
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?
Summary
Tied to #418 / parent #411 recommendation 11.
When submit uses a hybrid book leg, the receive line must quote the same path as execution — not pool-only
simulateSwapwhile submitting Pattern C.quoteDirectHybridSwap: indexerPOST /route/solvethen wallet LCDhybrid_simulationwith identicalpool_input/book_input/max_maker_fills; throws instead of silent pool-only fallback when hybrid submit is intended.useHybridBookdefaults on; direct manual book leg uses the shared helper; removedreceiveQuoteIsPoolOnlyWithConfiguredBookLegmismatch UI and outdated pool-only copy.AGENTS_HYBRID_QUOTING.md,AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md,docs/frontend.md.Acceptance checklist
bash scripts/with-node.sh --cwd frontend-dapp -- npm test -- src/utils/directHybridQuote.test.ts src/pages/SwapPage.test.tsx src/components/trade/__tests__/TradeMarketOrderPanel.submitSnapshot.test.tsxSwapPage.tsx/TradeMarketOrderPanel.tsx; unit tests assert no "pool-only simulation" copy when book leg setquoteDisclosurereflects actual sim pathquoteDisclosureForIndexerKind+ pool-only string only when hybrid offPOST /route/solve+enrichSwapOperationsWithHopMinReturnsunchanged; direct helper passes same hybrid params to indexer and LCDBlockers: None for merge from unit-test perspective. Screenshots require manual LocalTerra walkthrough.
Third-party verification
Manual LocalTerra:
/— Settings → book leg > 0 → confirm receive line matchesswap-pre-submit-summaryreceive; no pool-only warning./trade/:pairAddrMarket — hybrid on (default), amount1→ quote disclosure shows hybrid path; submit small swap →return_amount≈ quoted receive.Test plan notes
make test-frontend: 1044 passed, 1 unrelated fail (cosmesPatch127patch file missing in this VM snapshot).Security review — MR !938
Commit reviewed:
2e19887e654d90f37365774856e1bc4a51601a9eScope: Added/modified hybrid quote alignment (
directHybridQuote.ts), Swap page + Trade market panel quote paths, defaultuseHybridBookon Swap, docs/skills cross-links.Outcome:
FINDINGS: 0medium+Summary
No new medium, high, or critical vulnerabilities identified on this diff.
Reviewed attack surfaces
quoteDirectHybridSwapenforces indexerPOST /route/solve→ LCDhybrid_simulationand throws instead of silent pool-only fallback when hybrid is intended.book_input, pay amount, andmax_maker_fillsremain bounded by existing client validation (getDirectHybridBookSplit,computeHybridParams,assertSubmitHybridAligned) and on-chain pair checks.book_start_hintis explicitlynullon direct paths (L17-safe).router_operations/estimated_amount_outswapOperationsFromIndexerResponse; submit still derives on-chainminReturnfrom LCDcomputeDirectHybridMinReturnfor hybrid direct swaps. Compromised-indexer scenarios are out of scope per review charter.postRouteSolveposts to fixedVITE_INDEXER_URL; disclosure strings are static enum mappings; no newdangerouslySetInnerHTMLor unsanitized HTML sinks.Default
useHybridBook = true(Swap): Hybrid submit still requiresbook > 0viagetDirectHybridBookSplit; empty book leg does not enable hybrid execution on Swap.Inline threads: None (zero findings).
Automated security review run (2026-06-25).
mentioned in commit
476b5f6e43