Skip to content

Commit

Permalink
fix: no routes for this trade (#480) (#484)
Browse files Browse the repository at this point in the history
* fix: no routes for this trade

* fix test cases

(cherry picked from commit f1b7756)

Co-authored-by: Calvin <[email protected]>
  • Loading branch information
mergify[bot] and cryptomatictrader authored Aug 28, 2024
1 parent 449d330 commit d0edfb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion router/usecase/candidate_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (c candidateRouteFinder) FindCandidateRoutes(tokenIn sdk.Coin, tokenOutDeno
rankedPools := denomData.SortedPools

if len(rankedPools) == 0 {
return sqsdomain.CandidateRoutes{}, nil
c.logger.Debug("no pools found for denom in candidate route search", zap.String("denom", currenTokenInDenom))
}

for i := 0; i < len(rankedPools) && len(routes) < options.MaxRoutes; i++ {
Expand Down
3 changes: 2 additions & 1 deletion tokens/usecase/pricing/worker/pricing_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ func (s *PricingWorkerTestSuite) TestGetPrices_Chain_FindUnsupportedTokens() {
// 1 more was found on June 10 when adding alloyed code id to config.
//
// On August 21, 2024: 23 unsupported tokens - likely added liquidity to some pools with the tokens.
s.Require().Equal(23, zeroPriceCounter)
// On August 27, 2024: 20 unsupported tokens - same reason as above.
s.Require().Equal(20, zeroPriceCounter)
}

func (s *PricingWorkerTestSuite) ValidatePrices(initialDenoms map[string]struct{}, expectedQuoteDenom string, prices map[string]map[string]osmomath.BigDec) {
Expand Down

0 comments on commit d0edfb0

Please sign in to comment.