graph TD subgraph Somnia CLOB Infrastructure ["Somnia Tokyo Testnet • DreamDEX CLOB"] OrderBook[(ETH-PERP / BTC-PERP Depth)] --> MarketData[Depth & Spread Streamer] OrderContract["placeOrder(bool isBid, ...)"] end subgraph Autonomous Agent Core ["DreamDEX Agent Bot Core"] MarketData --> Strategy[DreamDEX Strategy Agent] SessionKey[Session Key Operator] -->|grantOperator Check| Engine[DreamDEX Order Engine] Strategy -->|OPEN_LONG / OPEN_SHORT| Engine Engine -->|Execute Order| OrderContract OrderContract -->|Execution Receipt| PositionTracker[Position & Margin State] PositionTracker --> RiskManager[DreamDEX Risk Manager] RiskManager -->|Liquidation Buffer Alert| Strategy RiskManager -->|AUTO_DELEVERAGE / LIQUIDATE| Engine end