From b6bc83543f007d1295cf7cfe46e4991b7f2a8cc4 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 02 Jun 2026 13:51:48 +0800
Subject: [PATCH] fix(okxNewPrice): 解决WebSocket连接超时问题

---
 src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxAlgoOrdersChannelHandler.java |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxAlgoOrdersChannelHandler.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxAlgoOrdersChannelHandler.java
index 11114d6..852eeaa 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxAlgoOrdersChannelHandler.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxAlgoOrdersChannelHandler.java
@@ -18,12 +18,10 @@
     private static final String CHANNEL_NAME = "orders-algo";
 
     private final String instId;
-    private final String instFamily;
     private final OkxGridTradeService gridTradeService;
 
     public OkxAlgoOrdersChannelHandler(String instId, OkxGridTradeService gridTradeService) {
         this.instId = instId;
-        this.instFamily = instId.contains("-") ? instId.substring(0, instId.lastIndexOf("-")) : instId;
         this.gridTradeService = gridTradeService;
     }
 
@@ -35,14 +33,13 @@
         JSONObject msg = new JSONObject();
         JSONObject arg = new JSONObject();
         arg.put("channel", CHANNEL_NAME);
-        arg.put("instType", "SWAP");
-        arg.put("instFamily", instFamily);
+        arg.put("instId", instId);
         msg.put("op", "subscribe");
         JSONArray args = new JSONArray();
         args.add(arg);
         msg.put("args", args);
         ws.send(msg.toJSONString());
-        log.info("[OKX-WS] {} 订阅成功, instFamily:{}", CHANNEL_NAME, instFamily);
+        log.info("[OKX-WS] {} 订阅成功, instId:{}", CHANNEL_NAME, instId);
     }
 
     @Override
@@ -50,8 +47,7 @@
         JSONObject msg = new JSONObject();
         JSONObject arg = new JSONObject();
         arg.put("channel", CHANNEL_NAME);
-        arg.put("instType", "SWAP");
-        arg.put("instFamily", instFamily);
+        arg.put("instId", instId);
         msg.put("op", "unsubscribe");
         JSONArray args = new JSONArray();
         args.add(arg);

--
Gitblit v1.9.1