@@ -331,7 +331,7 @@ def _get_token_token_input_price(
331
331
return int (self ._get_token_eth_input_price (token0 ,qty ,fee ))
332
332
333
333
route = [token0 ,self .get_weth_address (),token1 ]
334
- logger .warning (f"No route specified, assuming route:{ route } " )
334
+ # logger.warning(f"No route specified, assuming route: {route}")
335
335
336
336
if self .version == 2 :
337
337
price :int = self .router .functions .getAmountsOut (qty ,route ).call ()[- 1 ]
@@ -418,7 +418,7 @@ def _get_token_token_output_price(
418
418
return int (self ._get_token_eth_output_price (token0 ,Wei (qty ),fee ))
419
419
420
420
route = [token0 ,self .get_weth_address (),token1 ]
421
- logger .warning (f"No route specified, assuming route:{ route } " )
421
+ # logger.warning(f"No route specified, assuming route: {route}")
422
422
423
423
if self .version == 2 :
424
424
price :int = self .router .functions .getAmountsIn (qty ,route ).call ()[0 ]
@@ -535,7 +535,7 @@ def simulate_trade(
535
535
fee_on_transfer :bool = False ,
536
536
)-> HexBytes :
537
537
quote_token_decimals = self .get_token (quote_token ).decimals
538
- exchange_rate = self .get_price_input (base_token ,quote_token , int ( 10 ** quote_token_decimals ) )
538
+ exchange_rate = self .get_raw_price (base_token ,quote_token )
539
539
amount_out = exchange_rate * qty * (10 ** quote_token_decimals )
540
540
fee = qty * self .get_fee_taker
541
541
@@ -1654,9 +1654,9 @@ def _deadline(self) -> int:
1654
1654
def _build_txn (
1655
1655
self ,function :ContractFunction ,tx_params :Optional [TxParams ]= None
1656
1656
)-> HexBytes :
1657
- """Build transaction."""
1658
1657
if not tx_params :
1659
1658
tx_params = self ._get_tx_params ()
1659
+ """Build transaction."""
1660
1660
transaction = function .build_transaction (tx_params )
1661
1661
1662
1662
if "gas" not in tx_params :
@@ -1688,11 +1688,13 @@ def _send_txn(
1688
1688
self .last_nonce = Nonce (tx_params ["nonce" ]+ 1 )
1689
1689
1690
1690
def _build_and_send_tx (
1691
- self ,transaction ,tx_params :Optional [TxParams ]= None
1691
+ self ,function : ContractFunction ,tx_params :Optional [TxParams ]= None
1692
1692
)-> HexBytes :
1693
+ if not tx_params :
1694
+ tx_params = self ._get_tx_params ()
1693
1695
"""Build and send a transaction."""
1694
1696
transaction = self ._build_txn (function ,tx_params )
1695
- return _send_txn (transaction ,tx_params )
1697
+ return self . _send_txn (transaction ,tx_params )
1696
1698
1697
1699
def _get_tx_params (
1698
1700
self ,value :Wei = Wei (0 ),gas :Optional [Wei ]= None