order exactout swap amounts correctly
This commit is contained in:
parent
920a901a66
commit
94b8aec4d9
|
@ -160,8 +160,10 @@ export const handleGetRoutes = async (
|
|||
routes: RouteInfo[]
|
||||
bestRoute: RouteInfo
|
||||
}[]
|
||||
).sort(
|
||||
(a, b) => Number(b.bestRoute.outAmount) - Number(a.bestRoute.outAmount)
|
||||
).sort((a, b) =>
|
||||
swapMode === 'ExactIn'
|
||||
? Number(b.bestRoute.outAmount) - Number(a.bestRoute.outAmount)
|
||||
: Number(a.bestRoute.inAmount) - Number(b.bestRoute.inAmount)
|
||||
)
|
||||
return {
|
||||
routes: sortedByBiggestOutAmount[0].routes,
|
||||
|
|
Loading…
Reference in New Issue