From 7d579faa8200031d0f2e41fa3d3e94e2709241c0 Mon Sep 17 00:00:00 2001 From: stevekeyharvey Date: Thu, 30 Apr 2026 17:56:57 +0000 Subject: [PATCH] excalidraw flow and basic rust ws --- .gitignore | 9 +- engine_orders.py | 92 +- excalidraw/FR_Flow.excalidraw | 2696 ++++++++++++++++++++++++++++++ rust_test/test_world/Cargo.toml | 13 + rust_test/test_world/src/main.rs | 70 + ws_aster_user.py | 2 + ws_extended_user.py | 6 +- 7 files changed, 2859 insertions(+), 29 deletions(-) create mode 100644 excalidraw/FR_Flow.excalidraw create mode 100644 rust_test/test_world/Cargo.toml create mode 100644 rust_test/test_world/src/main.rs diff --git a/.gitignore b/.gitignore index ee79715..a59fe57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,9 @@ +# General .env -*.pyc \ No newline at end of file + +# Python +*.pyc + +# Rust +/rust_test/test_world/target/ +Cargo.lock \ No newline at end of file diff --git a/engine_orders.py b/engine_orders.py index ea9fd70..04bf954 100644 --- a/engine_orders.py +++ b/engine_orders.py @@ -12,6 +12,8 @@ import multiprocessing as mp import threading from typing import Any + + ''' TO DO: - Insert config changes into database for analysis later / general tracking @@ -20,7 +22,6 @@ TO DO: LOCAL_ORDERS: list = [] ### Database ### -VK_POS_ASTER: str = 'fr_aster_user_positions' VK_IN: str = 'fr_engine_orders_input' VK_OUT: str = 'fr_engine_orders_output' VAL_KEY: valkey.Valkey = valkey.Valkey(host='localhost', port=6379, db=0, decode_responses=True) @@ -29,23 +30,30 @@ VAL_KEY: valkey.Valkey = valkey.Valkey(host='localhost', port=6379, db=0, decode load_dotenv() LOG_FILEPATH: str = f'{os.getenv("LOGS_PATH")}/Fund_Rate_Engine_Orders.log' - -# async def work_order(order: dict) -> dict: -# LOCAL_ORDERS.append(order) -# while LOCAL_ORDERS: -# print(f'working order...{order}') -# time.sleep(5) -# print(f'{order}...order posted/replaced/etc') - -# VAL_KEY.set(name=VK_OUT, value=json.dumps(order)) -# return order - +### Main Listener for Order Requests (e.g. from Algo Engine) ### def receive_orders(): global LOCAL_ORDERS VK_PUBSUB: valkey.client.PubSub = VAL_KEY.pubsub() VK_PUBSUB.subscribe(VK_IN) for message in VK_PUBSUB.listen(): + loop_start = time.time() + if message['type'] == 'message': + ts_arrival: int = round(number=datetime.now().timestamp()*1000) + + # Receive Update Msg from PubSub + data: dict = json.loads(s=message['data']) + print(data) + LOCAL_ORDERS.append(data) + + print(f'__ Rec Orders: Loop End __ - Algo Engine ms: {(time.time() - loop_start)*1000:.2f}') + +### Listeners - Aster ### +def receive_position_updates_aster(): + VK_PUBSUB: valkey.client.PubSub = VAL_KEY.pubsub() + VK_PUBSUB.subscribe('fr_aster_user_positions') + for message in VK_PUBSUB.listen(): + loop_start = time.time() if message['type'] == 'message': ts_arrival: int = round(number=datetime.now().timestamp()*1000) @@ -53,26 +61,58 @@ def receive_orders(): data: dict = json.loads(s=message['data']) print(data) -# def receive_notional_updates(): -# VK_PUBSUB: valkey.client.PubSub = VAL_KEY.pubsub() -# VK_PUBSUB.subscribe(VK_IN) -# for message in VK_PUBSUB.listen(): -# if message['type'] == 'message': -# ts_arrival: int = round(number=datetime.now().timestamp()*1000) + print(f'__ Aster Notional: Loop End __ - Algo Engine ms: {(time.time() - loop_start)*1000:.2f}') + +def receive_order_updates_aster(): + VK_PUBSUB: valkey.client.PubSub = VAL_KEY.pubsub() + VK_PUBSUB.subscribe('fr_aster_user_orders') + for message in VK_PUBSUB.listen(): + loop_start = time.time() + if message['type'] == 'message': + # ts_arrival: int = round(number=datetime.now().timestamp()*1000) -# # Receive Update Msg from PubSub -# data: dict = json.loads(s=message['data']) -# print(data) -# LOCAL_ORDERS.append(data) + # Receive Update Msg from PubSub + data: dict = json.loads(s=message['data']) + print(data) + + print(f'__ Aster Orders: Loop End __ - Algo Engine ms: {(time.time() - loop_start)*1000:.2f}') + +### Listeners - Extend ### +def receive_position_updates_extend(): + VK_PUBSUB: valkey.client.PubSub = VAL_KEY.pubsub() + VK_PUBSUB.subscribe('fr_extended_user_positions') + for message in VK_PUBSUB.listen(): + loop_start = time.time() + if message['type'] == 'message': + ts_arrival: int = round(number=datetime.now().timestamp()*1000) + + # Receive Update Msg from PubSub + data: dict = json.loads(s=message['data']) + print(data) + + print(f'__ Aster Notional: Loop End __ - Algo Engine ms: {(time.time() - loop_start)*1000:.2f}') + +def receive_order_updates_extend(): + VK_PUBSUB: valkey.client.PubSub = VAL_KEY.pubsub() + VK_PUBSUB.subscribe('fr_extended_user_orders') + for message in VK_PUBSUB.listen(): + loop_start = time.time() + if message['type'] == 'message': + # ts_arrival: int = round(number=datetime.now().timestamp()*1000) + + # Receive Update Msg from PubSub + data: dict = json.loads(s=message['data']) + print(data) + + print(f'__ Aster Orders: Loop End __ - Algo Engine ms: {(time.time() - loop_start)*1000:.2f}') async def main() -> None: global LOCAL_ORDERS try: - thread = threading.Thread(target=receive_orders) - thread.daemon = True - # thread.start() - thread.join() + t_rec_orders = threading.Thread(target=receive_orders) + t_rec_orders.daemon = True + t_rec_orders.start() # while True: diff --git a/excalidraw/FR_Flow.excalidraw b/excalidraw/FR_Flow.excalidraw new file mode 100644 index 0000000..e3206e3 --- /dev/null +++ b/excalidraw/FR_Flow.excalidraw @@ -0,0 +1,2696 @@ +{ + "type": "excalidraw", + "version": 2, + "source": "https://excalidraw.com", + "elements": [ + { + "id": "D8imZSvTrMvTlypJXygQm", + "type": "diamond", + "x": 732.38671875, + "y": 341.34375, + "width": 214.11328125, + "height": 214.11328125, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a0", + "roundness": { + "type": 2 + }, + "seed": 642973761, + "version": 121, + "versionNonce": 910712847, + "isDeleted": true, + "boundElements": null, + "updated": 1777570956437, + "link": null, + "locked": false + }, + { + "id": "dnP4LPoz4aBuLuqmqEofr", + "type": "ellipse", + "x": 633.3671875, + "y": 356.06640625, + "width": 166.95703125, + "height": 166.95703125, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a1", + "roundness": { + "type": 2 + }, + "seed": 830441007, + "version": 51, + "versionNonce": 616244111, + "isDeleted": true, + "boundElements": null, + "updated": 1777570961844, + "link": null, + "locked": false + }, + { + "id": "4HF8VczGJGG9qA8x9YHlf", + "type": "rectangle", + "x": 1705.9086497894089, + "y": 680.2114305733056, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a2", + "roundness": { + "type": 3 + }, + "seed": 1540217263, + "version": 448, + "versionNonce": 886936399, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "NWYGDbQclOPyPGRXQO_U1" + }, + { + "id": "YH-b4d76_KEGIWRQTES73", + "type": "arrow" + }, + { + "id": "4HzApMyR0vAm1sbs_J2O2", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "NWYGDbQclOPyPGRXQO_U1", + "type": "text", + "x": 1723.0036967864792, + "y": 747.0864305733056, + "width": 124.55990600585938, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a3", + "roundness": null, + "seed": 1429113249, + "version": 424, + "versionNonce": 99094049, + "isDeleted": false, + "boundElements": null, + "updated": 1777571457596, + "link": null, + "locked": false, + "text": "Order Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "4HF8VczGJGG9qA8x9YHlf", + "originalText": "Order Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "3bX_ZhdbjR2-nZxSfcd7P", + "type": "rectangle", + "x": 399.091862436622, + "y": 680.2114305733056, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a30G", + "roundness": { + "type": 3 + }, + "seed": 1400528847, + "version": 588, + "versionNonce": 704531343, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "6H2X0oXtuTUeVJUt4RPCp" + }, + { + "id": "Q3fq3-CnL2x6EhmE9nKxB", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "6H2X0oXtuTUeVJUt4RPCp", + "type": "text", + "x": 419.4969069922861, + "y": 734.5864305733056, + "width": 117.93991088867188, + "height": 50, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a30V", + "roundness": null, + "seed": 2142734497, + "version": 639, + "versionNonce": 1764713793, + "isDeleted": false, + "boundElements": null, + "updated": 1777571484030, + "link": null, + "locked": false, + "text": "Best Fund\nRate Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "3bX_ZhdbjR2-nZxSfcd7P", + "originalText": "Best Fund Rate Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "L5ZOVXc78bFCmjTM7c6a5", + "type": "rectangle", + "x": 1071.2310459129603, + "y": 578.2905854326189, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a31", + "roundness": { + "type": 3 + }, + "seed": 1707985711, + "version": 274, + "versionNonce": 869609519, + "isDeleted": true, + "boundElements": [], + "updated": 1777571173754, + "link": null, + "locked": false + }, + { + "id": "Z8Nnghc6pxhqULWZfWhMA", + "type": "text", + "x": 1088.3260929100306, + "y": 645.1655854326189, + "width": 124.55990600585938, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a32", + "roundness": null, + "seed": 2133525313, + "version": 253, + "versionNonce": 58224193, + "isDeleted": true, + "boundElements": null, + "updated": 1777571173754, + "link": null, + "locked": false, + "text": "Order Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "L5ZOVXc78bFCmjTM7c6a5", + "originalText": "Order Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "Xnun7LklmxcCzukBYa7D8", + "type": "rectangle", + "x": 2027.5338547915694, + "y": 326.6924190149807, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a34", + "roundness": { + "type": 3 + }, + "seed": 329686415, + "version": 148, + "versionNonce": 885632065, + "isDeleted": true, + "boundElements": [], + "updated": 1777571169283, + "link": null, + "locked": false + }, + { + "id": "0_YIjJJ32OizkT0Mg64sK", + "type": "text", + "x": 2044.6289017886397, + "y": 393.5674190149807, + "width": 124.55990600585938, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a38", + "roundness": null, + "seed": 1439106785, + "version": 127, + "versionNonce": 388428879, + "isDeleted": true, + "boundElements": null, + "updated": 1777571169283, + "link": null, + "locked": false, + "text": "Order Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "Xnun7LklmxcCzukBYa7D8", + "originalText": "Order Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "bvyM7YE7V0-8pru3U5_-T", + "type": "rectangle", + "x": 464.7312598700487, + "y": -634.9911574801968, + "width": 489.3121374249551, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a3G", + "roundness": { + "type": 3 + }, + "seed": 539992815, + "version": 365, + "versionNonce": 1253054561, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "ud-RRHkMbR49068uQEMlj" + }, + { + "id": "V6d1rnkjwz49wpjJ4_YEY", + "type": "arrow" + }, + { + "id": "B8k2P4ZYL5nvC1gtJ6Oyz", + "type": "arrow" + } + ], + "updated": 1777571181756, + "link": null, + "locked": false + }, + { + "id": "ud-RRHkMbR49068uQEMlj", + "type": "text", + "x": 571.0753778989325, + "y": -578.1161574801968, + "width": 276.6239013671875, + "height": 45, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a3V", + "roundness": null, + "seed": 1984137089, + "version": 438, + "versionNonce": 749624865, + "isDeleted": false, + "boundElements": null, + "updated": 1777571094184, + "link": null, + "locked": false, + "text": "Aster Exchange", + "fontSize": 36, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "bvyM7YE7V0-8pru3U5_-T", + "originalText": "Aster Exchange", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "Bg0Ih3UIlOvBTIsxiFn-q", + "type": "rectangle", + "x": 1158.8047061447444, + "y": -634.168247967958, + "width": 489.3121374249551, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a3X", + "roundness": { + "type": 3 + }, + "seed": 1739510223, + "version": 462, + "versionNonce": 1084768801, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "HdWOR4KKuwA01p586EUz2" + }, + { + "id": "CGwpgS62HJgWk8K5t1ooZ", + "type": "arrow" + }, + { + "id": "GW4hkPIIusnL2O8GVmmXW", + "type": "arrow" + } + ], + "updated": 1777571183643, + "link": null, + "locked": false + }, + { + "id": "HdWOR4KKuwA01p586EUz2", + "type": "text", + "x": 1250.7848257605422, + "y": -577.293247967958, + "width": 305.3518981933594, + "height": 45, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a3Z", + "roundness": null, + "seed": 1287337633, + "version": 541, + "versionNonce": 1092529615, + "isDeleted": false, + "boundElements": null, + "updated": 1777571183643, + "link": null, + "locked": false, + "text": "Extend Exchange", + "fontSize": 36, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "Bg0Ih3UIlOvBTIsxiFn-q", + "originalText": "Extend Exchange", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "oOYeRzPmyTkOB_PoHRaTa", + "type": "rectangle", + "x": 1159.2725245660854, + "y": -634.9911574801968, + "width": 489.3121374249551, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a3d", + "roundness": { + "type": 3 + }, + "seed": 1259837039, + "version": 396, + "versionNonce": 378679393, + "isDeleted": true, + "boundElements": [ + { + "type": "text", + "id": "HLVuUiJmQiWbYRmARXcBI" + } + ], + "updated": 1777571096067, + "link": null, + "locked": false + }, + { + "id": "HLVuUiJmQiWbYRmARXcBI", + "type": "text", + "x": 1251.2526441818832, + "y": -578.1161574801968, + "width": 305.3518981933594, + "height": 45, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a3l", + "roundness": null, + "seed": 1151765505, + "version": 479, + "versionNonce": 1999651375, + "isDeleted": true, + "boundElements": null, + "updated": 1777571096067, + "link": null, + "locked": false, + "text": "Extend Exchange", + "fontSize": 36, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "oOYeRzPmyTkOB_PoHRaTa", + "originalText": "Extend Exchange", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "hFxGi5z277K72VFE3y3LH", + "type": "rectangle", + "x": 1112.1630075327123, + "y": 579.5609362058196, + "width": 259.37504034747656, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a4", + "roundness": { + "type": 3 + }, + "seed": 1217621007, + "version": 503, + "versionNonce": 177720079, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "7m8-BXcNWZ1trraJZXPlg" + }, + { + "id": "YH-b4d76_KEGIWRQTES73", + "type": "arrow" + }, + { + "id": "Q3fq3-CnL2x6EhmE9nKxB", + "type": "arrow" + }, + { + "id": "MORBSzkOym4ENTm8L1dIW", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "7m8-BXcNWZ1trraJZXPlg", + "type": "text", + "x": 1164.1365689662161, + "y": 641.4359362058196, + "width": 155.42791748046875, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a5", + "roundness": null, + "seed": 1303666785, + "version": 585, + "versionNonce": 1147563951, + "isDeleted": false, + "boundElements": null, + "updated": 1777571482197, + "link": null, + "locked": false, + "text": "Algo Engine", + "fontSize": 28, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "hFxGi5z277K72VFE3y3LH", + "originalText": "Algo Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "1KHw6mA3tZ4aeXvAnQCDd", + "type": "rectangle", + "x": 762.9899882199818, + "y": 579.7687054790872, + "width": 259.37504034747656, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a500G", + "roundness": { + "type": 3 + }, + "seed": 904911855, + "version": 583, + "versionNonce": 1334932673, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "tSHZhiM__KlnXtbD7ZokR" + }, + { + "id": "drq01cOrPn0xbAenUQv_3", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "tSHZhiM__KlnXtbD7ZokR", + "type": "text", + "x": 768.7495603956731, + "y": 641.6437054790872, + "width": 247.85589599609375, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a500V", + "roundness": null, + "seed": 1182752385, + "version": 681, + "versionNonce": 2021663631, + "isDeleted": false, + "boundElements": null, + "updated": 1777571516438, + "link": null, + "locked": false, + "text": "Algo Orchestrator", + "fontSize": 28, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "1KHw6mA3tZ4aeXvAnQCDd", + "originalText": "Algo Orchestrator", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "GsaOX0U23hg1enSJgdrww", + "type": "rectangle", + "x": 771.329320288572, + "y": 578.0706440541314, + "width": 353.903357449606, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a501", + "roundness": { + "type": 3 + }, + "seed": 321732577, + "version": 766, + "versionNonce": 1216256559, + "isDeleted": true, + "boundElements": [ + { + "type": "text", + "id": "bzPzdf4EcYjIIuJ7wIq7i" + } + ], + "updated": 1777571464677, + "link": null, + "locked": false + }, + { + "id": "bzPzdf4EcYjIIuJ7wIq7i", + "type": "text", + "x": 788.9450615133751, + "y": 634.9456440541314, + "width": 318.671875, + "height": 45, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a502", + "roundness": null, + "seed": 1898965679, + "version": 859, + "versionNonce": 2012390465, + "isDeleted": true, + "boundElements": null, + "updated": 1777571464677, + "link": null, + "locked": false, + "text": "Algo Orchestrator", + "fontSize": 36, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "GsaOX0U23hg1enSJgdrww", + "originalText": "Algo Orchestrator", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "mgYMlMkdemWC4fYnOjSR3", + "type": "rectangle", + "x": 579.4255848554734, + "y": 392.90672551535545, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a504", + "roundness": { + "type": 3 + }, + "seed": 527076687, + "version": 354, + "versionNonce": 1631408719, + "isDeleted": true, + "boundElements": [], + "updated": 1777571173754, + "link": null, + "locked": false + }, + { + "id": "2F-eQ5xsS_PuaKBcKct7r", + "type": "text", + "x": 603.2906208662156, + "y": 459.78172551535545, + "width": 111.01992797851562, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a508", + "roundness": null, + "seed": 1279980321, + "version": 348, + "versionNonce": 1504902689, + "isDeleted": true, + "boundElements": null, + "updated": 1777571173754, + "link": null, + "locked": false, + "text": "Algo Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "mgYMlMkdemWC4fYnOjSR3", + "originalText": "Algo Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "mvXUiYUMB7xwzAiVLO5YB", + "type": "rectangle", + "x": 1535.7283937340826, + "y": 141.3085590977173, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a50G", + "roundness": { + "type": 3 + }, + "seed": 322573231, + "version": 228, + "versionNonce": 170687521, + "isDeleted": true, + "boundElements": [], + "updated": 1777571169283, + "link": null, + "locked": false + }, + { + "id": "Id5hS61yZLwu2tbVa_oMH", + "type": "text", + "x": 1559.5934297448248, + "y": 208.1835590977173, + "width": 111.01992797851562, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a50V", + "roundness": null, + "seed": 1675985601, + "version": 222, + "versionNonce": 1510052463, + "isDeleted": true, + "boundElements": null, + "updated": 1777571169283, + "link": null, + "locked": false, + "text": "Algo Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "mvXUiYUMB7xwzAiVLO5YB", + "originalText": "Algo Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "3H1zwjQX2FmMfxI6gd4f1", + "type": "rectangle", + "x": 461.51092614159415, + "y": -344.8251031860891, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a51", + "roundness": { + "type": 3 + }, + "seed": 1538893377, + "version": 241, + "versionNonce": 1638510145, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "ykkgqK1bJLq-fPjrHmCIV" + }, + { + "id": "B8k2P4ZYL5nvC1gtJ6Oyz", + "type": "arrow" + }, + { + "id": "DR02O7UVe-Cbe4fssvaq0", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "ykkgqK1bJLq-fPjrHmCIV", + "type": "text", + "x": 483.4059761904223, + "y": -290.4501031860891, + "width": 114.95989990234375, + "height": 50, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a52", + "roundness": null, + "seed": 315333199, + "version": 288, + "versionNonce": 344955855, + "isDeleted": false, + "boundElements": null, + "updated": 1777571181756, + "link": null, + "locked": false, + "text": "Mkt Data\nFeedhandler", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "3H1zwjQX2FmMfxI6gd4f1", + "originalText": "Mkt Data Feedhandler", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "uEaFELZegKSFkU51PvFL1", + "type": "rectangle", + "x": 1155.189826759737, + "y": -344.8251031860891, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a528", + "roundness": { + "type": 3 + }, + "seed": 1488044015, + "version": 300, + "versionNonce": 1085395457, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "JEHCQRhXWJXDapw_0Rngp" + }, + { + "id": "CGwpgS62HJgWk8K5t1ooZ", + "type": "arrow" + }, + { + "id": "_STPcK_oFdd0dDf2JL--w", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "JEHCQRhXWJXDapw_0Rngp", + "type": "text", + "x": 1177.084876808565, + "y": -290.4501031860891, + "width": 114.95989990234375, + "height": 50, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a52G", + "roundness": null, + "seed": 339589761, + "version": 347, + "versionNonce": 953624911, + "isDeleted": false, + "boundElements": null, + "updated": 1777571179595, + "link": null, + "locked": false, + "text": "Mkt Data\nFeedhandler", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "uEaFELZegKSFkU51PvFL1", + "originalText": "Mkt Data Feedhandler", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "jz1_tt7qFnwCXzqVLz_JR", + "type": "rectangle", + "x": 792.4783683241974, + "y": -344.62783035781274, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a52V", + "roundness": { + "type": 3 + }, + "seed": 1712338063, + "version": 328, + "versionNonce": 176134785, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "Qihndpajk3tsQNm5_ZVC-" + }, + { + "id": "V6d1rnkjwz49wpjJ4_YEY", + "type": "arrow" + }, + { + "id": "Ezo2warDhNuwIkuwZ5sgY", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "Qihndpajk3tsQNm5_ZVC-", + "type": "text", + "x": 814.3734183730255, + "y": -290.25283035781274, + "width": 114.95989990234375, + "height": 50, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a53", + "roundness": null, + "seed": 1772511201, + "version": 380, + "versionNonce": 1051694287, + "isDeleted": false, + "boundElements": null, + "updated": 1777571181039, + "link": null, + "locked": false, + "text": "User Data\nFeedhandler", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "jz1_tt7qFnwCXzqVLz_JR", + "originalText": "User Data Feedhandler", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "qA3X-iErr3Z0hL5Pk0b_e", + "type": "rectangle", + "x": 1486.1572689423401, + "y": -344.62783035781274, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a53G", + "roundness": { + "type": 3 + }, + "seed": 594668047, + "version": 394, + "versionNonce": 861144513, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "QTfLIA1BIDoaERAhTFmgw" + }, + { + "id": "GW4hkPIIusnL2O8GVmmXW", + "type": "arrow" + }, + { + "id": "4V3i77Qt-RT2DM4gGZbpT", + "type": "arrow" + } + ], + "updated": 1777571523538, + "link": null, + "locked": false + }, + { + "id": "QTfLIA1BIDoaERAhTFmgw", + "type": "text", + "x": 1508.0523189911682, + "y": -290.25283035781274, + "width": 114.95989990234375, + "height": 50, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a53V", + "roundness": null, + "seed": 1954857569, + "version": 445, + "versionNonce": 596619343, + "isDeleted": false, + "boundElements": null, + "updated": 1777571180289, + "link": null, + "locked": false, + "text": "User Data\nFeedhandler", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "qA3X-iErr3Z0hL5Pk0b_e", + "originalText": "User Data Feedhandler", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "44quxxwzEBZzEHfCaZ0dX", + "type": "rectangle", + "x": 466.51171875, + "y": 550.62109375, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a54", + "roundness": { + "type": 3 + }, + "seed": 509666671, + "version": 164, + "versionNonce": 147026287, + "isDeleted": true, + "boundElements": [], + "updated": 1777570995891, + "link": null, + "locked": false + }, + { + "id": "iIYv7FBJGAdcN8jP8DR13", + "type": "text", + "x": 490.3767547607422, + "y": 617.49609375, + "width": 111.01992797851562, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a58", + "roundness": null, + "seed": 547204353, + "version": 158, + "versionNonce": 1819926785, + "isDeleted": true, + "boundElements": null, + "updated": 1777570995891, + "link": null, + "locked": false, + "text": "Algo Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "44quxxwzEBZzEHfCaZ0dX", + "originalText": "Algo Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "9WNNJbMH63NFOuJ1PJ57l", + "type": "rectangle", + "x": 807.36328125, + "y": 321.40625, + "width": 158.75, + "height": 158.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a5G", + "roundness": { + "type": 3 + }, + "seed": 1730706241, + "version": 126, + "versionNonce": 1246602927, + "isDeleted": true, + "boundElements": [], + "updated": 1777570984612, + "link": null, + "locked": false + }, + { + "id": "iaMPSXFjbIgKebld-t5Pr", + "type": "text", + "x": 831.2283172607422, + "y": 388.28125, + "width": 111.01992797851562, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a5V", + "roundness": null, + "seed": 1512084815, + "version": 121, + "versionNonce": 130588609, + "isDeleted": true, + "boundElements": null, + "updated": 1777570984612, + "link": null, + "locked": false, + "text": "Algo Engine", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "9WNNJbMH63NFOuJ1PJ57l", + "originalText": "Algo Engine", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "q4_Iogk8lUJCIyughqp-f", + "type": "text", + "x": 965, + "y": 405.5, + "width": 8, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a6", + "roundness": null, + "seed": 177025583, + "version": 3, + "versionNonce": 2095198209, + "isDeleted": true, + "boundElements": null, + "updated": 1777570982408, + "link": null, + "locked": false, + "text": "", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "YH-b4d76_KEGIWRQTES73", + "type": "arrow", + "x": 1377.538047880189, + "y": 660.7273385111378, + "width": 329.3862269092199, + "height": 97.47237331216786, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a7", + "roundness": { + "type": 2 + }, + "seed": 1571572577, + "version": 766, + "versionNonce": 1551540687, + "isDeleted": false, + "boundElements": null, + "updated": 1777571482198, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 329.3862269092199, + 97.47237331216786 + ] + ], + "startBinding": { + "elementId": "hFxGi5z277K72VFE3y3LH", + "mode": "orbit", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "endBinding": { + "elementId": "4HF8VczGJGG9qA8x9YHlf", + "mode": "inside", + "fixedPoint": [ + 0.0063976377952755905, + 0.49126476377952755 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "5Myy-qzb0JkzHmxnXLfcA", + "type": "arrow", + "x": 744.1755848554734, + "y": 475.60194992802406, + "width": 328.0710860574868, + "height": 180.6769167545948, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a7G", + "roundness": { + "type": 2 + }, + "seed": 678038383, + "version": 369, + "versionNonce": 228339823, + "isDeleted": true, + "boundElements": null, + "updated": 1777571173754, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 328.0710860574868, + 180.6769167545948 + ] + ], + "startBinding": { + "elementId": "mgYMlMkdemWC4fYnOjSR3", + "mode": "orbit", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "endBinding": { + "elementId": "L5ZOVXc78bFCmjTM7c6a5", + "mode": "inside", + "fixedPoint": [ + 0.0063976377952755905, + 0.49126476377952755 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "2vpnL0JycY8nRPpwevxwM", + "type": "arrow", + "x": 1700.4783937340826, + "y": 224.00378351038592, + "width": 328.0710860574868, + "height": 180.6769167545948, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a7V", + "roundness": { + "type": 2 + }, + "seed": 1496958415, + "version": 243, + "versionNonce": 1852461057, + "isDeleted": true, + "boundElements": null, + "updated": 1777571169283, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 328.0710860574868, + 180.6769167545948 + ] + ], + "startBinding": { + "elementId": "mvXUiYUMB7xwzAiVLO5YB", + "mode": "orbit", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "endBinding": { + "elementId": "Xnun7LklmxcCzukBYa7D8", + "mode": "inside", + "fixedPoint": [ + 0.0063976377952755905, + 0.49126476377952755 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "B8k2P4ZYL5nvC1gtJ6Oyz", + "type": "arrow", + "x": 701.7415625436408, + "y": -470.24115748019676, + "width": 153.145064149419, + "height": 119.41605429410771, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a8", + "roundness": { + "type": 2 + }, + "seed": 1726231599, + "version": 96, + "versionNonce": 1923353761, + "isDeleted": false, + "boundElements": null, + "updated": 1777571181756, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -153.145064149419, + 119.41605429410771 + ] + ], + "startBinding": { + "elementId": "bvyM7YE7V0-8pru3U5_-T", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "3H1zwjQX2FmMfxI6gd4f1", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "CGwpgS62HJgWk8K5t1ooZ", + "type": "arrow", + "x": 1395.7483949580392, + "y": -469.41824796795794, + "width": 153.40638208537712, + "height": 118.59314478186883, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a8V", + "roundness": { + "type": 2 + }, + "seed": 350736431, + "version": 193, + "versionNonce": 1741101729, + "isDeleted": false, + "boundElements": null, + "updated": 1777571183643, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -153.40638208537712, + 118.59314478186883 + ] + ], + "startBinding": { + "elementId": "Bg0Ih3UIlOvBTIsxiFn-q", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "uEaFELZegKSFkU51PvFL1", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "V6d1rnkjwz49wpjJ4_YEY", + "type": "arrow", + "x": 716.8412690189389, + "y": -470.24115748019676, + "width": 147.62296508258828, + "height": 119.61332712238402, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "a9", + "roundness": { + "type": 2 + }, + "seed": 1599972353, + "version": 104, + "versionNonce": 1968972705, + "isDeleted": false, + "boundElements": null, + "updated": 1777571181039, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 147.62296508258828, + 119.61332712238402 + ] + ], + "startBinding": { + "elementId": "bvyM7YE7V0-8pru3U5_-T", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "jz1_tt7qFnwCXzqVLz_JR", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "GW4hkPIIusnL2O8GVmmXW", + "type": "arrow", + "x": 1410.9432065138353, + "y": -469.41824796795794, + "width": 147.1714369856345, + "height": 118.7904176101452, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aA", + "roundness": { + "type": 2 + }, + "seed": 1784663617, + "version": 206, + "versionNonce": 801512431, + "isDeleted": false, + "boundElements": null, + "updated": 1777571183643, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 147.1714369856345, + 118.7904176101452 + ] + ], + "startBinding": { + "elementId": "Bg0Ih3UIlOvBTIsxiFn-q", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "qA3X-iErr3Z0hL5Pk0b_e", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "7DNMm94IRpZuVhaIqUTIJ", + "type": "ellipse", + "x": 915.3200229193428, + "y": 0.8843799420457117, + "width": 286.4739648564881, + "height": 286.4739648564881, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aB", + "roundness": { + "type": 2 + }, + "seed": 1645374351, + "version": 389, + "versionNonce": 1855573633, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "Xl3czLV2e8J2zgNSdhXzR" + }, + { + "id": "Ezo2warDhNuwIkuwZ5sgY", + "type": "arrow" + }, + { + "id": "DR02O7UVe-Cbe4fssvaq0", + "type": "arrow" + }, + { + "id": "_STPcK_oFdd0dDf2JL--w", + "type": "arrow" + }, + { + "id": "4V3i77Qt-RT2DM4gGZbpT", + "type": "arrow" + }, + { + "id": "MORBSzkOym4ENTm8L1dIW", + "type": "arrow" + }, + { + "id": "4HzApMyR0vAm1sbs_J2O2", + "type": "arrow" + }, + { + "id": "Q3fq3-CnL2x6EhmE9nKxB", + "type": "arrow" + }, + { + "id": "drq01cOrPn0xbAenUQv_3", + "type": "arrow" + } + ], + "updated": 1777571533546, + "link": null, + "locked": false + }, + { + "id": "Xl3czLV2e8J2zgNSdhXzR", + "type": "text", + "x": 982.4871835312678, + "y": 109.33752077858004, + "width": 152.57196044921875, + "height": 70, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aC", + "roundness": null, + "seed": 232811759, + "version": 268, + "versionNonce": 1379817057, + "isDeleted": false, + "boundElements": null, + "updated": 1777571533546, + "link": null, + "locked": false, + "text": "Valkey In\nMemory DB", + "fontSize": 28, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "7DNMm94IRpZuVhaIqUTIJ", + "originalText": "Valkey In Memory DB", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "fe_di1AxoIIeDQuH-kT7B", + "type": "ellipse", + "x": 1826.8532011389211, + "y": -51.4624060607573, + "width": 286.4739648564881, + "height": 286.4739648564881, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aCG", + "roundness": { + "type": 2 + }, + "seed": 1948408655, + "version": 272, + "versionNonce": 852238127, + "isDeleted": true, + "boundElements": [], + "updated": 1777571164818, + "link": null, + "locked": false + }, + { + "id": "d_RgwMOimicWT_G6dsSG4", + "type": "text", + "x": 1894.020361750846, + "y": 56.99073477577703, + "width": 152.57196044921875, + "height": 70, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aCV", + "roundness": null, + "seed": 440337697, + "version": 161, + "versionNonce": 1189867329, + "isDeleted": true, + "boundElements": null, + "updated": 1777571164818, + "link": null, + "locked": false, + "text": "Valkey In\nMemory DB", + "fontSize": 28, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "fe_di1AxoIIeDQuH-kT7B", + "originalText": "Valkey In Memory DB", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "Ezo2warDhNuwIkuwZ5sgY", + "type": "arrow", + "x": 877.8677719061872, + "y": -179.87783035781274, + "width": 174.8342230399154, + "height": 174.87710926127815, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aD", + "roundness": { + "type": 2 + }, + "seed": 1141057583, + "version": 317, + "versionNonce": 63365697, + "isDeleted": false, + "boundElements": null, + "updated": 1777571533546, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 174.8342230399154, + 174.87710926127815 + ] + ], + "startBinding": { + "elementId": "jz1_tt7qFnwCXzqVLz_JR", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "EfvVEqi2shbTXwA92-MIY", + "type": "arrow", + "x": 549.1079660538082, + "y": -180.0751031860891, + "width": 365.3496682624807, + "height": 267.1281936233261, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aE", + "roundness": { + "type": 2 + }, + "seed": 1493593441, + "version": 81, + "versionNonce": 561176431, + "isDeleted": true, + "boundElements": null, + "updated": 1777571129224, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 365.3496682624807, + 267.1281936233261 + ] + ], + "startBinding": { + "elementId": "3H1zwjQX2FmMfxI6gd4f1", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false + }, + { + "id": "DR02O7UVe-Cbe4fssvaq0", + "type": "arrow", + "x": 553.1777128230146, + "y": -180.0751031860891, + "width": 417.1060558319124, + "height": 203.865619103403, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aF", + "roundness": { + "type": 2 + }, + "seed": 1615286881, + "version": 318, + "versionNonce": 1206382575, + "isDeleted": false, + "boundElements": null, + "updated": 1777571536887, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 417.1060558319124, + 203.865619103403 + ] + ], + "startBinding": { + "elementId": "3H1zwjQX2FmMfxI6gd4f1", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0.23061344380093635 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "_STPcK_oFdd0dDf2JL--w", + "type": "arrow", + "x": 1228.9325780249794, + "y": -180.0751031860891, + "width": 164.79698685842368, + "height": 175.063785353318, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aG", + "roundness": { + "type": 2 + }, + "seed": 318105423, + "version": 271, + "versionNonce": 1007814145, + "isDeleted": false, + "boundElements": null, + "updated": 1777571533546, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -164.79698685842368, + 175.063785353318 + ] + ], + "startBinding": { + "elementId": "uEaFELZegKSFkU51PvFL1", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "4V3i77Qt-RT2DM4gGZbpT", + "type": "arrow", + "x": 1569.2989105885833, + "y": -187.22287143522402, + "width": 418.33381286224426, + "height": 214.1588192386488, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aH", + "roundness": { + "type": 2 + }, + "seed": 1358068385, + "version": 334, + "versionNonce": 1120116193, + "isDeleted": false, + "boundElements": null, + "updated": 1777571533546, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -418.33381286224426, + 214.1588192386488 + ] + ], + "startBinding": { + "elementId": "qA3X-iErr3Z0hL5Pk0b_e", + "mode": "inside", + "fixedPoint": [ + 0.5237268765117683, + 0.9915273002997714 + ] + }, + "endBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0.2560220089979677 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "MORBSzkOym4ENTm8L1dIW", + "type": "arrow", + "x": 1062.3195347735846, + "y": 293.31090723388445, + "width": 175.7932921012448, + "height": 280.2500289719352, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aI", + "roundness": { + "type": 2 + }, + "seed": 426429505, + "version": 332, + "versionNonce": 261941377, + "isDeleted": false, + "boundElements": null, + "updated": 1777571553521, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 175.7932921012448, + 280.2500289719352 + ] + ], + "startBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "endBinding": { + "elementId": "hFxGi5z277K72VFE3y3LH", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": null, + "endArrowhead": "triangle", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "4HzApMyR0vAm1sbs_J2O2", + "type": "arrow", + "x": 1207.6944633254157, + "y": 149.57072492011068, + "width": 571.0740314622185, + "height": 524.6407056531949, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aJ", + "roundness": { + "type": 2 + }, + "seed": 1894041793, + "version": 259, + "versionNonce": 1854691745, + "isDeleted": false, + "boundElements": null, + "updated": 1777571533547, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 571.0740314622185, + 524.6407056531949 + ] + ], + "startBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 1.0000000000000004, + 0.5001 + ] + }, + "endBinding": { + "elementId": "4HF8VczGJGG9qA8x9YHlf", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "startArrowhead": "arrow", + "endArrowhead": "triangle", + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "Q3fq3-CnL2x6EhmE9nKxB", + "type": "arrow", + "x": 909.6423755948912, + "y": 153.9249316134556, + "width": 345.80051315826915, + "height": 595.3474736105456, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aK", + "roundness": { + "type": 2 + }, + "seed": 294601089, + "version": 334, + "versionNonce": 1173519745, + "isDeleted": false, + "boundElements": null, + "updated": 1777571533547, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -345.80051315826915, + 595.3474736105456 + ] + ], + "startBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0, + 0.5001 + ] + }, + "endBinding": { + "elementId": "3bX_ZhdbjR2-nZxSfcd7P", + "mode": "orbit", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "startArrowhead": "arrow", + "endArrowhead": null, + "elbowed": false, + "moveMidPointsWithElement": false + }, + { + "id": "1ZeJioa5o3lxGd1-TpS8i", + "type": "arrow", + "x": 894.4504685459032, + "y": 573.7687054790872, + "width": 89.967989733835, + "height": 308.98737287417566, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aL", + "roundness": { + "type": 2 + }, + "seed": 568115329, + "version": 71, + "versionNonce": 1405619471, + "isDeleted": true, + "boundElements": null, + "updated": 1777571500771, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 89.967989733835, + -308.98737287417566 + ] + ], + "startBinding": { + "elementId": "1KHw6mA3tZ4aeXvAnQCDd", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "endBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "inside", + "fixedPoint": [ + 0.240431138838007, + 0.9219386630930462 + ] + }, + "startArrowhead": "arrow", + "endArrowhead": null, + "elbowed": false + }, + { + "id": "5hyd0OH0Kx-9Y1KN8gJBl", + "type": "arrow", + "x": 698.3737868672458, + "y": 560.2426436606604, + "width": 349.60866456313033, + "height": 82.49110372185282, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aM", + "roundness": { + "type": 2 + }, + "seed": 949326497, + "version": 136, + "versionNonce": 1578841263, + "isDeleted": true, + "boundElements": null, + "updated": 1777571513146, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 185.47764091635963, + -54.62321216551027 + ], + [ + 219.27701011276076, + -82.49110372185282 + ], + [ + 349.60866456313033, + -36.252387067882864 + ] + ], + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false + }, + { + "id": "drq01cOrPn0xbAenUQv_3", + "type": "arrow", + "x": 894.3002573547478, + "y": 573.7687054790872, + "width": 81.32433526030877, + "height": 305.57521955701293, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "aN", + "roundness": { + "type": 2 + }, + "seed": 1367612609, + "version": 128, + "versionNonce": 950609249, + "isDeleted": false, + "boundElements": null, + "updated": 1777571533547, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 81.32433526030877, + -305.57521955701293 + ] + ], + "startBinding": { + "elementId": "1KHw6mA3tZ4aeXvAnQCDd", + "mode": "orbit", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "endBinding": { + "elementId": "7DNMm94IRpZuVhaIqUTIJ", + "mode": "orbit", + "fixedPoint": [ + 0.3257430754337574, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "moveMidPointsWithElement": false + } + ], + "appState": { + "gridSize": 20, + "gridStep": 5, + "gridModeEnabled": false, + "viewBackgroundColor": "#ffffff", + "lockedMultiSelections": {} + }, + "files": {} +} \ No newline at end of file diff --git a/rust_test/test_world/Cargo.toml b/rust_test/test_world/Cargo.toml new file mode 100644 index 0000000..6a1988b --- /dev/null +++ b/rust_test/test_world/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "test_world" +version = "0.1.0" +edition = "2024" + +[dependencies] +tokio = { version = "1", features = ["full"] } +tokio-tungstenite = { version = "0.24", features = ["native-tls"] } +futures-util = "0.3" +url = "2" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +redis = "0.25.0" \ No newline at end of file diff --git a/rust_test/test_world/src/main.rs b/rust_test/test_world/src/main.rs new file mode 100644 index 0000000..1d72876 --- /dev/null +++ b/rust_test/test_world/src/main.rs @@ -0,0 +1,70 @@ +use tokio_tungstenite::{connect_async, tungstenite::protocol::Message}; +use futures_util::StreamExt; +use url::Url; +use serde::{Serialize, Deserialize}; +use redis::Commands; + +// Aster Book Ticker (TOB) +#[derive(Debug, Deserialize, Serialize)] +pub struct BookTickerResponse { + pub stream: String, + pub data: BookTickerData, +} +#[derive(Debug, Deserialize, Serialize)] +pub struct BookTickerData { + #[serde(rename(deserialize = "e"))] + pub event_type: String, + #[serde(rename(deserialize = "u"))] + pub update_id: u64, + #[serde(rename(deserialize = "s"))] + pub symbol: String, + #[serde(rename(deserialize = "b"))] + pub best_bid_price: String, + #[serde(rename(deserialize = "B"))] + pub best_bid_qty: String, + #[serde(rename(deserialize = "a"))] + pub best_ask_price: String, + #[serde(rename(deserialize = "A"))] + pub best_ask_qty: String, + #[serde(rename(deserialize = "T"))] + pub transaction_time: u64, + #[serde(rename(deserialize = "E"))] + pub event_time: u64, +} + +#[tokio::main] +async fn main() { + // Connect to a local Valkey instance + let vk_client = redis::Client::open("redis://localhost:6379/0").unwrap(); + let mut con = vk_client.get_connection().unwrap(); + + let url = Url::parse("wss://fstream.asterdex.com/stream?streams=btcusdt@bookTicker").unwrap(); + let (ws_stream, _) = connect_async(url.as_str()).await.expect("Failed to connect"); + println!("WebSocket client connected"); + + let (_, mut read) = ws_stream.split(); + + while let Some(msg) = read.next().await { + match msg { + Ok(Message::Text(text)) => { + let parsed: BookTickerResponse = serde_json::from_str(&text).expect("Failed to parse JSON"); + println!("Symbol: {} - Bid: {}", parsed.data.symbol, parsed.data.best_bid_price); + let serialized: String = serde_json::to_string(&parsed).map_err(|_| "Serialization failed").expect("Failed to serialize struct"); + // println!("{:?}", serialized); + let _: () = con.set("test_key", serialized).unwrap(); + }, + Ok(Message::Binary(bin)) => println!("[binary] {} bytes", bin.len()), + Ok(Message::Ping(_)) => println!("[ping]"), + Ok(Message::Pong(_)) => println!("[pong]"), + Ok(Message::Close(frame)) => { + println!("[close] {:?}", frame); + break; + } + Ok(Message::Frame(_)) => {} + Err(e) => { + eprintln!("[error] {e}"); + break; + } + } + } +} \ No newline at end of file diff --git a/ws_aster_user.py b/ws_aster_user.py index ad650e7..2a480b8 100644 --- a/ws_aster_user.py +++ b/ws_aster_user.py @@ -144,6 +144,7 @@ async def ws_stream(): Local_Recent_Orders = [t for t in Local_Recent_Orders if t.get('timestamp_arrival', 0) >= lookback_min_ts_ms] VAL_KEY_OBJ: str = json.dumps(obj=Local_Recent_Orders) + VAL_KEY.publish(channel=VK_ORDERS_TRADES, message=VAL_KEY_OBJ) VAL_KEY.set(name=VK_ORDERS_TRADES, value=VAL_KEY_OBJ) await db.insert_df_to_mysql(table_name='fr_aster_user_order_trade', params=new_order_update, CON=CON) @@ -220,6 +221,7 @@ async def ws_stream(): list_for_df_pos.append(position_update) Local_Recent_Positions = utils.upsert_list_of_dicts_by_id(Local_Recent_Positions, position_update, id='symbol', seq_check_field='timestamp_msg') Local_Recent_Positions = [t for t in Local_Recent_Positions if t.get('timestamp_arrival', 0) >= lookback_min_ts_ms] + VAL_KEY.publish(channel=VK_POSITIONS, message=json.dumps(obj=Local_Recent_Positions)) VAL_KEY.set(name=VK_POSITIONS, value=json.dumps(obj=Local_Recent_Positions)) if list_for_df_bal: await db.insert_df_to_mysql(table_name='fr_aster_user_account_bal', params=list_for_df_bal, CON=CON) diff --git a/ws_extended_user.py b/ws_extended_user.py index bccae2f..f22c3db 100644 --- a/ws_extended_user.py +++ b/ws_extended_user.py @@ -105,7 +105,8 @@ async def ws_stream(): LOCAL_RECENT_ORDERS = [t for t in LOCAL_RECENT_ORDERS if t.get('timestamp_arrival', 0) >= LOOKBACK_MIN_TS_MS] VAL_KEY_OBJ = json.dumps(LOCAL_RECENT_ORDERS) - VAL_KEY.set(VK_ORDERS, VAL_KEY_OBJ) + VAL_KEY.publish(channel=VK_ORDERS, message=VAL_KEY_OBJ) + VAL_KEY.set(name=VK_ORDERS, value=VAL_KEY_OBJ) await db.insert_df_to_mysql(table_name='fr_extended_user_order', params=list_for_df, CON=CON) continue case 'TRADE': @@ -197,7 +198,8 @@ async def ws_stream(): LOCAL_RECENT_POSITIONS = [t for t in LOCAL_RECENT_POSITIONS if t.get('timestamp_arrival', 0) >= LOOKBACK_MIN_TS_MS] VAL_KEY_OBJ = json.dumps(LOCAL_RECENT_POSITIONS) - VAL_KEY.set(VK_POSITIONS, VAL_KEY_OBJ) + VAL_KEY.publish(channel=VK_POSITIONS, message=VAL_KEY_OBJ) + VAL_KEY.set(name=VK_POSITIONS, value=VAL_KEY_OBJ) await db.insert_df_to_mysql(table_name='fr_extended_user_position', params=list_for_df, CON=CON) continue case _: