diff --git a/bot.py b/bot.py index f8e82d5..de9fbc5 100644 --- a/bot.py +++ b/bot.py @@ -142,6 +142,8 @@ async def main(): max_buy_num = alarm_info.base_asset_scale else: max_buy_num = alarm_info.quote_asset_scale + + max_buy_num = min(max_buy_num, alarm.remain_scale) except Exception as e: logger.error(f"Error in estimate wind {e}") continue diff --git a/mariadb_connector.py b/mariadb_connector.py index 24f43a8..a946747 100644 --- a/mariadb_connector.py +++ b/mariadb_connector.py @@ -138,10 +138,7 @@ async def update_alarm_to_db(alarms: list[Alarm]): VALUES (%s, %s, %s, %s, %s, %s) ON DUPLICATE KEY UPDATE state = VALUES(state), - price = VALUES(price), - is_mine = VALUES(is_mine), - remain_scale = VALUES(remain_scale), - created_at = VALUES(created_at) + remain_scale = VALUES(remain_scale) """ insert_list = [] for alarm in alarms: