### 统一适配器接口(ExchangeAdapter)规范 — 目标 — - 统一 Binance/Aster/Pacifica 等接入层接口,隐藏签名、路径与字段差异,支持多账户并行。 — 接口(TypeScript) — ``` name(): string time(): Promise symbols(): Promise balances(): Promise<{ asset: string; total: string; free: string }[]> positions(): Promise<{ symbol: string; side: 'LONG'|'SHORT'; qty: string; entryPrice: string; unrealizedPnl: string; leverage?: number }[]> placeOrder(req): Promise cancelOrder(symbol: string, orderId: string): Promise cancelAll(symbol: string): Promise getOrder(symbol: string, orderId: string): Promise openOrders(symbol: string): Promise leverage?(symbol: string, lev: number): Promise depth(symbol: string, limit?: number): Promise<{ bids: {price:string;qty:string}[]; asks: {price:string;qty:string}[]; ts: number }> ws(): EventEmitter ``` — 统一约定 — - 符号:Pacifica 使用基础符号(如 `BTC`),Aster 使用 `BTCUSDT`;适配器内部规范化。 - 返回值:数量/价格以字符串表示,避免精度丢失;时间戳为毫秒。 - 错误:网络 429/5xx 由底层客户端做指数退避;业务错误向上抛出,策略层决定回退。 — 事件 — - 推荐事件:`depth`、`orders`、`trades`、`balance`、`account_info`、`account_positions`、`ws_error`、`ws_close`。 - 多账户聚合:由 `AccountManager` 在事件上附加 `{ exchange, accountId }` 标签。