feat(swap+indexer): default hybrid multihop UX, optimization splits, GET hybrid routes (≤3 hops, intermediates) #101
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#101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
Transform default swap UX so hybrid (pool + on-chain limit book) multi-hop is the primary path for users, including optimizer-driven splits (how much of the input per hop / pool vs book) rather than manual typing.
Extend the indexer with a first-class GET (read: cacheable, idempotent) API for hybrid-optimized multihop routes up to 3 hops, returning hop-by-hop
hybridparameters and an explicit list of intermediate tokens (and pair addresses per hop) for transparency and client construction of router operations.Current baseline (repo)
SwapPage): hybrid (book leg) is opt-in and only on direct single-hop CW20 routes;postRouteSolvecan mergehybrid_by_hopfor LCDsimulate_swap_operations, but GET/api/v1/route/solveis pool-only (hybrid: nullperroute_solver.rsheader). Multihop execute/simulate in UI is pool-only today.hybridon per-hopterra_swapoperations (router.tsSwapOperation).Requirements
Frontend (dApp)
hybrid_by_hopaligned to indexer-solved routes. Handle wrap/native paths that cannot use the indexer solver explicitly (user messaging).Indexer
GET /api/v1/route/solvesemantics upgrade (breaking change allowed behind version or new path) such that a client can:token_in,token_out,amount_in(raw), and flags for “best hybrid” mode.HybridSwapParams-shaped fields (ornullfor pool-only hop) after optimization.[token_in, mid1, mid2, token_out]as applicable; document hop indexing.(token_in, token_out, amount_bucket, mode)and stale-while-revalidate.simulate_swap_operationsand pairHybridSimulation(document divergence sources).Acceptance criteria
openapi/utoipa andfrontend-dappIndexer*types updated.docs/architectureordocs/reviewsmatrix row updated: hybrid multihop no longer “manual UI only”.References
indexer/src/api/route_solver.rsfrontend-dapp/src/pages/SwapPage.tsxfrontend-dapp/src/services/terraclassic/router.tsdocs/reviews/20260409T030009Z/ARCHITECTURE_GAP_MATRIX.md(hybrid / route rows)Labels suggested
frontend,indexer,hybrid,router,launch-blockermentioned in issue #107
mentioned in issue #108
Coordinated with best-execution / simple vs advanced: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/108 and launch gate https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/107
mentioned in commit
844607a438mentioned in issue #106
@brouie — #101 implemented and merged to
main(commit range includes `64f73fa`).Indexer
dApp
Tests / docs
Verification
Please verify behavior against your expectations for 2–3 hop hybrid and indexer load; sequential per-hop optimization is not globally optimal across hops (noted in `hybrid_notes`).
mentioned in issue #209
marked as related to #209
mentioned in issue #216