Repository navigation
feat(aggregator): multi-hop swap routing through configurable interme… - #585
Merged
Miracle656 merged 1 commit intoOct 22, 2026
Merged
Conversation
…diate assets - Evaluate multi-hop paths across configurable intermediates (ROUTING_INTERMEDIATES, defaulting to XLM and Circle USDC) up to ROUTING_MAX_HOPS depth bound - Detail each hop with venue (SDEX/AMM), poolId, price, spot price, and slippage percentage - Provide side-by-side comparison between direct and multi-hop routes, preferring direct when superior - Include provenance metadata with query timestamps, network, venues queried, sample counts, and data freshness age - Expose network parameter on GET /price/:assetA/:assetB/route and declare schema updates in openapi.yaml and schema.graphql - Add unit and property test coverage verifying multi-hop route selection on thin pairs
|
@dmoonventure070-art Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Miracle656
added a commit
that referenced
this pull request
Oct 22, 2026
tsc --noEmit clean vitest 106 files, 1232 passing (up from 102 / 1157) dropped-tests none Four of the eight screened in this group. The other four were held, and the reason is worth stating because it keeps recurring: each one merges cleanly and fails on its own. #590 72 type errors alone, including syntax errors in src/api/rest.ts and src/api/schemas.ts -- "Declaration or statement expected", "Expression expected". Not type mismatches; the file does not parse. #584 3 type errors alone #592 conflicts #595 conflicts Merged together before screening, that group produced 68 failing test files and syntax errors I first mistook for a bad three-way merge. They were not: #590 carries them on its own branch. Screening each PR individually before batching costs one typecheck per PR and saves an hour of bisection, which is the lesson of the day. Claude-Session: https://claude.ai/code/session_01USgemLt4Rnz4SGB1Srf3GB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #295
feat(aggregator): Multi-hop Swap Routing through Intermediate Assets
Summary
Implements bounded multi-hop routing for Stellar asset swaps in
src/aggregator/bestRoute.ts. Previously,bestRouteonly compared direct SDEX vs AMM pools. For thin pairs, direct execution routinely incurs heavy slippage or insufficient liquidity where two-hop routes through liquid assets (such as XLM or Circle USDC) offer significantly better output.Key Changes
maxHopsdepth (configured viaROUTING_MAX_HOPS, defaulting to 3).ROUTING_INTERMEDIATES, defaulting to native XLM and Circle USDC with whole issuer addresses).assetIn,assetOut,venue,poolId,price,spotPrice, andslippagePct.comparisonin the payload displaying bothdirectexecution andmultiHopoptions side-by-side.provenanceblock on every response statingsampledAt,network,venuesQueried,sampleCount, andfreshnessSeconds.?network=query parameter handling onGET /price/:assetA/:assetB/route.src/api/schemas.ts.openapi.yamland regeneratedopenapi.json.src/api/graphql.tsand regeneratedschema.graphql..changeset/multi-hop-routing.md.maxHopsconfiguration bounds.npm test, 85 test files, 919 passing tests) andtsc --noEmit.