diff --git a/.env.example b/.env.example index 5cb8f2b48..5f1f4a5ae 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,6 @@ export ETH_PRIVATE_KEY_BE_CAREFUL="0x123-USE-YOUR-OWN-PRIVATE-KEY-HERE" export WEB3_FANTOM="FANTOM-API-KEY-HERE" // "public" can be used in place of a paid API key export WEB3_MANTLE="MANTLE-API-KEY-HERE" export WEB3_LINEA="LINEA-API-KEY-HERE" // -export WEB3_SEI="SEI-API-KEY-HERE" // #******** For Development - not required to run bot ********# export ETHERSCAN_TOKEN="ONLY_REQUIRED_IN_DEV" diff --git a/fastlane_bot/bot.py b/fastlane_bot/bot.py index 31090b8c5..5fe5800d5 100644 --- a/fastlane_bot/bot.py +++ b/fastlane_bot/bot.py @@ -74,7 +74,6 @@ from .modes.pairwise_multi_pol import FindArbitrageMultiPairwisePol from .modes.pairwise_single import FindArbitrageSinglePairwise from .modes.triangle_multi import ArbitrageFinderTriangleMulti -from .modes.triangle_multi_complete import ArbitrageFinderTriangleMultiComplete from .modes.triangle_single import ArbitrageFinderTriangleSingle from .modes.triangle_bancor_v3_two_hop import ArbitrageFinderTriangleBancor3TwoHop from .utils import num_format @@ -110,7 +109,6 @@ class CarbonBot: "b3_two_hop": ArbitrageFinderTriangleBancor3TwoHop, "multi_pairwise_pol": FindArbitrageMultiPairwisePol, "multi_pairwise_all": FindArbitrageMultiPairwiseAll, - "multi_triangle_complete": ArbitrageFinderTriangleMultiComplete, } class NoArbAvailable(Exception): diff --git a/fastlane_bot/config/constants.py b/fastlane_bot/config/constants.py index ad855d546..787129492 100644 --- a/fastlane_bot/config/constants.py +++ b/fastlane_bot/config/constants.py @@ -45,5 +45,4 @@ "fantom": 5000, "mantle": 0, "linea": 0, - "sei": 0, } diff --git a/fastlane_bot/config/network.py b/fastlane_bot/config/network.py index e144ffdac..90ddc59cc 100644 --- a/fastlane_bot/config/network.py +++ b/fastlane_bot/config/network.py @@ -276,7 +276,6 @@ class ConfigNetwork(ConfigBase): NETWORK_FANTOM = S.NETWORK_FANTOM NETWORK_MANTLE = S.NETWORK_MANTLE NETWORK_LINEA = S.NETWORK_LINEA - NETWORK_SEI = S.NETWORK_SEI # FLAGS ####################################################################################### @@ -317,9 +316,7 @@ def new(cls, network=None): elif network == cls.NETWORK_MANTLE: return _ConfigNetworkMantle(_direct=False) elif network == cls.NETWORK_LINEA: - return _ConfigNetworkLinea(_direct=False) - elif network == cls.NETWORK_SEI: - return _ConfigNetworkSei(_direct=False) + return _ConfigNetworkLinea(_direct=False) elif network == cls.NETWORK_TENDERLY: return _ConfigNetworkTenderly(_direct=False) else: @@ -785,42 +782,6 @@ class _ConfigNetworkLinea(ConfigNetwork): # Add any exchanges unique to the chain here CHAIN_SPECIFIC_EXCHANGES = [] -class _ConfigNetworkSei(ConfigNetwork): - """ - Fastlane bot config -- network [Base Mainnet] - """ - - NETWORK = S.NETWORK_SEI - NETWORK_ID = "1" # TODO - NETWORK_NAME = "sei" - DEFAULT_PROVIDER = S.PROVIDER_ALCHEMY - RPC_ENDPOINT = "https://evm-rpc.arctic-1.seinetwork.io/" # TODO currently Sei devnet - WEB3_ALCHEMY_PROJECT_ID = os.environ.get("WEB3_SEI") - - network_df = get_multichain_addresses(network=NETWORK_NAME) - FASTLANE_CONTRACT_ADDRESS = "0xC7Dd38e64822108446872c5C2105308058c5C55C" #TODO - UPDATE WITH Mainnet - MULTICALL_CONTRACT_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11" - - CARBON_CONTROLLER_ADDRESS = "0x59f21012B2E9BA67ce6a7605E74F945D0D4C84EA" #TODO - UPDATE WITH Mainnet - CARBON_CONTROLLER_VOUCHER = "0xe4816658ad10bF215053C533cceAe3f59e1f1087" #TODO - UPDATE WITH Mainnet - - NATIVE_GAS_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" - WRAPPED_GAS_TOKEN_ADDRESS = "0x57eE725BEeB991c70c53f9642f36755EC6eb2139" # TODO confirm for Mainnet - NATIVE_GAS_TOKEN_SYMBOL = "SEI" - WRAPPED_GAS_TOKEN_SYMBOL = "WSEI" - STABLECOIN_ADDRESS = "0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C" #TODO USDC on devnet - - IS_INJECT_POA_MIDDLEWARE = False - # Balancer - BALANCER_VAULT_ADDRESS = "0x7ccBebeb88696f9c8b061f1112Bb970158e29cA5" # # TODO Jellyswap on devnet - - CHAIN_FLASHLOAN_TOKENS = { - "0x57eE725BEeB991c70c53f9642f36755EC6eb2139": "WSEI", #TODO confirm for Mainnet - "0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C": "USDC", #TODO confirm for Mainnet - } - # Add any exchanges unique to the chain here - CHAIN_SPECIFIC_EXCHANGES = [] - class _ConfigNetworkTenderly(ConfigNetwork): """ Fastlane bot config -- network [Ethereum Tenderly] diff --git a/fastlane_bot/config/selectors.py b/fastlane_bot/config/selectors.py index 791810fea..d910f52be 100644 --- a/fastlane_bot/config/selectors.py +++ b/fastlane_bot/config/selectors.py @@ -18,7 +18,6 @@ NETWORK_CANTO = "canto" NETWORK_FANTOM = "fantom" NETWORK_LINEA = "linea" -NETWORK_SEI = "sei" NETWORK_MANTLE = "mantle" NETWORK_SCROLL = "scroll" NETWORK_BSC = "binance_smart_chain" diff --git a/fastlane_bot/data/blockchain_data/sei/solidly_v2_event_mappings.csv b/fastlane_bot/data/blockchain_data/sei/solidly_v2_event_mappings.csv deleted file mode 100644 index 2785f2805..000000000 --- a/fastlane_bot/data/blockchain_data/sei/solidly_v2_event_mappings.csv +++ /dev/null @@ -1 +0,0 @@ -exchange,address diff --git a/fastlane_bot/data/blockchain_data/sei/static_pool_data.csv b/fastlane_bot/data/blockchain_data/sei/static_pool_data.csv deleted file mode 100644 index 54e89f03e..000000000 --- a/fastlane_bot/data/blockchain_data/sei/static_pool_data.csv +++ /dev/null @@ -1,4 +0,0 @@ -cid,strategy_id,last_updated,last_updated_block,descr,pair_name,exchange_name,fee,fee_float,address,anchor,tkn0_address,tkn1_address,tkn0_decimals,tkn1_decimals,exchange_id,tkn0_symbol,tkn1_symbol,timestamp,tkn0_balance,tkn1_balance,liquidity,sqrt_price_q96,tick,tick_spacing,exchange,pool_type,tkn0_weight,tkn1_weight,tkn2_address,tkn2_decimals,tkn2_symbol,tkn2_balance,tkn2_weight,tkn3_address,tkn3_decimals,tkn3_symbol,tkn3_balance,tkn3_weight,tkn4_address,tkn4_decimals,tkn4_symbol,tkn4_balance,tkn4_weight,tkn5_address,tkn5_decimals,tkn5_symbol,tkn5_balance,tkn5_weight,tkn6_address,tkn6_decimals,tkn6_symbol,tkn6_balance,tkn6_weight,tkn7_address,tkn7_decimals,tkn7_symbol,tkn7_balance,tkn7_weight -0x1422169ab760ea6994358267b7d3783e8e7fa55c6a74b365b3fd3d17cbf4c6f1,0,,2354,dragonswap 0x027D2E627209f1cebA52ADc8A5aFE9318459b44B/0x7b75109369ACb528d9fa989E227812a6589712b9,0x027D2E627209f1cebA52ADc8A5aFE9318459b44B/0x7b75109369ACb528d9fa989E227812a6589712b9,dragonswap,0.003,0.003,0x01A34Dfa104F020FEE739268679338169945D5B1,,0x027D2E627209f1cebA52ADc8A5aFE9318459b44B,0x7b75109369ACb528d9fa989E227812a6589712b9,18,18,3,WSEI,DSWAP,0,0,0,,,,,dragonswap,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -0xbfd9612b2cb8035908dff18c040f64de75999cefd1020b5ce8a2e533c2ecd5dc,0,,2354,dragonswap 0x027D2E627209f1cebA52ADc8A5aFE9318459b44B/0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C,0x027D2E627209f1cebA52ADc8A5aFE9318459b44B/0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C,dragonswap,0.003,0.003,0x85CB6BFd781e1f42f4E79Efb6bf1F1fEfE4E9732,,0x027D2E627209f1cebA52ADc8A5aFE9318459b44B,0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C,18,6,3,WSEI,USDC,0,0,0,,,,,dragonswap,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -0xe3aead757d877a15316e4896d5c5ab7639adbcba1ff76e3434b4e0af90f6225e,0,,2354,dragonswap 0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C/0xF983afa393199D6902a1Dd04f8E93465915ffD8B,0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C/0xF983afa393199D6902a1Dd04f8E93465915ffD8B,dragonswap,0.003,0.003,0x72A788B0A83e18ce1757171321E82c03e4351498,,0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C,0xF983afa393199D6902a1Dd04f8E93465915ffD8B,6,6,3,USDC,USDT,0,0,0,,,,,dragonswap,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/fastlane_bot/data/blockchain_data/sei/tokens.csv b/fastlane_bot/data/blockchain_data/sei/tokens.csv deleted file mode 100644 index e79bf6c3b..000000000 --- a/fastlane_bot/data/blockchain_data/sei/tokens.csv +++ /dev/null @@ -1,9 +0,0 @@ -address,decimals,symbol -0x26841a0A5D958B128209F4ea9a1DD7E61558c330,18,WSEI -0xace5f7Ea93439Af39b46d2748fA1aC19951c8d7C,6,USDC -0x027D2E627209f1cebA52ADc8A5aFE9318459b44B,18,WSEI -0x7b75109369ACb528d9fa989E227812a6589712b9,18,DSWAP -0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE,18,SEI -0x9e7A8e558Ce582511f4104465a886b7bEfBC146b,18,JLY -0x57eE725BEeB991c70c53f9642f36755EC6eb2139,18,WSEI -0xF983afa393199D6902a1Dd04f8E93465915ffD8B,6,USDT diff --git a/fastlane_bot/data/blockchain_data/sei/uniswap_v2_event_mappings.csv b/fastlane_bot/data/blockchain_data/sei/uniswap_v2_event_mappings.csv deleted file mode 100644 index c23f7b0da..000000000 --- a/fastlane_bot/data/blockchain_data/sei/uniswap_v2_event_mappings.csv +++ /dev/null @@ -1,5 +0,0 @@ -exchange,address -dragonswap,0x01A34Dfa104F020FEE739268679338169945D5B1 -dragonswap,0x85CB6BFd781e1f42f4E79Efb6bf1F1fEfE4E9732 -dragonswap,0x38BcEBb9A3fbF05B0Ab7ce9b485c9669578409fE -dragonswap,0x72A788B0A83e18ce1757171321E82c03e4351498 diff --git a/fastlane_bot/data/blockchain_data/sei/uniswap_v3_event_mappings.csv b/fastlane_bot/data/blockchain_data/sei/uniswap_v3_event_mappings.csv deleted file mode 100644 index 2785f2805..000000000 --- a/fastlane_bot/data/blockchain_data/sei/uniswap_v3_event_mappings.csv +++ /dev/null @@ -1 +0,0 @@ -exchange,address diff --git a/fastlane_bot/data/multichain_addresses.csv b/fastlane_bot/data/multichain_addresses.csv index 0650447ea..c1ba30702 100644 --- a/fastlane_bot/data/multichain_addresses.csv +++ b/fastlane_bot/data/multichain_addresses.csv @@ -135,7 +135,3 @@ sushiswap_v3,thundercore,uniswap_v3,0xc35DADB65012eC5796536bD9864eD8773aBc74C4,0 pancakeswap_v3,zkevm,uniswap_v3,0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865,0x1b81D678ffb9C0263b24A97847620C99d213eB14,,, pancakeswap_v3,zksync,uniswap_v3,0x1BB72E0CbbEA93c08f535fc7856E0338D7F7a8aB,0xD70C70AD87aa8D45b8D59600342FB3AEe76E3c68,,, xfai_v0,linea,solidly_v2,0xa5136eAd459F0E61C99Cec70fe8F5C24cF3ecA26,0xD538be6e9026C13D130C9e17d509E69C8Bb0eF33,,222864, -carbon_v1,sei,carbon_v1,0x59f21012B2E9BA67ce6a7605E74F945D0D4C84EA,0x59f21012B2E9BA67ce6a7605E74F945D0D4C84EA,,17658678, -dragonswap,sei,uniswap_v2,0x5D370a6189F89603FaB67e9C68383e63F7B6A262,0x2346d3A6fb18Ff3ae590Ea31d9e41E6AB8c9f5EB,0.003,1008775, -jellyswap,sei,balancer,BALANCER_VAULT_ADDRESS,0x7ccBebeb88696f9c8b061f1112Bb970158e29cA5,0,222832, -uniswap_v3,sei,uniswap_v3,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,,1, diff --git a/fastlane_bot/modes/triangle_multi_complete.py b/fastlane_bot/modes/triangle_multi_complete.py deleted file mode 100644 index d053ae0fc..000000000 --- a/fastlane_bot/modes/triangle_multi_complete.py +++ /dev/null @@ -1,83 +0,0 @@ -""" -Defines the Triangular arbitrage finder class - -[DOC-TODO-OPTIONAL-longer description in rst format] - ---- -(c) Copyright Bprotocol foundation 2023-24. -All rights reserved. -Licensed under MIT. -""" -from typing import List, Any, Tuple, Union - -from fastlane_bot.modes.base_triangle import ArbitrageFinderTriangleBase -from fastlane_bot.tools.cpc import CPCContainer -from fastlane_bot.tools.optimizer import MargPOptimizer - - -class ArbitrageFinderTriangleMultiComplete(ArbitrageFinderTriangleBase): - """ - Triangular arbitrage finder mode - """ - - arb_mode = "multi_triangle_complete" - - def find_arbitrage(self, candidates: List[Any] = None, ops: Tuple = None, best_profit: float = 0, profit_src: float = 0) -> Union[List, Tuple]: - """ - see base.py - """ - - if candidates is None: - candidates = [] - - combos = self.get_comprehensive_triangles(self.flashloan_tokens, self.CCm) - - for src_token, miniverse in combos: - try: - CC_cc = CPCContainer(miniverse) - O = MargPOptimizer(CC_cc) - pstart = self.build_pstart(CC_cc, CC_cc.tokens(), src_token) - r = O.optimize(src_token, params=dict(pstart=pstart)) - trade_instructions_dic = r.trade_instructions(O.TIF_DICTS) - if trade_instructions_dic is None or len(trade_instructions_dic) < 3: - # Failed to converge - continue - trade_instructions_df = r.trade_instructions(O.TIF_DFAGGR) - trade_instructions = r.trade_instructions() - - except Exception as e: - self.ConfigObj.logger.info(f"[triangle multi] {e}") - continue - profit_src = -r.result - - # Get the cids - cids = [ti["cid"] for ti in trade_instructions_dic] - - # Calculate the profit - profit = self.calculate_profit(src_token, profit_src, self.CCm, cids) - if str(profit) == "nan": - self.ConfigObj.logger.debug("profit is nan, skipping") - continue - - # Handle candidates based on conditions - candidates += self.handle_candidates( - best_profit, - profit, - trade_instructions_df, - trade_instructions_dic, - src_token, - trade_instructions, - ) - - # Find the best operations - best_profit, ops = self.find_best_operations( - best_profit, - ops, - profit, - trade_instructions_df, - trade_instructions_dic, - src_token, - trade_instructions, - ) - - return candidates if self.result == self.AO_CANDIDATES else ops diff --git a/main.py b/main.py index e335f3fa8..15f4b3d05 100644 --- a/main.py +++ b/main.py @@ -592,8 +592,7 @@ def run(mgr, args, tenderly_uri=None) -> None: "multi_triangle", "b3_two_hop", "multi_pairwise_pol", - "multi_pairwise_all", - "multi_triangle_complete" + "multi_pairwise_all" ], ) parser.add_argument( @@ -699,7 +698,7 @@ def run(mgr, args, tenderly_uri=None) -> None: "--blockchain", default="ethereum", help="A blockchain from the list. Blockchains not in this list do not have a deployed Fast Lane contract and are not supported.", - choices=["ethereum", "coinbase_base", "fantom", "mantle", "linea", "sei"], + choices=["ethereum", "coinbase_base", "fantom", "mantle", "linea"], ) parser.add_argument( "--pool_data_update_frequency", diff --git a/run_blockchain_terraformer.py b/run_blockchain_terraformer.py index df514dbee..8435d393b 100644 --- a/run_blockchain_terraformer.py +++ b/run_blockchain_terraformer.py @@ -48,7 +48,6 @@ async def gather(): FANTOM = "fantom" MANTLE = "mantle" LINEA = "linea" -SEI = "sei" coingecko_network_map = { "ethereum": "ethereum", @@ -67,7 +66,6 @@ async def gather(): "cosmos": "cosmos", "kava": "kava", "mantle": "mantle", - "sei": "sei", } BLOCK_CHUNK_SIZE_MAP = { @@ -80,7 +78,6 @@ async def gather(): "fantom": 5000, "mantle": 0, "linea": 0, - "sei": 0, } ALCHEMY_KEY_DICT = { @@ -93,7 +90,6 @@ async def gather(): "fantom": "WEB3_FANTOM", "mantle": "WEB3_MANTLE", "linea": "WEB3_LINEA", - "sei": "WEB3_SEI", } ALCHEMY_RPC_LIST = { @@ -106,7 +102,6 @@ async def gather(): "fantom": "https://fantom.blockpi.network/v1/rpc/", "mantle": "https://rpc.mantle.xyz/", "linea": "https://rpc.linea.build/", - "sei": "https://evm-rpc.arctic-1.seinetwork.io/", # TODO update with mainnet } BALANCER_SUBGRAPH_CHAIN_URL = { @@ -117,9 +112,7 @@ async def gather(): "optimism": "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-optimism-v2", "coinbase_base": "https://api.studio.thegraph.com/query/24660/balancer-base-v2/version/latest", "avalanche": "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-avalanche-v2", - "fantom": "https://api.thegraph.com/subgraphs/name/beethovenxfi/beethovenx", - "sei": "https://thegraph.dev.mvpworkshop.co/subgraphs/name/jelly" # TODO verify this for mainnet - + "fantom": "https://api.thegraph.com/subgraphs/name/beethovenxfi/beethovenx" } BANCOR_V2_NAME = "bancor_v2" @@ -1082,4 +1075,3 @@ def terraform_blockchain(network_name: str): #terraform_blockchain(network_name=FANTOM) #terraform_blockchain(network_name=MANTLE) #terraform_blockchain(network_name=LINEA) -#terraform_blockchain(network_name=SEI)