diff --git a/uniswap/uniswap.py b/uniswap/uniswap.py index ccc5639a..c7d7e56f 100644 --- a/uniswap/uniswap.py +++ b/uniswap/uniswap.py @@ -284,6 +284,7 @@ def _get_token_token_input_price( logger.warning(f"No route specified, assuming route: {route}") if self.version == 2: + # BL: This is where route param gets called price: int = self.router.functions.getAmountsOut(qty, route).call()[-1] elif self.version == 3: if route: @@ -401,6 +402,7 @@ def make_trade( fee: int = None, slippage: float = None, fee_on_transfer: bool = False, + route: Optional[List[AddressLike]] = None, ) -> HexBytes: """Make a trade by defining the qty of the input token.""" if fee is None: @@ -431,6 +433,7 @@ def make_trade( fee, slippage, fee_on_transfer, + route=route ) @check_approval @@ -652,6 +655,7 @@ def _token_to_token_swap_input( fee: int, slippage: float, fee_on_transfer: bool = False, + route: Optional[List[AddressLike]] = None, ) -> HexBytes: """Convert tokens to tokens given an input amount.""" # Balance check @@ -690,7 +694,7 @@ def _token_to_token_swap_input( min_tokens_bought = int( (1 - slippage) * self._get_token_token_input_price( - input_token, output_token, qty, fee=fee + input_token, output_token, qty, fee=fee, route=route ) ) if fee_on_transfer: