Fix Binance linear market context

This commit is contained in:
Azimkin
2026-09-19 17:41:42 +02:00
parent 93cafe8160
commit 0df55d295c
4 changed files with 69 additions and 26 deletions

View File

@@ -5,7 +5,7 @@ from zoneinfo import ZoneInfo
import pytest
from llm_trade_bot.agent import AgentTools
from llm_trade_bot.agent import AgentTools, _has_existing_idea
from llm_trade_bot.config import (
AppConfig,
BraveConfig,
@@ -102,3 +102,22 @@ async def test_pause_blocks_entry_from_running_session(tmp_path):
)
finally:
await database.close()
def test_seeded_spot_balance_does_not_block_new_agent_entry():
state = {
"wallets": {"spot": {"balances": [{"asset": "SOL", "free": "4", "locked": "0"}]}},
"positions": [],
"open_orders": [],
}
assert _has_existing_idea(state, "spot", "SOLUSDT") is False
state["open_orders"] = [
{
"category": "spot",
"symbol": "SOLUSDT",
"protective": True,
"client_id": "ltb-12-abcd-tp",
}
]
assert _has_existing_idea(state, "spot", "SOLUSDT") is True