Skip to content

Commit

Permalink
fix(v1 swap): exact out swaps not working
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jul 27, 2020
1 parent e78b6d6 commit 6a311aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/data/V1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,16 @@ export function useV1Trade(
pairs = [inputPair, outputPair]
}

const route = inputCurrency && pairs && pairs.length > 0 && new Route(pairs, inputCurrency)
const route = inputCurrency && pairs && pairs.length > 0 && new Route(pairs, inputCurrency, outputCurrency)
let v1Trade: Trade | undefined
try {
v1Trade =
route && exactAmount
? new Trade(route, exactAmount, isExactIn ? TradeType.EXACT_INPUT : TradeType.EXACT_OUTPUT)
: undefined
} catch {}
} catch (error) {
console.error('Failed to create V1 trade', error)
}
return v1Trade
}

Expand Down

1 comment on commit 6a311aa

@vercel
Copy link

@vercel vercel bot commented on 6a311aa Jul 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.