-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_strategy_engine.py
More file actions
47 lines (40 loc) · 1.17 KB
/
test_strategy_engine.py
File metadata and controls
47 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from core.strategy_engine import StrategyEngine, PoolCandidate
from core.strategy_context import StrategyContext
def main() -> None:
# Contexte global "favorable" de test
ctx = StrategyContext(
timestamp="2025-11-15T10:00:00Z",
label="favorable",
ai_score=0.7,
confiance=0.8,
resume="Contexte de test",
metrics={},
nb_signaux=3,
)
# Deux pools factices pour tester le tri
pools = [
PoolCandidate(
pool_id="poolA",
platform="dex1",
chain="polygon",
symbols="USDC-WETH",
tvl=1_000_000,
apr=50.0,
),
PoolCandidate(
pool_id="poolB",
platform="dex1",
chain="polygon",
symbols="USDC-MATIC",
tvl=500_000,
apr=80.0,
),
]
engine = StrategyEngine(config_path="strategy_config.json", dry_run=True)
result = engine.run(pools=pools, context=ctx)
print("=== CONTEXTE ===")
print(result["context"])
print("=== CANDIDATES (ordre) ===")
print([c["pool_id"] for c in result["candidates"]])
if __name__ == "__main__":
main()