Skip to content

Commit d905640

Browse files
committed
fix(main.rs): use higher amount_out for lowest_slippage tiebreaker
When finding the pool with the lowest slippage, break ties by selecting the one with the higher amount_out (instead of lower).
1 parent a6ae8ac commit d905640

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ async fn simulate_once(
431431
.amounts_out
432432
.get(idx)
433433
.and_then(|a| a.parse::<u128>().ok())
434-
.unwrap_or(u128::MAX);
435-
(slip, amt)
434+
.unwrap_or(0); // If no amount out, treat as lowest
435+
(slip, std::cmp::Reverse(amt))
436436
})
437437
.expect("non-empty pool list");
438438

0 commit comments

Comments
 (0)