| """ |
| Demo script β Run the agent in simulation mode for quick demonstration. |
| """ |
|
|
| import asyncio |
| import json |
| import logging |
| import sys |
| import os |
|
|
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
|
|
| from agent.main import YieldRouterAgent, setup_logging |
|
|
|
|
| async def run_demo(): |
| setup_logging() |
| logger = logging.getLogger("demo") |
| |
| logger.info("=" * 60) |
| logger.info("Dynamic RWA Yield Router β Demo Mode") |
| logger.info("=" * 60) |
| |
| |
| agent = YieldRouterAgent( |
| wallet_address="0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18", |
| initial_capital=100_000.0, |
| ) |
| |
| |
| logger.info("\nπ Starting 3 demo cycles...\n") |
| await agent.run( |
| interval_seconds=2, |
| max_cycles=3, |
| generate_reports=True, |
| report_interval_cycles=3, |
| ) |
| |
| |
| state = agent.state.to_dict() |
| print("\n" + "=" * 60) |
| print("π FINAL STATE") |
| print("=" * 60) |
| print(json.dumps(state, indent=2)) |
| |
| |
| risk = agent.risk_manager.get_risk_summary() |
| print("\nπ‘οΈ RISK SUMMARY") |
| print(json.dumps(risk, indent=2, default=str)) |
| |
| |
| if agent.strategy_reporter.report_history: |
| report = agent.strategy_reporter.report_history[-1] |
| print("\nπ STRATEGY REPORT") |
| print(report.full_report) |
|
|
|
|
| if __name__ == "__main__": |
| asyncio.run(run_demo()) |
|
|