diff --git a/CHANGELOG.md b/CHANGELOG.md index b5f2adbb6..7165ba17b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,26 @@ ## [Unreleased](https://github.com/bancorprotocol/fastlane-bot/tree/HEAD) -[Full Changelog](https://github.com/bancorprotocol/fastlane-bot/compare/v2.7.51...HEAD) +[Full Changelog](https://github.com/bancorprotocol/fastlane-bot/compare/v2.7.52...HEAD) -- Several bugs - static pool csv and validator [\#171](https://github.com/bancorprotocol/fastlane-bot/issues/171) +- zero liquidity pool filters Carbon Orders where y0 is 0 but y1 isn't [\#176](https://github.com/bancorprotocol/fastlane-bot/issues/176) - Add the ability to get all pools [\#174](https://github.com/bancorprotocol/fastlane-bot/issues/174) + +Closed issues + +- unsupported operand type\(s\) for -: 'float' and 'decimal.Decimal' [\#180](https://github.com/bancorprotocol/fastlane-bot/issues/180) + +Merged pull requests + +- Fix a bug that filtered Carbon Strategies with an empty order 0 [\#177](https://github.com/bancorprotocol/fastlane-bot/pull/177) ([Lesigh-3100](https://github.com/Lesigh-3100)) + +## [v2.7.52](https://github.com/bancorprotocol/fastlane-bot/tree/v2.7.52) (2023-10-25) + +[Full Changelog](https://github.com/bancorprotocol/fastlane-bot/compare/v2.7.51...v2.7.52) + +- Several bugs - static pool csv and validator [\#171](https://github.com/bancorprotocol/fastlane-bot/issues/171) + - Create terraformer [\#175](https://github.com/bancorprotocol/fastlane-bot/pull/175) ([Lesigh-3100](https://github.com/Lesigh-3100)) ## [v2.7.51](https://github.com/bancorprotocol/fastlane-bot/tree/v2.7.51) (2023-10-25) diff --git a/fastlane_bot/__init__.py b/fastlane_bot/__init__.py index 082fbf035..99271d35b 100644 --- a/fastlane_bot/__init__.py +++ b/fastlane_bot/__init__.py @@ -1,7 +1,7 @@ from .bot import CarbonBot as Bot, __VERSION__, __DATE__ from .config import Config, ConfigNetwork, ConfigDB, ConfigLogger, ConfigProvider -__version__ = '2.7.52' +__version__ = '2.7.53' diff --git a/fastlane_bot/events/interface.py b/fastlane_bot/events/interface.py index 36b00c717..eaffd348c 100644 --- a/fastlane_bot/events/interface.py +++ b/fastlane_bot/events/interface.py @@ -102,7 +102,7 @@ def remove_unsupported_exchanges(self) -> None: pools = self.filter_pools(exchange_name) self.log_pool_numbers(pools, exchange_name) - def has_balance(self, pool: Dict[str, Any], key: str) -> bool: + def has_balance(self, pool: Dict[str, Any], keys: List[str]) -> bool: """ Check if a pool has a balance for a given key @@ -110,8 +110,8 @@ def has_balance(self, pool: Dict[str, Any], key: str) -> bool: ---------- pool: Dict[str, Any] The pool to check - key: str - The key to check for a balance + keys: List[str] + The keys to check for a balance Returns ------- @@ -119,7 +119,12 @@ def has_balance(self, pool: Dict[str, Any], key: str) -> bool: True if the pool has a balance for the given key, False otherwise """ - return key in pool and pool[key] > 0 + + for key in keys: + if key in pool and pool[key] > 0: + return True + return False + def get_tokens_from_exchange(self, exchange_name: str) -> List[str]: """ @@ -148,7 +153,7 @@ def get_tokens_from_exchange(self, exchange_name: str) -> List[str]: tokens = list(set(tokens)) return tokens - def filter_pools(self, exchange_name: str, key: str = "") -> List[Dict[str, Any]]: + def filter_pools(self, exchange_name: str, keys: List[str] = "") -> List[Dict[str, Any]]: """ Filter pools by exchange name and key @@ -156,7 +161,7 @@ def filter_pools(self, exchange_name: str, key: str = "") -> List[Dict[str, Any] ---------- exchange_name: str The exchange name to filter by - key: str + keys: str The key to filter by Returns @@ -164,12 +169,12 @@ def filter_pools(self, exchange_name: str, key: str = "") -> List[Dict[str, Any] List[Dict[str, Any]] The filtered pools """ - if key: + if keys: return [ pool for pool in self.state if pool["exchange_name"] == exchange_name - and self.has_balance(pool, key) + and self.has_balance(pool, keys) ] else: return [ @@ -209,16 +214,16 @@ def remove_zero_liquidity_pools(self) -> None: "balancer", ] keys = [ - "liquidity", - "tkn0_balance", - "tkn0_balance", - "tkn0_balance", - "tkn0_balance", - "y_0", - "y_0", - "tkn0_balance", - "liquidity", - "tkn0_balance", + ["liquidity"], + ["tkn0_balance"], + ["tkn0_balance"], + ["tkn0_balance"], + ["tkn0_balance"], + ["y_0"], + ["y_0", "y_1"], + ["tkn0_balance"], + ["liquidity"], + ["tkn0_balance"], ] self.state = [ diff --git a/fastlane_bot/helpers/poolandtokens.py b/fastlane_bot/helpers/poolandtokens.py index 8d241a76a..56ba63d05 100644 --- a/fastlane_bot/helpers/poolandtokens.py +++ b/fastlane_bot/helpers/poolandtokens.py @@ -331,7 +331,8 @@ def _carbon_to_cpc(self) -> ConstantProductCurve: B = Decimal(self.B_1) if i == 0 else Decimal(self.B_0) y = Decimal(self.y_1) if i == 0 else Decimal(self.y_0) z = yint = Decimal(self.z_1) if i == 0 else Decimal(self.z_0) - + if y <= 0: + continue encoded_order = EncodedOrder( **{ "token": self.pair_name.split("/")[i].replace( diff --git a/fastlane_bot/modes/base_triangle.py b/fastlane_bot/modes/base_triangle.py index 8c33fc4a0..d0a05da9c 100644 --- a/fastlane_bot/modes/base_triangle.py +++ b/fastlane_bot/modes/base_triangle.py @@ -122,6 +122,13 @@ def get_combos( .byparams(exchange=self.base_exchange) .curves ) + if len(base_exchange_curves) == 0: + continue + + base_direction_pair = base_exchange_curves[0].pair + base_direction_one = [curve for curve in base_exchange_curves if curve.pair == base_direction_pair] + base_direction_two = [curve for curve in base_exchange_curves if curve.pair != base_direction_pair] + assert len(base_exchange_curves) == len(base_direction_one) + len(base_direction_two) y_match_curves = CCm.bypairs( set(CCm.filter_pairs(onein=target_tknx)) & set(CCm.filter_pairs(onein=flt)) @@ -130,24 +137,39 @@ def get_combos( set(CCm.filter_pairs(onein=target_tkny)) & set(CCm.filter_pairs(onein=flt)) ) + y_match_curves_not_carbon = [ x for x in y_match_curves if x.params.exchange != self.base_exchange ] + if len(y_match_curves_not_carbon) == 0: + continue x_match_curves_not_carbon = [ x for x in x_match_curves if x.params.exchange != self.base_exchange ] - combos = self.get_miniverse( - y_match_curves_not_carbon, - base_exchange_curves, - x_match_curves_not_carbon, - flt, - arb_mode, - combos, - ) + if len(x_match_curves_not_carbon) == 0: + continue + if len(base_direction_one) > 0: + combos = self.get_miniverse( + y_match_curves_not_carbon, + base_direction_one, + x_match_curves_not_carbon, + flt, + arb_mode, + combos, + ) + if len(base_direction_two) > 0: + combos = self.get_miniverse( + y_match_curves_not_carbon, + base_direction_two, + x_match_curves_not_carbon, + flt, + arb_mode, + combos, + ) return combos @staticmethod diff --git a/fastlane_bot/modes/triangle_multi.py b/fastlane_bot/modes/triangle_multi.py index 3aeb0ec38..4ec34513a 100644 --- a/fastlane_bot/modes/triangle_multi.py +++ b/fastlane_bot/modes/triangle_multi.py @@ -39,62 +39,31 @@ def find_arbitrage(self, candidates: List[Any] = None, ops: Tuple = None, best_p r = None CC_cc = CPCContainer(miniverse) O = MargPOptimizer(CC_cc) - try: - r = O.margp_optimizer(src_token) - trade_instructions_df = r.trade_instructions(O.TIF_DFAGGR) - trade_instructions_dic = r.trade_instructions(O.TIF_DICTS) - trade_instructions = r.trade_instructions() - """ - The following handles an edge case until parallel execution is available: - 1 Determine correct direction - opposite of non-Carbon pool - 2 Get cids of wrong-direction Carbon pools - 3 Create new CPCContainer with correct pools - 4 Rerun optimizer - 5 Resume normal flow - """ - non_carbon_cids = [ - curve.cid - for curve in miniverse - if curve.params.get("exchange") != "carbon_v1" - ] - non_carbon_row = trade_instructions_df.loc[non_carbon_cids[0]] - tkn0_into_carbon = non_carbon_row[0] < 0 - wrong_direction_cids = [ - idx - for idx, row in trade_instructions_df.iterrows() - if ( - (tkn0_into_carbon and row[0] < 0) - or (not tkn0_into_carbon and row[0] > 0) - ) - and ("-0" in idx or "-1" in idx) - ] - if non_carbon_cids and len(wrong_direction_cids) > 0: - self.ConfigObj.logger.debug( - f"\n\nRemoving wrong direction pools & rerunning optimizer\ntrade_instructions_df before: {trade_instructions_df.to_string()}" - ) - new_curves = [ - curve - for curve in miniverse - if curve.cid not in wrong_direction_cids - ] - - # Rerun main flow with the new set of curves - CC_cc = CPCContainer(new_curves) - O = MargPOptimizer(CC_cc) - r = O.margp_optimizer(src_token) - profit_src = -r.result - trade_instructions_df = r.trade_instructions(O.TIF_DFAGGR) - trade_instructions_dic = r.trade_instructions(O.TIF_DICTS) - trade_instructions = r.trade_instructions() - except Exception as e: + #try: + r = O.margp_optimizer(src_token) + trade_instructions_dic = r.trade_instructions(O.TIF_DICTS) + if len(trade_instructions_dic) < 3: + # Failed to converge continue + trade_instructions_df = r.trade_instructions(O.TIF_DFAGGR) + #print(trade_instructions_df) + trade_instructions = r.trade_instructions() + """ + The following handles an edge case until parallel execution is available: + 1 Determine correct direction - opposite of non-Carbon pool + 2 Get cids of wrong-direction Carbon pools + 3 Create new CPCContainer with correct pools + 4 Rerun optimizer + 5 Resume normal flow + """ + + 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 diff --git a/resources/NBTest/NBTest_034_Interface.ipynb b/resources/NBTest/NBTest_034_Interface.ipynb index 0f42b7534..f0ae924a3 100644 --- a/resources/NBTest/NBTest_034_Interface.ipynb +++ b/resources/NBTest/NBTest_034_Interface.ipynb @@ -15,13 +15,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "ConstantProductCurve v2.14 (23/May/2023)\n", + "ConstantProductCurve v3.3.1 (05/Oct/2023)\n", "CarbonBot v3-b2.2 (20/June/2023)\n", - "UniswapV2 v0.0.1 (2023-07-03)\n", - "UniswapV3 v0.0.1 (2023-07-03)\n", - "SushiswapV2 v0.0.1 (2023-07-03)\n", - "CarbonV1 v0.0.1 (2023-07-03)\n", - "BancorV3 v0.0.1 (2023-07-03)\n", + "UniswapV2 v0.0.2 (2023-08-27)\n", + "UniswapV3 v0.0.2 (2023-08-27)\n", + "SushiswapV2 v0.0.2 (2023-08-27)\n", + "CarbonV1 v0.0.2 (2023-08-27)\n", + "BancorV3 v0.0.2 (2023-08-27)\n", "QueryInterface v0.0.1 (2023-07-03)\n", "Token v0.0.1 (2023-07-03)\n", "imported m, np, pd, plt, os, sys, decimal; defined iseq, raises, require\n", @@ -123,8 +123,8 @@ "outputs": [], "source": [ "qi.state = [{'exchange_name': 'uniswap_v2', 'address': '0x123', 'tkn0_key': 'TKN-0x123', 'tkn1_key': 'TKN-0x456', 'pair_name': 'Pair-0x789', 'liquidity': 10}, {'exchange_name': 'sushiswap_v2', 'address': '0xabc', 'tkn0_key': 'TKN-0xabc', 'tkn1_key': 'TKN-0xdef', 'pair_name': 'Pair-0xghi', 'liquidity': 0}]\n", - "assert (qi.has_balance(qi.state[0], 'liquidity') == True)\n", - "assert (qi.has_balance(qi.state[1], 'liquidity') == False)" + "assert (qi.has_balance(qi.state[0], ['liquidity']) == True)\n", + "assert (qi.has_balance(qi.state[1], ['liquidity']) == False)" ] }, { @@ -268,7 +268,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.10.1" } }, "nbformat": 4, diff --git a/resources/NBTest/NBTest_034_Interface.py b/resources/NBTest/NBTest_034_Interface.py index 972970ca0..b62f8a1e1 100644 --- a/resources/NBTest/NBTest_034_Interface.py +++ b/resources/NBTest/NBTest_034_Interface.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.15.2 +# jupytext_version: 1.14.5 # kernelspec: # display_name: Python 3 # language: python @@ -57,8 +57,8 @@ # ## test_has_balance qi.state = [{'exchange_name': 'uniswap_v2', 'address': '0x123', 'tkn0_key': 'TKN-0x123', 'tkn1_key': 'TKN-0x456', 'pair_name': 'Pair-0x789', 'liquidity': 10}, {'exchange_name': 'sushiswap_v2', 'address': '0xabc', 'tkn0_key': 'TKN-0xabc', 'tkn1_key': 'TKN-0xdef', 'pair_name': 'Pair-0xghi', 'liquidity': 0}] -assert (qi.has_balance(qi.state[0], 'liquidity') == True) -assert (qi.has_balance(qi.state[1], 'liquidity') == False) +assert (qi.has_balance(qi.state[0], ['liquidity']) == True) +assert (qi.has_balance(qi.state[1], ['liquidity']) == False) # ## test_filter_pools diff --git a/resources/NBTest/NBTest_038_TestBancorV3Mode.ipynb b/resources/NBTest/NBTest_038_TestBancorV3Mode.ipynb index 15f3670a3..ecee7aef2 100644 --- a/resources/NBTest/NBTest_038_TestBancorV3Mode.ipynb +++ b/resources/NBTest/NBTest_038_TestBancorV3Mode.ipynb @@ -567,7 +567,7 @@ "\n", "combos = finder.get_combos(flashloan_tokens=flt, CCm=CCm, arb_mode=\"bancor_v3\")\n", "all_miniverses = finder.get_miniverse_combos(combos)\n", - "assert len(all_miniverses) == 144, f\"[test_bancor_v3] Different data used for tests, expected 144 miniverses, got {len(all_miniverses)}\"" + "assert len(all_miniverses) >= 146, f\"[test_bancor_v3] Different data used for tests, expected 146 miniverses, found {len(all_miniverses)}\"" ] }, { diff --git a/resources/NBTest/NBTest_038_TestBancorV3Mode.py b/resources/NBTest/NBTest_038_TestBancorV3Mode.py index 114353c2d..179883451 100644 --- a/resources/NBTest/NBTest_038_TestBancorV3Mode.py +++ b/resources/NBTest/NBTest_038_TestBancorV3Mode.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.15.2 +# jupytext_version: 1.14.5 # kernelspec: # display_name: Python 3 # language: python @@ -307,7 +307,7 @@ def init_bot(mgr: Manager) -> CarbonBot: combos = finder.get_combos(flashloan_tokens=flt, CCm=CCm, arb_mode="bancor_v3") all_miniverses = finder.get_miniverse_combos(combos) -assert len(all_miniverses) == 144, f"[test_bancor_v3] Different data used for tests, expected 144 miniverses, got {len(all_miniverses)}" +assert len(all_miniverses) >= 146, f"[test_bancor_v3] Different data used for tests, expected 146 miniverses, found {len(all_miniverses)}" # - # ## Test_get_mono_direction_carbon_curves diff --git a/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.ipynb b/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.ipynb index fe6f54bf5..f107bcec5 100644 --- a/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.ipynb +++ b/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.ipynb @@ -15,7 +15,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "ConstantProductCurve v3.2 (15/Sep/2023)\n", + "ConstantProductCurve v3.3.1 (05/Oct/2023)\n", "CarbonBot v3-b2.2 (20/June/2023)\n", "UniswapV2 v0.0.2 (2023-08-27)\n", "UniswapV3 v0.0.2 (2023-08-27)\n", @@ -79,40 +79,45 @@ "name": "stderr", "output_type": "stream", "text": [ - "2023-09-21 00:47:22,201 [fastlane:INFO] - \n", - "2023-09-21 00:47:22,201 [fastlane:INFO] - **********************************************\n", - "2023-09-21 00:47:22,202 [fastlane:INFO] - The logging path is set to: logs/20230921-004722\\bot.log\n", - "2023-09-21 00:47:22,202 [fastlane:INFO] - **********************************************\n", - "2023-09-21 00:47:22,202 [fastlane:INFO] - \n", - "2023-09-21 00:47:24,900 [fastlane:INFO] - Retrieved 169 carbon pairs from contract\n", - "2023-09-21 00:47:26,590 [fastlane:INFO] - Time taken to add initial pools: 0.15189027786254883\n", - "2023-09-21 00:47:26,593 [fastlane:INFO] - Initializing the bot...\n", - "2023-09-21 00:47:26,774 [fastlane:INFO] - Removed 3242 unmapped uniswap_v2/sushi pools. 1897 uniswap_v2/sushi pools remaining\n", - "2023-09-21 00:47:26,775 [fastlane:INFO] - Unmapped uniswap_v2/sushi pools:\n", - "2023-09-21 00:47:26,931 [fastlane:INFO] - uniswap_v3: 0\n", - "2023-09-21 00:47:26,933 [fastlane:INFO] - uniswap_v2: 3242\n", - "2023-09-21 00:47:26,934 [fastlane:INFO] - sushiswap_v2: 0\n", - "2023-09-21 00:47:26,935 [fastlane:INFO] - uniswap_v3: 636\n", - "2023-09-21 00:47:26,936 [fastlane:INFO] - sushiswap_v2: 78\n", - "2023-09-21 00:47:26,936 [fastlane:INFO] - uniswap_v2: 0\n", - "2023-09-21 00:47:26,937 [fastlane:INFO] - bancor_v2: 0\n", - "2023-09-21 00:47:26,938 [fastlane:INFO] - bancor_v3: 34\n", - "2023-09-21 00:47:26,938 [fastlane:INFO] - bancor_pol: 0\n", - "2023-09-21 00:47:26,939 [fastlane:INFO] - carbon_v1: 119\n", - "2023-09-21 00:47:26,962 [fastlane:INFO] - uniswap_v3_zero_liquidity_pools: 858\n", - "2023-09-21 00:47:26,963 [fastlane:INFO] - sushiswap_v2_zero_liquidity_pools: 34\n", - "2023-09-21 00:47:26,964 [fastlane:INFO] - uniswap_v2_zero_liquidity_pools: 0\n", - "2023-09-21 00:47:26,965 [fastlane:INFO] - bancor_v2_zero_liquidity_pools: 0\n", - "2023-09-21 00:47:26,966 [fastlane:INFO] - bancor_v3_zero_liquidity_pools: 37\n", - "2023-09-21 00:47:26,966 [fastlane:INFO] - bancor_pol_zero_liquidity_pools: 0\n", - "2023-09-21 00:47:26,967 [fastlane:INFO] - carbon_v1_zero_liquidity_pools: 101\n", - "2023-09-21 00:47:26,968 [fastlane:INFO] - Removed 0 unsupported exchanges. 867 pools remaining\n", - "2023-09-21 00:47:26,968 [fastlane:INFO] - Pools remaining per exchange:\n", - "2023-09-21 00:47:26,969 [fastlane:INFO] - carbon_v1: 119\n", - "2023-09-21 00:47:26,970 [fastlane:INFO] - uniswap_v3: 636\n", - "2023-09-21 00:47:26,971 [fastlane:INFO] - sushiswap_v2: 78\n", - "2023-09-21 00:47:26,972 [fastlane:INFO] - uniswap_v2: 0\n", - "2023-09-21 00:47:26,973 [fastlane:INFO] - bancor_v3: 34\n" + "2023-10-26 16:57:45,330 [fastlane:INFO] - \n", + "2023-10-26 16:57:45,330 [fastlane:INFO] - **********************************************\n", + "2023-10-26 16:57:45,331 [fastlane:INFO] - The logging path is set to: logs/20231026-165745\\bot.log\n", + "2023-10-26 16:57:45,331 [fastlane:INFO] - **********************************************\n", + "2023-10-26 16:57:45,331 [fastlane:INFO] - \n", + "2023-10-26 16:57:47,208 [fastlane:INFO] - Retrieved 200 carbon pairs from contract\n", + "2023-10-26 16:57:48,840 [fastlane:INFO] - Time taken to add initial pools: 0.09309983253479004\n", + "2023-10-26 16:57:48,843 [fastlane:INFO] - Initializing the bot...\n", + "2023-10-26 16:57:49,046 [fastlane:INFO] - Removed 3242 unmapped uniswap_v2/sushi pools. 1897 uniswap_v2/sushi pools remaining\n", + "2023-10-26 16:57:49,047 [fastlane:INFO] - Unmapped uniswap_v2/sushi pools:\n", + "2023-10-26 16:57:49,205 [fastlane:INFO] - uniswap_v2: 3242\n", + "2023-10-26 16:57:49,205 [fastlane:INFO] - sushiswap_v2: 0\n", + "2023-10-26 16:57:49,209 [fastlane:INFO] - uniswap_v3: 636\n", + "2023-10-26 16:57:49,210 [fastlane:INFO] - sushiswap_v2: 78\n", + "2023-10-26 16:57:49,210 [fastlane:INFO] - uniswap_v2: 0\n", + "2023-10-26 16:57:49,210 [fastlane:INFO] - bancor_v2: 0\n", + "2023-10-26 16:57:49,210 [fastlane:INFO] - bancor_v3: 34\n", + "2023-10-26 16:57:49,211 [fastlane:INFO] - bancor_pol: 0\n", + "2023-10-26 16:57:49,212 [fastlane:INFO] - carbon_v1: 144\n", + "2023-10-26 16:57:49,212 [fastlane:INFO] - pancakeswap_v2: 0\n", + "2023-10-26 16:57:49,212 [fastlane:INFO] - pancakeswap_v3: 0\n", + "2023-10-26 16:57:49,213 [fastlane:INFO] - balancer: 0\n", + "2023-10-26 16:57:49,235 [fastlane:INFO] - uniswap_v3_zero_liquidity_pools: 858\n", + "2023-10-26 16:57:49,236 [fastlane:INFO] - sushiswap_v2_zero_liquidity_pools: 34\n", + "2023-10-26 16:57:49,236 [fastlane:INFO] - uniswap_v2_zero_liquidity_pools: 0\n", + "2023-10-26 16:57:49,237 [fastlane:INFO] - bancor_v2_zero_liquidity_pools: 0\n", + "2023-10-26 16:57:49,237 [fastlane:INFO] - bancor_v3_zero_liquidity_pools: 37\n", + "2023-10-26 16:57:49,238 [fastlane:INFO] - bancor_pol_zero_liquidity_pools: 0\n", + "2023-10-26 16:57:49,238 [fastlane:INFO] - carbon_v1_zero_liquidity_pools: 76\n", + "2023-10-26 16:57:49,239 [fastlane:INFO] - pancakeswap_v2_zero_liquidity_pools: 0\n", + "2023-10-26 16:57:49,239 [fastlane:INFO] - pancakeswap_v3_zero_liquidity_pools: 0\n", + "2023-10-26 16:57:49,240 [fastlane:INFO] - balancer_zero_liquidity_pools: 0\n", + "2023-10-26 16:57:49,241 [fastlane:INFO] - Removed 0 unsupported exchanges. 892 pools remaining\n", + "2023-10-26 16:57:49,241 [fastlane:INFO] - Pools remaining per exchange:\n", + "2023-10-26 16:57:49,242 [fastlane:INFO] - uniswap_v3: 636\n", + "2023-10-26 16:57:49,242 [fastlane:INFO] - uniswap_v2: 0\n", + "2023-10-26 16:57:49,242 [fastlane:INFO] - carbon_v1: 144\n", + "2023-10-26 16:57:49,243 [fastlane:INFO] - bancor_v3: 34\n", + "2023-10-26 16:57:49,244 [fastlane:INFO] - sushiswap_v2: 78\n" ] } ], @@ -281,9 +286,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "2023-09-21 00:47:27,082 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", - "2023-09-21 00:47:27,083 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", - "2023-09-21 00:47:27,084 [fastlane:INFO] - limiting flashloan_tokens to ['USDT-1ec7', 'DAI-1d0F', 'WETH-6Cc2', 'WBTC-C599', 'USDC-eB48']\n" + "2023-10-26 16:57:49,358 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", + "2023-10-26 16:57:49,359 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", + "2023-10-26 16:57:49,359 [fastlane:INFO] - limiting flashloan_tokens to ['WETH-6Cc2', 'USDC-eB48', 'DAI-1d0F', 'WBTC-C599', 'USDT-1ec7']\n" ] } ], @@ -356,9 +361,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "2023-09-21 00:47:27,411 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", - "2023-09-21 00:47:27,412 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", - "2023-09-21 00:47:27,413 [fastlane:INFO] - limiting flashloan_tokens to ['USDT-1ec7', 'DAI-1d0F', 'WETH-6Cc2', 'WBTC-C599', 'USDC-eB48']\n" + "2023-10-26 16:57:49,773 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", + "2023-10-26 16:57:49,773 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", + "2023-10-26 16:57:49,774 [fastlane:INFO] - limiting flashloan_tokens to ['WETH-6Cc2', 'USDC-eB48', 'DAI-1d0F', 'WBTC-C599', 'USDT-1ec7']\n" ] } ], @@ -421,9 +426,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "2023-09-21 00:47:27,708 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", - "2023-09-21 00:47:27,710 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", - "2023-09-21 00:47:27,711 [fastlane:INFO] - limiting flashloan_tokens to ['USDT-1ec7', 'DAI-1d0F', 'WETH-6Cc2', 'WBTC-C599', 'USDC-eB48']\n" + "2023-10-26 16:57:50,068 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", + "2023-10-26 16:57:50,068 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", + "2023-10-26 16:57:50,069 [fastlane:INFO] - limiting flashloan_tokens to ['WETH-6Cc2', 'USDC-eB48', 'DAI-1d0F', 'WBTC-C599', 'USDT-1ec7']\n" ] } ], @@ -494,9 +499,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "2023-09-21 00:47:28,002 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", - "2023-09-21 00:47:28,003 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", - "2023-09-21 00:47:28,004 [fastlane:INFO] - limiting flashloan_tokens to ['USDT-1ec7', 'DAI-1d0F', 'WETH-6Cc2', 'WBTC-C599', 'USDC-eB48']\n" + "2023-10-26 16:57:50,358 [fastlane:WARNING] - base_exchange must be bancor_v3 for b3_two_hop, setting it to bancor_v3\n", + "2023-10-26 16:57:50,358 [fastlane:INFO] - flashloan_tokens for arb_mode=b3_two_hop will be overwritten. \n", + "2023-10-26 16:57:50,359 [fastlane:INFO] - limiting flashloan_tokens to ['WETH-6Cc2', 'USDC-eB48', 'DAI-1d0F', 'WBTC-C599', 'USDT-1ec7']\n" ] } ], @@ -586,7 +591,7 @@ "flt = {'MKR-79A2', 'TRAC-0A6F', 'MONA-412A', 'WBTC-C599', 'WOO-5D4B', 'MATIC-eBB0', 'BAT-87EF', 'UOS-5C8c', 'LRC-EafD', 'NMR-6671', 'DIP-cD83', 'TEMP-1aB9', 'ICHI-A881', 'USDC-eB48', 'ENS-9D72', 'vBNT-7f94', 'ANKR-EDD4', 'UNI-F984', 'REQ-938a', 'WETH-6Cc2', 'AAVE-DaE9', 'ENJ-3B9c', 'MANA-C942', 'wNXM-2bDE', 'QNT-4675', 'RLC-7375', 'CROWN-E0fa', 'CHZ-b4AF', 'USDT-1ec7', 'DAI-1d0F', 'RPL-A51f', 'HOT-26E2', 'LINK-86CA', 'wstETH-2Ca0'}\n", "combos = finder.get_combos(flashloan_tokens=flt, CCm=CCm, arb_mode=\"b3_two_hop\")\n", "all_miniverses = finder.get_miniverse_combos(combos)\n", - "assert len(all_miniverses) == 144, f\"[test_bancor_v3_two_hop] Different data used for tests, expected 146 miniverses, found {len(all_miniverses)}\"" + "assert len(all_miniverses) >= 146, f\"[test_bancor_v3_two_hop] Different data used for tests, expected 146 miniverses, found {len(all_miniverses)}\"" ] }, { diff --git a/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.py b/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.py index a908eb7a8..55f0c9bfe 100644 --- a/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.py +++ b/resources/NBTest/NBTest_042_TestBancorV3ModeTwoHop.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.15.2 +# jupytext_version: 1.14.5 # kernelspec: # display_name: Python 3 # language: python @@ -368,7 +368,7 @@ def init_bot(mgr: Manager) -> CarbonBot: flt = {'MKR-79A2', 'TRAC-0A6F', 'MONA-412A', 'WBTC-C599', 'WOO-5D4B', 'MATIC-eBB0', 'BAT-87EF', 'UOS-5C8c', 'LRC-EafD', 'NMR-6671', 'DIP-cD83', 'TEMP-1aB9', 'ICHI-A881', 'USDC-eB48', 'ENS-9D72', 'vBNT-7f94', 'ANKR-EDD4', 'UNI-F984', 'REQ-938a', 'WETH-6Cc2', 'AAVE-DaE9', 'ENJ-3B9c', 'MANA-C942', 'wNXM-2bDE', 'QNT-4675', 'RLC-7375', 'CROWN-E0fa', 'CHZ-b4AF', 'USDT-1ec7', 'DAI-1d0F', 'RPL-A51f', 'HOT-26E2', 'LINK-86CA', 'wstETH-2Ca0'} combos = finder.get_combos(flashloan_tokens=flt, CCm=CCm, arb_mode="b3_two_hop") all_miniverses = finder.get_miniverse_combos(combos) -assert len(all_miniverses) == 144, f"[test_bancor_v3_two_hop] Different data used for tests, expected 146 miniverses, found {len(all_miniverses)}" +assert len(all_miniverses) >= 146, f"[test_bancor_v3_two_hop] Different data used for tests, expected 146 miniverses, found {len(all_miniverses)}" # ## Test_get_mono_direction_carbon_curves diff --git a/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.ipynb b/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.ipynb index 1d9fc0e9c..4a509c119 100644 --- a/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.ipynb +++ b/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 9, + "execution_count": 1, "id": "84fa264b", "metadata": { "ExecuteTime": { @@ -15,13 +15,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "ConstantProductCurve v3.3 (21/Sep/2023)\n", + "ConstantProductCurve v3.3.1 (05/Oct/2023)\n", "CarbonBot v3-b2.2 (20/June/2023)\n", "UniswapV2 v0.0.2 (2023-08-27)\n", "UniswapV3 v0.0.2 (2023-08-27)\n", "SushiswapV2 v0.0.2 (2023-08-27)\n", "CarbonV1 v0.0.2 (2023-08-27)\n", "BancorV3 v0.0.2 (2023-08-27)\n", + "imported m, np, pd, plt, os, sys, decimal; defined iseq, raises, require\n", "Version = 3-b2.2 [requirements >= 3.0 is met]\n" ] } @@ -70,7 +71,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "id": "a51e5ec2", "metadata": { "ExecuteTime": { @@ -83,78 +84,45 @@ "name": "stderr", "output_type": "stream", "text": [ - "2023-10-05 16:41:59,521 [fastlane:INFO] - \n", - "2023-10-05 16:41:59,521 [fastlane:INFO] - \n", - "2023-10-05 16:41:59,522 [fastlane:INFO] - **********************************************\n", - "2023-10-05 16:41:59,522 [fastlane:INFO] - **********************************************\n", - "2023-10-05 16:41:59,523 [fastlane:INFO] - The logging path is set to: logs/20231005-164159\\bot.log\n", - "2023-10-05 16:41:59,523 [fastlane:INFO] - The logging path is set to: logs/20231005-164159\\bot.log\n", - "2023-10-05 16:41:59,523 [fastlane:INFO] - **********************************************\n", - "2023-10-05 16:41:59,523 [fastlane:INFO] - **********************************************\n", - "2023-10-05 16:41:59,524 [fastlane:INFO] - \n", - "2023-10-05 16:41:59,524 [fastlane:INFO] - \n", - "2023-10-05 16:42:01,146 [fastlane:INFO] - Retrieved 176 carbon pairs from contract\n", - "2023-10-05 16:42:01,146 [fastlane:INFO] - Retrieved 176 carbon pairs from contract\n", - "2023-10-05 16:42:02,574 [fastlane:INFO] - Time taken to add initial pools: 0.09495925903320312\n", - "2023-10-05 16:42:02,574 [fastlane:INFO] - Time taken to add initial pools: 0.09495925903320312\n", - "2023-10-05 16:42:02,578 [fastlane:INFO] - Initializing the bot...\n", - "2023-10-05 16:42:02,578 [fastlane:INFO] - Initializing the bot...\n", - "2023-10-05 16:42:02,770 [fastlane:INFO] - Removed 3242 unmapped uniswap_v2/sushi pools. 1897 uniswap_v2/sushi pools remaining\n", - "2023-10-05 16:42:02,770 [fastlane:INFO] - Removed 3242 unmapped uniswap_v2/sushi pools. 1897 uniswap_v2/sushi pools remaining\n", - "2023-10-05 16:42:02,772 [fastlane:INFO] - Unmapped uniswap_v2/sushi pools:\n", - "2023-10-05 16:42:02,772 [fastlane:INFO] - Unmapped uniswap_v2/sushi pools:\n", - "2023-10-05 16:42:02,938 [fastlane:INFO] - uniswap_v3: 0\n", - "2023-10-05 16:42:02,938 [fastlane:INFO] - uniswap_v3: 0\n", - "2023-10-05 16:42:02,940 [fastlane:INFO] - uniswap_v2: 3242\n", - "2023-10-05 16:42:02,940 [fastlane:INFO] - uniswap_v2: 3242\n", - "2023-10-05 16:42:02,941 [fastlane:INFO] - sushiswap_v2: 0\n", - "2023-10-05 16:42:02,941 [fastlane:INFO] - sushiswap_v2: 0\n", - "2023-10-05 16:42:02,944 [fastlane:INFO] - uniswap_v3: 636\n", - "2023-10-05 16:42:02,944 [fastlane:INFO] - uniswap_v3: 636\n", - "2023-10-05 16:42:02,945 [fastlane:INFO] - sushiswap_v2: 78\n", - "2023-10-05 16:42:02,945 [fastlane:INFO] - sushiswap_v2: 78\n", - "2023-10-05 16:42:02,945 [fastlane:INFO] - uniswap_v2: 0\n", - "2023-10-05 16:42:02,945 [fastlane:INFO] - uniswap_v2: 0\n", - "2023-10-05 16:42:02,946 [fastlane:INFO] - bancor_v2: 0\n", - "2023-10-05 16:42:02,946 [fastlane:INFO] - bancor_v2: 0\n", - "2023-10-05 16:42:02,946 [fastlane:INFO] - bancor_v3: 34\n", - "2023-10-05 16:42:02,946 [fastlane:INFO] - bancor_v3: 34\n", - "2023-10-05 16:42:02,947 [fastlane:INFO] - bancor_pol: 0\n", - "2023-10-05 16:42:02,947 [fastlane:INFO] - bancor_pol: 0\n", - "2023-10-05 16:42:02,948 [fastlane:INFO] - carbon_v1: 119\n", - "2023-10-05 16:42:02,948 [fastlane:INFO] - carbon_v1: 119\n", - "2023-10-05 16:42:02,949 [fastlane:INFO] - balancer: 0\n", - "2023-10-05 16:42:02,949 [fastlane:INFO] - balancer: 0\n", - "2023-10-05 16:42:02,972 [fastlane:INFO] - uniswap_v3_zero_liquidity_pools: 858\n", - "2023-10-05 16:42:02,972 [fastlane:INFO] - uniswap_v3_zero_liquidity_pools: 858\n", - "2023-10-05 16:42:02,973 [fastlane:INFO] - sushiswap_v2_zero_liquidity_pools: 34\n", - "2023-10-05 16:42:02,973 [fastlane:INFO] - sushiswap_v2_zero_liquidity_pools: 34\n", - "2023-10-05 16:42:02,974 [fastlane:INFO] - uniswap_v2_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,974 [fastlane:INFO] - uniswap_v2_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,975 [fastlane:INFO] - bancor_v2_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,975 [fastlane:INFO] - bancor_v2_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,976 [fastlane:INFO] - bancor_v3_zero_liquidity_pools: 37\n", - "2023-10-05 16:42:02,976 [fastlane:INFO] - bancor_v3_zero_liquidity_pools: 37\n", - "2023-10-05 16:42:02,976 [fastlane:INFO] - bancor_pol_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,976 [fastlane:INFO] - bancor_pol_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,977 [fastlane:INFO] - carbon_v1_zero_liquidity_pools: 101\n", - "2023-10-05 16:42:02,977 [fastlane:INFO] - carbon_v1_zero_liquidity_pools: 101\n", - "2023-10-05 16:42:02,979 [fastlane:INFO] - balancer_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,979 [fastlane:INFO] - balancer_zero_liquidity_pools: 0\n", - "2023-10-05 16:42:02,980 [fastlane:INFO] - Removed 0 unsupported exchanges. 867 pools remaining\n", - "2023-10-05 16:42:02,980 [fastlane:INFO] - Removed 0 unsupported exchanges. 867 pools remaining\n", - "2023-10-05 16:42:02,981 [fastlane:INFO] - Pools remaining per exchange:\n", - "2023-10-05 16:42:02,981 [fastlane:INFO] - Pools remaining per exchange:\n", - "2023-10-05 16:42:02,981 [fastlane:INFO] - bancor_v3: 34\n", - "2023-10-05 16:42:02,981 [fastlane:INFO] - bancor_v3: 34\n", - "2023-10-05 16:42:02,983 [fastlane:INFO] - carbon_v1: 119\n", - "2023-10-05 16:42:02,983 [fastlane:INFO] - carbon_v1: 119\n", - "2023-10-05 16:42:02,984 [fastlane:INFO] - uniswap_v3: 636\n", - "2023-10-05 16:42:02,984 [fastlane:INFO] - uniswap_v3: 636\n", - "2023-10-05 16:42:02,985 [fastlane:INFO] - uniswap_v2: 0\n", - "2023-10-05 16:42:02,985 [fastlane:INFO] - uniswap_v2: 0\n", - "2023-10-05 16:42:02,986 [fastlane:INFO] - sushiswap_v2: 78\n", - "2023-10-05 16:42:02,986 [fastlane:INFO] - sushiswap_v2: 78\n" + "2023-10-27 10:20:05,945 [fastlane:INFO] - \n", + "2023-10-27 10:20:05,946 [fastlane:INFO] - **********************************************\n", + "2023-10-27 10:20:05,946 [fastlane:INFO] - The logging path is set to: logs/20231027-102005\\bot.log\n", + "2023-10-27 10:20:05,947 [fastlane:INFO] - **********************************************\n", + "2023-10-27 10:20:05,948 [fastlane:INFO] - \n", + "2023-10-27 10:20:07,770 [fastlane:INFO] - Retrieved 200 carbon pairs from contract\n", + "2023-10-27 10:20:09,211 [fastlane:INFO] - Time taken to add initial pools: 0.09163355827331543\n", + "2023-10-27 10:20:09,215 [fastlane:INFO] - Initializing the bot...\n", + "2023-10-27 10:20:09,396 [fastlane:INFO] - Removed 3242 unmapped uniswap_v2/sushi pools. 1897 uniswap_v2/sushi pools remaining\n", + "2023-10-27 10:20:09,396 [fastlane:INFO] - Unmapped uniswap_v2/sushi pools:\n", + "2023-10-27 10:20:09,558 [fastlane:INFO] - uniswap_v2: 3242\n", + "2023-10-27 10:20:09,560 [fastlane:INFO] - sushiswap_v2: 0\n", + "2023-10-27 10:20:09,562 [fastlane:INFO] - uniswap_v3: 636\n", + "2023-10-27 10:20:09,562 [fastlane:INFO] - sushiswap_v2: 78\n", + "2023-10-27 10:20:09,562 [fastlane:INFO] - uniswap_v2: 0\n", + "2023-10-27 10:20:09,562 [fastlane:INFO] - bancor_v2: 0\n", + "2023-10-27 10:20:09,563 [fastlane:INFO] - bancor_v3: 34\n", + "2023-10-27 10:20:09,564 [fastlane:INFO] - bancor_pol: 0\n", + "2023-10-27 10:20:09,564 [fastlane:INFO] - carbon_v1: 144\n", + "2023-10-27 10:20:09,564 [fastlane:INFO] - pancakeswap_v2: 0\n", + "2023-10-27 10:20:09,565 [fastlane:INFO] - pancakeswap_v3: 0\n", + "2023-10-27 10:20:09,565 [fastlane:INFO] - balancer: 0\n", + "2023-10-27 10:20:09,588 [fastlane:INFO] - uniswap_v3_zero_liquidity_pools: 858\n", + "2023-10-27 10:20:09,589 [fastlane:INFO] - sushiswap_v2_zero_liquidity_pools: 34\n", + "2023-10-27 10:20:09,589 [fastlane:INFO] - uniswap_v2_zero_liquidity_pools: 0\n", + "2023-10-27 10:20:09,590 [fastlane:INFO] - bancor_v2_zero_liquidity_pools: 0\n", + "2023-10-27 10:20:09,590 [fastlane:INFO] - bancor_v3_zero_liquidity_pools: 37\n", + "2023-10-27 10:20:09,591 [fastlane:INFO] - bancor_pol_zero_liquidity_pools: 0\n", + "2023-10-27 10:20:09,592 [fastlane:INFO] - carbon_v1_zero_liquidity_pools: 76\n", + "2023-10-27 10:20:09,592 [fastlane:INFO] - pancakeswap_v2_zero_liquidity_pools: 0\n", + "2023-10-27 10:20:09,593 [fastlane:INFO] - pancakeswap_v3_zero_liquidity_pools: 0\n", + "2023-10-27 10:20:09,593 [fastlane:INFO] - balancer_zero_liquidity_pools: 0\n", + "2023-10-27 10:20:09,594 [fastlane:INFO] - Removed 0 unsupported exchanges. 892 pools remaining\n", + "2023-10-27 10:20:09,594 [fastlane:INFO] - Pools remaining per exchange:\n", + "2023-10-27 10:20:09,595 [fastlane:INFO] - sushiswap_v2: 78\n", + "2023-10-27 10:20:09,595 [fastlane:INFO] - uniswap_v3: 636\n", + "2023-10-27 10:20:09,595 [fastlane:INFO] - carbon_v1: 144\n", + "2023-10-27 10:20:09,596 [fastlane:INFO] - uniswap_v2: 0\n", + "2023-10-27 10:20:09,596 [fastlane:INFO] - bancor_v3: 34\n" ] } ], @@ -273,7 +241,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 3, "id": "c8f41237", "metadata": {}, "outputs": [], @@ -293,7 +261,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 4, "id": "84cf37eb", "metadata": {}, "outputs": [], @@ -312,7 +280,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 5, "id": "b1f40498", "metadata": {}, "outputs": [], @@ -329,6 +297,21 @@ "assert len(combos) >= 1225, f\"[TestMultiTriangleMode] Using wrong dataset, expected at least 1225 combos, found {len(combos)}\"" ] }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# print(len(combos))\n", + "# for ex in exchanges:\n", + "# count = 0\n", + "# for pool in CCm:\n", + "# if ex in pool.descr:\n", + "# count +=1\n", + "# print(f\"found {count} pools for {ex}\")" + ] + }, { "cell_type": "markdown", "id": "e703ba6b", @@ -339,7 +322,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 7, "id": "48e2f5a1", "metadata": {}, "outputs": [], @@ -371,7 +354,7 @@ " has_zero_curves = True\n", " if \"-1\" in curve['cid']:\n", " has_one_curves = True\n", - " assert not has_zero_curves or not has_one_curves, f\"[TestMultiTriangleMode] Finding Carbon curves in opposite directions - not supported in this mode.\"\n", + " assert not has_zero_curves or not has_one_curves, f\"[TestMultiTriangleMode] Finding Carbon curves in opposite directions - not supported in this mode.\"\n", "assert multi_carbon_count > 0, f\"[TestMultiTriangleMode] Not finding arbs with multiple Carbon curves.\"\n", "assert len(r) >= 58, f\"[TestMultiTriangleMode] Expected at least 58 arbs, found {len(r)}\"" ] diff --git a/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.py b/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.py index bb96b8670..231156b2f 100644 --- a/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.py +++ b/resources/NBTest/NBTest_901_TestMultiTriangleModeSlow.py @@ -176,6 +176,16 @@ def init_bot(mgr: Manager) -> CarbonBot: combos = finder2.get_combos(flashloan_tokens=flashloan_tokens, CCm=CCm, arb_mode="multi_triangle") assert len(combos) >= 1225, f"[TestMultiTriangleMode] Using wrong dataset, expected at least 1225 combos, found {len(combos)}" +# + +# print(len(combos)) +# for ex in exchanges: +# count = 0 +# for pool in CCm: +# if ex in pool.descr: +# count +=1 +# print(f"found {count} pools for {ex}") +# - + # ### Test_find_arbitrage arb_finder = bot._get_arb_finder("multi_triangle") @@ -205,6 +215,6 @@ def init_bot(mgr: Manager) -> CarbonBot: has_zero_curves = True if "-1" in curve['cid']: has_one_curves = True - assert not has_zero_curves or not has_one_curves, f"[TestMultiTriangleMode] Finding Carbon curves in opposite directions - not supported in this mode." + assert not has_zero_curves or not has_one_curves, f"[TestMultiTriangleMode] Finding Carbon curves in opposite directions - not supported in this mode." assert multi_carbon_count > 0, f"[TestMultiTriangleMode] Not finding arbs with multiple Carbon curves." assert len(r) >= 58, f"[TestMultiTriangleMode] Expected at least 58 arbs, found {len(r)}"