From 20dd57f77829952ec1ac7fb451590cd5fffd027f Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 24 Jun 2026 21:34:31 +0800
Subject: [PATCH] fix(grid): 修复网格元素索引并发访问问题

---
 src/main/java/com/xcong/excoin/modules/okxApi/OkxWebSocketClientManager.java |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/okxApi/OkxWebSocketClientManager.java b/src/main/java/com/xcong/excoin/modules/okxApi/OkxWebSocketClientManager.java
index 6eb12b2..0ea9325 100644
--- a/src/main/java/com/xcong/excoin/modules/okxApi/OkxWebSocketClientManager.java
+++ b/src/main/java/com/xcong/excoin/modules/okxApi/OkxWebSocketClientManager.java
@@ -1,7 +1,7 @@
 package com.xcong.excoin.modules.okxApi;
 
 import com.xcong.excoin.modules.okxApi.wsHandler.handler.MarkPriceOkxChannelHandler;
-import com.xcong.excoin.modules.okxApi.wsHandler.handler.OrderAlgoOkxChannelHandler;
+import com.xcong.excoin.modules.okxApi.wsHandler.handler.OrdersOkxChannelHandler;
 import com.xcong.excoin.modules.okxApi.wsHandler.handler.PositionsOkxChannelHandler;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
@@ -25,7 +25,7 @@
  * <ol>
  *   <li>MarkPriceOkxChannelHandler — 公开频道,标记价格 → onKline() + setMarkPrice()</li>
  *   <li>PositionsOkxChannelHandler — 私有频道,仓位 → onPositionUpdate()</li>
- *   <li>OrderAlgoOkxChannelHandler — 私有频道,条件单状态 → onAutoOrder()</li>
+ *   <li>OrdersOkxChannelHandler — 私有频道,订单成交(含algoId) → onAutoOrder()</li>
  * </ol>
  *
  * <h3>销毁顺序({@code @PreDestroy})</h3>
@@ -58,17 +58,17 @@
                     .leverage("100")
                     .marginMode("cross")
                     .positionMode("long_short_mode")
-                    .gridRate(new BigDecimal("0.003"))
+                    .gridRate(new BigDecimal("0.0025"))
                     .expectedProfit(new BigDecimal("25"))
                     .maxLoss(new BigDecimal("15"))
-                    .baseQuantity("15")
-                    .quantity("15")
+                    .baseQuantity("1")
+                    .quantity("1")
                     .restartGridSpan(6)
                     .maxPositionSize(2)
                     .priceScale(2)
                     .contractMultiplier(new BigDecimal("0.01"))
                     .unrealizedPnlPriceMode(OkxConfig.PnLPriceMode.LAST_PRICE)
-                    .isProduction(true)
+                    .isProduction(false)
                     .reopenMaxRetries(3)
                     .build();
 
@@ -85,8 +85,8 @@
             // 私有频道:仓位
             wsClient.addPrivateHandler(new PositionsOkxChannelHandler(
                     config, gridTradeService));
-            // 私有频道:条件单
-            wsClient.addPrivateHandler(new OrderAlgoOkxChannelHandler(
+            // 私有频道:条件单(orders 频道含 algoId,可追溯到源条件单)
+            wsClient.addPrivateHandler(new OrdersOkxChannelHandler(
                     config, gridTradeService));
 
             gridTradeService.setWsClient(wsClient);

--
Gitblit v1.9.1