Skip to content

Commit

Permalink
swap currency interchange amount out/in fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaysngh-mudrex committed Feb 10, 2024
1 parent 00e9a11 commit 13220ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hooks/useBestV3Trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function useBestV3TradeExactIn(
return call
}
})
}, [routes, amountIn, address])
}, [routes, amountIn, address, currencyOut])

const approveSelector = useMemo(() => {
if (!amountIn) return
Expand Down Expand Up @@ -191,7 +191,7 @@ export function useBestV3TradeExactIn(

// const fetchResults = useFetchResults(account, blockNumber, callsArr)
const amountOutResults = useQuery({
queryKey: ['get_simulation', address, amountIn, nonce_results?.data],
queryKey: ['get_simulation', address, amountIn, nonce_results?.data, currencyOut?.symbol],
queryFn: async () => {
if (!address || !account || !approveSelector || !quoteExactInInputs || !connector || !nonce_results || !chainId)
return
Expand Down Expand Up @@ -434,7 +434,7 @@ export function useBestV3TradeExactOut(
return call
}
})
}, [routes && routes.length, amountOut])
}, [routes, amountOut, address, currencyIn])

const approveSelector = useMemo(() => {
if (!currencyIn) return
Expand Down Expand Up @@ -481,7 +481,7 @@ export function useBestV3TradeExactOut(
const signature: WeierstrassSignatureType = ec.starkCurve.sign(msgHash, privateKey)

const amountInResults = useQuery({
queryKey: ['get_simulation', address, amountOut, nonce_results?.data, chainId],
queryKey: ['get_simulation', address, amountOut, nonce_results?.data, chainId, currencyIn?.symbol],
queryFn: async () => {
if (!address || !account || !quoteExactOutInputs || !approveSelector || !connector || !nonce_results || !chainId)
return
Expand Down

0 comments on commit 13220ae

Please sign in to comment.