diff --git a/resources/NBTest/NBTest_036_Manager.ipynb b/resources/NBTest/NBTest_036_Manager.ipynb index 47fd94a89..4955fd7db 100644 --- a/resources/NBTest/NBTest_036_Manager.ipynb +++ b/resources/NBTest/NBTest_036_Manager.ipynb @@ -6,8 +6,8 @@ "id": "6b800d59", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:06.090221Z", - "start_time": "2023-09-20T14:03:02.984869Z" + "end_time": "2023-10-25T21:54:03.702203Z", + "start_time": "2023-10-25T21:54:03.673861Z" } }, "outputs": [ @@ -15,7 +15,7 @@ "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", @@ -66,8 +66,8 @@ "id": "80ddef38", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:06.128079Z", - "start_time": "2023-09-20T14:03:06.090785Z" + "end_time": "2023-10-25T21:54:03.740704Z", + "start_time": "2023-10-25T21:54:03.680472Z" } }, "outputs": [], @@ -87,8 +87,8 @@ "id": "7919999a", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:08.151919Z", - "start_time": "2023-09-20T14:03:06.113589Z" + "end_time": "2023-10-25T21:54:06.879756Z", + "start_time": "2023-10-25T21:54:03.715830Z" } }, "outputs": [ @@ -96,22 +96,42 @@ "name": "stderr", "output_type": "stream", "text": [ - "2023-09-26 17:02:08,875 [fastlane:INFO] - \n", - "2023-09-26 17:02:08,876 [fastlane:INFO] - **********************************************\n", - "2023-09-26 17:02:08,876 [fastlane:INFO] - The logging path is set to: logs/20230926-170208/bot.log\n", - "2023-09-26 17:02:08,877 [fastlane:INFO] - **********************************************\n", - "2023-09-26 17:02:08,877 [fastlane:INFO] - \n", - "2023-09-26 17:02:09,863 [fastlane:INFO] - Retrieved 176 carbon pairs from contract\n" + "2023-10-25 14:54:49,262 [fastlane:INFO] - \n", + "2023-10-25 14:54:49,262 [fastlane:INFO] - **********************************************\n", + "2023-10-25 14:54:49,263 [fastlane:INFO] - The logging path is set to: logs/20231025-145449/bot.log\n", + "2023-10-25 14:54:49,263 [fastlane:INFO] - **********************************************\n", + "2023-10-25 14:54:49,263 [fastlane:INFO] - \n", + "2023-10-25 14:54:50,368 [fastlane:INFO] - Retrieved 199 carbon pairs from contract\n", + "2023-10-25 14:54:52,025 [fastlane:INFO] - Adding 32720 uniswap_v2 pools to static pools\n", + "2023-10-25 14:54:52,027 [fastlane:INFO] - Adding 4877 uniswap_v3 pools to static pools\n" ] } ], "source": [ + "from fastlane_bot.events.utils import handle_static_pools_update, get_static_data\n", "\n", "# Create mock instances for all required parameters\n", "cfg = Config.new(config=Config.CONFIG_MAINNET)\n", "\n", + "(\n", + " static_pool_data,\n", + " tokens,\n", + " uniswap_v2_event_mappings,\n", + " uniswap_v3_event_mappings,\n", + ") = get_static_data(\n", + " cfg, ['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'], 'static_pool_data', 'max'\n", + ")\n", "# create manager instance for all tests\n", - "manager = Manager(cfg.w3, cfg, pool_data, 20, SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'])\n" + "manager = Manager(cfg.w3, \n", + " cfg, \n", + " pool_data, \n", + " 20, \n", + " SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'],\n", + " forked_exchanges=['uniswap_v2', 'uniswap_v3'],\n", + " uniswap_v2_event_mappings=uniswap_v2_event_mappings,\n", + " uniswap_v3_event_mappings=uniswap_v3_event_mappings)\n", + "\n", + "handle_static_pools_update(manager)" ] }, { @@ -128,8 +148,8 @@ "id": "584c8056", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:08.158339Z", - "start_time": "2023-09-20T14:03:08.156731Z" + "end_time": "2023-10-25T21:54:06.982273Z", + "start_time": "2023-10-25T21:54:06.964246Z" } }, "outputs": [], @@ -158,8 +178,8 @@ "id": "2baa6f73", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:08.164064Z", - "start_time": "2023-09-20T14:03:08.162595Z" + "end_time": "2023-10-25T21:54:06.982571Z", + "start_time": "2023-10-25T21:54:06.968786Z" } }, "outputs": [], @@ -194,8 +214,8 @@ "id": "71334cab", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:08.800682Z", - "start_time": "2023-09-20T14:03:08.166659Z" + "end_time": "2023-10-25T21:54:07.613585Z", + "start_time": "2023-10-25T21:54:06.975784Z" } }, "outputs": [], @@ -225,8 +245,8 @@ "id": "71d67e1c", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:08.820959Z", - "start_time": "2023-09-20T14:03:08.805835Z" + "end_time": "2023-10-25T21:54:08.265334Z", + "start_time": "2023-10-25T21:54:07.618487Z" } }, "outputs": [], @@ -254,8 +274,8 @@ "id": "452029c9", "metadata": { "ExecuteTime": { - "end_time": "2023-09-20T14:03:08.838302Z", - "start_time": "2023-09-20T14:03:08.825262Z" + "end_time": "2023-10-25T21:54:08.876281Z", + "start_time": "2023-10-25T21:54:08.265614Z" } }, "outputs": [], diff --git a/resources/NBTest/NBTest_036_Manager.py b/resources/NBTest/NBTest_036_Manager.py index 66c861c06..e59239368 100644 --- a/resources/NBTest/NBTest_036_Manager.py +++ b/resources/NBTest/NBTest_036_Manager.py @@ -53,13 +53,30 @@ pool_data = json.load(f) # + +from fastlane_bot.events.utils import handle_static_pools_update, get_static_data # Create mock instances for all required parameters cfg = Config.new(config=Config.CONFIG_MAINNET) +( + static_pool_data, + tokens, + uniswap_v2_event_mappings, + uniswap_v3_event_mappings, +) = get_static_data( + cfg, ['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'], 'static_pool_data', 'max' +) # create manager instance for all tests -manager = Manager(cfg.w3, cfg, pool_data, 20, SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3']) - +manager = Manager(cfg.w3, + cfg, + pool_data, + 20, + SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'], + forked_exchanges=['uniswap_v2', 'uniswap_v3'], + uniswap_v2_event_mappings=uniswap_v2_event_mappings, + uniswap_v3_event_mappings=uniswap_v3_event_mappings) + +handle_static_pools_update(manager) # - # ## test_update_from_event_uniswap_v2