Skip to content

pathRouter.ts: Add fallback route when primary payment path is exhausted #699

Description

@Kingsman-99

Description

src/pathRouter.ts finds payment paths but returns an empty result when no path meets the minimum liquidity threshold. Adding a fallback that relaxes the threshold by a configurable percentage gives callers a viable (if more costly) route instead of a hard failure.

Acceptance Criteria

  • findPath(params) accepts a fallbackSlippagePct?: number option (default: none)
  • When no path meets the primary threshold, the router retries with threshold * (1 + fallbackSlippagePct/100)
  • The returned path, when from the fallback, includes a usedFallback: true flag
  • Unit tests pass

Context

  • Target file: src/pathRouter.ts
  • The fallback retry is a single retry; do not implement multi-level fallback chaining

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions