From 0c34623df809cda99ec212cef49cc9fddb458598 Mon Sep 17 00:00:00 2001 From: "Vasily.onl" Date: Wed, 30 Jul 2025 15:12:22 +0800 Subject: [PATCH] memory optimisation --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index b13cdd1..b418ded 100644 --- a/main.py +++ b/main.py @@ -9,8 +9,8 @@ import signal import queue latest_book = {'bids': [], 'asks': [], 'timestamp': None} -book_history = deque() -trade_history = deque() +book_history = deque(maxlen=200) # Keep last 100 book updates (~20-60 seconds) +trade_history = deque(maxlen=500) # Keep last 1000 trades (~2-10 minutes) TRADE_HISTORY_SECONDS = 60 BOOK_HISTORY_SECONDS = 5