Skip to content

Commit

Permalink
Use 'int' instead of 'safe_int'
Browse files Browse the repository at this point in the history
  • Loading branch information
barak manos committed May 25, 2024
1 parent e832904 commit 6acc126
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions fastlane_bot/helpers/poolandtokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# from fastlane_bot.config import SUPPORTED_EXCHANGES, CARBON_V1_NAME, UNISWAP_V3_NAME
from fastlane_bot.helpers.univ3calc import Univ3Calculator
from fastlane_bot.tools.cpc import ConstantProductCurve
from fastlane_bot.utils import decodeOrder, safe_int
from fastlane_bot.utils import decodeOrder


class SolidlyV2StablePoolsNotSupported(Exception):
Expand Down Expand Up @@ -421,16 +421,16 @@ def _carbon_to_cpc_dict(self) -> Tuple[Dict, bool]:

encoded_orders = [
{
"y": safe_int(self.y_1),
"z": safe_int(self.z_1),
"A": safe_int(self.A_1),
"B": safe_int(self.B_1),
"y": int(self.y_1),
"z": int(self.z_1),
"A": int(self.A_1),
"B": int(self.B_1),
},
{
"y": safe_int(self.y_0),
"z": safe_int(self.z_0),
"A": safe_int(self.A_0),
"B": safe_int(self.B_0),
"y": int(self.y_0),
"z": int(self.z_0),
"A": int(self.A_0),
"B": int(self.B_0),
},
]

Expand Down
18 changes: 9 additions & 9 deletions fastlane_bot/helpers/routehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from fastlane_bot.helpers.tradeinstruction import TradeInstruction
from fastlane_bot.events.interface import Pool
from fastlane_bot.utils import tradeBySourceAmount, tradeByTargetAmount, safe_int
from fastlane_bot.utils import tradeBySourceAmount, tradeByTargetAmount
from fastlane_bot.config.constants import AGNI_V3_NAME, BUTTER_V3_NAME, CLEOPATRA_V3_NAME, PANCAKESWAP_V3_NAME, \
ETHEREUM, METAVAULT_V3_NAME

Expand Down Expand Up @@ -748,16 +748,16 @@ def _calc_carbon_output(

encoded_order = {
both_tokens[0]: {
'y': safe_int(curve.y_1),
'z': safe_int(curve.z_1),
'A': safe_int(curve.A_1),
'B': safe_int(curve.B_1),
'y': int(curve.y_1),
'z': int(curve.z_1),
'A': int(curve.A_1),
'B': int(curve.B_1),
},
both_tokens[1]: {
'y': safe_int(curve.y_0),
'z': safe_int(curve.z_0),
'A': safe_int(curve.A_0),
'B': safe_int(curve.B_0),
'y': int(curve.y_0),
'z': int(curve.z_0),
'A': int(curve.A_0),
'B': int(curve.B_0),
},
}[key_token]

Expand Down

0 comments on commit 6acc126

Please sign in to comment.