Skip to content

Commit

Permalink
Merge pull request #231 from bancorprotocol/225-target-token-bug
Browse files Browse the repository at this point in the history
Add handling for instances where Stablecoin pool cannot be found for …
  • Loading branch information
NIXBNT authored Nov 28, 2023
2 parents a3db93b + 028180c commit 9f8bf80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fastlane_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,10 @@ def calculate_profit(
raise str(e)
else:
best_profit_eth = best_profit_fl_token

usd_eth_conversion_rate = Decimal(str(CCm.bypair(pair=f"{self.ConfigObj.WRAPPED_GAS_TOKEN_KEY}/{self.ConfigObj.STABLECOIN_KEY}")[0].p))
try:
usd_eth_conversion_rate = Decimal(str(CCm.bypair(pair=f"{self.ConfigObj.WRAPPED_GAS_TOKEN_KEY}/{self.ConfigObj.STABLECOIN_KEY}")[0].p))
except Exception:
usd_eth_conversion_rate = Decimal("NaN")
best_profit_usd = best_profit_eth * usd_eth_conversion_rate
return best_profit_fl_token, best_profit_eth, best_profit_usd

Expand Down

0 comments on commit 9f8bf80

Please sign in to comment.