fix a bug in v3 trade routing returning the wrong trade type for output trade
This commit is contained in:
parent
1f41587ba9
commit
e9a432b58e
@ -171,7 +171,7 @@ export function useBestV3TradeExactOut(
|
||||
state: isSyncing ? V3TradeState.SYNCING : V3TradeState.VALID,
|
||||
trade: Trade.createUncheckedTrade({
|
||||
route: bestRoute,
|
||||
tradeType: TradeType.EXACT_INPUT,
|
||||
tradeType: TradeType.EXACT_OUTPUT,
|
||||
inputAmount:
|
||||
currencyIn instanceof Token
|
||||
? new TokenAmount(currencyIn, amountIn.toString())
|
||||
|
@ -18,8 +18,7 @@ export function isTradeBetter(
|
||||
!currencyEquals(tradeA.inputAmount.currency, tradeB.inputAmount.currency) ||
|
||||
!currencyEquals(tradeB.outputAmount.currency, tradeB.outputAmount.currency)
|
||||
) {
|
||||
console.error('Comparing incomparable trades', tradeA, tradeB)
|
||||
return false
|
||||
throw new Error('Comparing incomparable trades')
|
||||
}
|
||||
|
||||
if (minimumDelta.equalTo(ZERO_PERCENT)) {
|
||||
|
Loading…
Reference in New Issue
Block a user