You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:src/routing/routing.service.ts currently implements exactly one method, createDirectRoute(), which always produces a single-step Route with a hardcoded estimatedTime: 60 and estimatedGas: "0" — there is no logic for composing a multi-hop route (e.g. source-chain bridge/swap step followed by a Stellar-side fill) even though the Route/RouteStep types it returns (src/intents/intents.types.ts) are already generically shaped to support multiple steps.
Problem Statement & Context: Issue #7 wires RoutingService into the intent creation/quote flow and issue #13 filters quotes by solver capability, but both assume RoutingService produces a correct route — today it always returns the same trivial direct-solver-transfer shape regardless of whether a better (cheaper, faster) multi-hop path exists. This leaves real routing logic as the single biggest gap in the "routing" subsystem's name.
Scope & Acceptance Criteria:
Add a route-composition method that can produce a multi-step Route (e.g. source-chain step + Stellar-side step) when a direct solver path isn't the best option, using the existing RouteStep/Route types unchanged.
Add real (non-hardcoded) estimatedTime/estimatedGas/totalFeesUSD/priceImpact calculation, replacing the current always-0/always-60 placeholders, informed by whatever token/solver data is realistically available (src/tokens/tokens.service.ts, src/solvers/solvers.service.ts).
Out of scope: integrating with any external bridging/DEX aggregator API — model multi-hop composition using the protocol's own solver network only; external liquidity-source integration is a larger, separate effort.
Out of scope: the wiring of RoutingService into the controller/service flow — that's issue feat: add SolversModule (service + controller) #7's scope; this issue only makes the routing logic itself non-trivial.
Design a clear decision boundary for when a direct route suffices versus when multi-hop composition is attempted (e.g. based on solver capability match from issue test: unit tests for IntentsService, SolversService, TokensService #13's filtering work) — document the chosen heuristic since "optimal routing" is an open-ended problem and this issue should scope to a defensible, testable heuristic rather than true optimization.
Preserve backward compatibility for existing callers of createDirectRoute() (keep it as a valid code path/fallback) rather than replacing it outright, since other in-flight issues may depend on its current signature.
Testing: minimum 85% coverage on the new composition logic; add test cases for direct-route-still-best, multi-hop-required, and no-viable-route scenarios, plus verification that computed estimatedTime/estimatedGas/totalFeesUSD are no longer hardcoded placeholders.
Definition of Done:
Multi-hop composition implemented, real cost/time estimation added, backward compatibility preserved.
Description:
src/routing/routing.service.tscurrently implements exactly one method,createDirectRoute(), which always produces a single-stepRoutewith a hardcodedestimatedTime: 60andestimatedGas: "0"— there is no logic for composing a multi-hop route (e.g. source-chain bridge/swap step followed by a Stellar-side fill) even though theRoute/RouteSteptypes it returns (src/intents/intents.types.ts) are already generically shaped to support multiple steps.Problem Statement & Context: Issue #7 wires
RoutingServiceinto the intent creation/quote flow and issue #13 filters quotes by solver capability, but both assumeRoutingServiceproduces a correct route — today it always returns the same trivial direct-solver-transfer shape regardless of whether a better (cheaper, faster) multi-hop path exists. This leaves real routing logic as the single biggest gap in the "routing" subsystem's name.Scope & Acceptance Criteria:
Route(e.g. source-chain step + Stellar-side step) when a direct solver path isn't the best option, using the existingRouteStep/Routetypes unchanged.estimatedTime/estimatedGas/totalFeesUSD/priceImpactcalculation, replacing the current always-0/always-60placeholders, informed by whatever token/solver data is realistically available (src/tokens/tokens.service.ts,src/solvers/solvers.service.ts).RoutingServiceinto the controller/service flow — that's issue feat: add SolversModule (service + controller) #7's scope; this issue only makes the routing logic itself non-trivial.Implementation Guidelines:
src/routing/routing.service.ts,src/routing/routing.module.ts,src/intents/intents.types.ts(Route,RouteSteptype definitions),src/solvers/solvers.service.ts,src/tokens/tokens.service.ts.createDirectRoute()(keep it as a valid code path/fallback) rather than replacing it outright, since other in-flight issues may depend on its current signature.estimatedTime/estimatedGas/totalFeesUSDare no longer hardcoded placeholders.Definition of Done:
Resources:
src/routing/routing.service.ts,src/intents/intents.types.ts,src/solvers/solvers.service.ts,src/tokens/tokens.service.tsComplexity: High (200 points)