Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBNT committed Nov 1, 2023
1 parent d1cefbe commit fd86be3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions fastlane_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ def calculate_profit(
The updated best_profit, flt_per_bnt, and profit_usd.
"""
best_profit_fl_token = best_profit
if fl_token_with_weth != self.ConfigObj.WRAPPED_GAS_TOKEN_KEY: # TODO generalize to native gas token
if fl_token_with_weth != self.ConfigObj.WRAPPED_GAS_TOKEN_KEY:
try:
fltkn_eth_conversion_rate = Decimal(str(CCm.bytknb(f"{self.ConfigObj.WRAPPED_GAS_TOKEN_KEY}").bytknq(f"{fl_token_with_weth}")[0].p))
best_profit_eth = best_profit_fl_token * fltkn_eth_conversion_rate
Expand All @@ -767,7 +767,7 @@ def calculate_profit(
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)) ## TODO dependency on USDC
usd_eth_conversion_rate = Decimal(str(CCm.bypair(pair=f"{self.ConfigObj.WRAPPED_GAS_TOKEN_KEY}/{self.ConfigObj.STABLECOIN_KEY}")[0].p))
best_profit_usd = best_profit_eth * usd_eth_conversion_rate
return best_profit_fl_token, best_profit_eth, best_profit_usd

Expand Down
9 changes: 0 additions & 9 deletions fastlane_bot/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
TENDERLY_FORK_ID = os.environ.get("TENDERLY_FORK_ID")
if TENDERLY_FORK_ID is None:
TENDERLY_FORK_ID = ''
# WEB3_ALCHEMY_PROJECT_ID = os.environ.get("WEB3_ALCHEMY_PROJECT_ID")

@dataclass
class Config():
Expand Down Expand Up @@ -49,14 +48,6 @@ class Config():
LL_ERR = S.LOGLEVEL_ERROR

SUPPORTED_EXCHANGES = ['carbon_v1', 'bancor_v2', 'bancor_v3', 'uniswap_v2', 'uniswap_v3', 'sushiswap_v2', 'bancor_pol', 'pancakeswap_v2', 'pancakeswap_v3']
# connection = EthereumNetwork(
# network_id=NETWORK_ID,
# network_name=NETWORK_NAME,
# provider_url=PROVIDER_URL,
# provider_name="alchemy",
# )
# connection.connect_network()
# w3 = connection.web3

@classmethod
def new(cls, *, config=None, loglevel=None, logging_path=None, blockchain=None, **kwargs):
Expand Down
7 changes: 2 additions & 5 deletions fastlane_bot/config/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,18 @@ class ConfigNetwork(ConfigBase):
#######################################################################################
BANCOR_V2_NAME = "bancor_v2"
BANCOR_V3_NAME = "bancor_v3"
CARBON_POL_NAME = "bancor_pol"
UNISWAP_V2_NAME = "uniswap_v2"
UNISWAP_V3_NAME = "uniswap_v3"
SUSHISWAP_V2_NAME = "sushiswap_v2"
SUSHISWAP_V3_NAME = "sushiswap_v3"
CARBON_V1_NAME = "carbon_v1"
BANCOR_POL_NAME = "bancor_pol"

BALANCER_NAME = "balancer"

PANCAKESWAP_V2_NAME = "pancakeswap_v2"
PANCAKESWAP_V3_NAME = "pancakeswap_v3"
SOLIDLY_V2_NAME = "solidly_v2"
SHIBA_V2_NAME = "shiba_v2"

# Base Exchanges
AERODROME_V2_NAME = "aerodrome_v2"
Expand All @@ -210,9 +210,6 @@ class ConfigNetwork(ConfigBase):
SYNTHSWAP_V3_NAME = "synthswap_v3"
SMARDEX_V2_NAME = "smardex_v2"
# SMARDEX_V3_NAME = "smardex_v3" # This uses Algebra DEX

CARBON_POL_NAME = "bancor_pol"
SHIBA_V2_NAME = "shiba_v2"
VELOCIMETER_V1_NAME = "velocimeter_v1"
VELOCIMETER_V2_NAME = "velocimeter_v2"

Expand Down

0 comments on commit fd86be3

Please sign in to comment.