Remove trade errors about insufficient liquidity that only show up if there's a route (best trade will not return a trade if there is insufficient liquidity)

This commit is contained in:
Moody Salem 2020-05-13 13:24:55 -04:00
parent 31f72a541b
commit 38947fe760
No known key found for this signature in database
GPG Key ID: 8CB5CD10385138DB

@ -596,28 +596,6 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
setIsValid(false)
}
if (
parsedAmounts[Field.INPUT] &&
route &&
JSBI.greaterThan(parsedAmounts[Field.INPUT].raw, route.pairs[0].reserveOf(tokens[Field.INPUT]).raw)
) {
setTradeError('Insufficient Liquidity')
setIsValid(false)
}
if (
!ignoreOutput &&
parsedAmounts[Field.OUTPUT] &&
route &&
JSBI.greaterThan(
parsedAmounts[Field.OUTPUT].raw,
route.pairs[route.pairs.length - 1].reserveOf(tokens[Field.OUTPUT]).raw
)
) {
setTradeError('Insufficient Liquidity')
setIsValid(false)
}
if (
userBalances[Field.INPUT] &&
parsedAmounts[Field.INPUT] &&