From 012bd1f58e8e1c37caeea774ee181f754374e7d5 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Fri, 05 Jun 2026 11:29:44 +0800
Subject: [PATCH] refactor(api): 移除Huobi API相关代码并简化应用配置

---
 src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxPositionsChannelHandler.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxPositionsChannelHandler.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxPositionsChannelHandler.java
index 5749544..e3aaed2 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxPositionsChannelHandler.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxPositionsChannelHandler.java
@@ -69,11 +69,16 @@
             if (data == null || data.isEmpty()) return true;
             for (int i = 0; i < data.size(); i++) {
                 JSONObject pos = data.getJSONObject(i);
-                if (!instId.equals(pos.getString("instId"))) continue;
+                String posInstId = pos.getString("instId");
+                if (posInstId == null || !instId.equals(posInstId)) continue;
 
                 String posSide = pos.getString("posSide");
-                BigDecimal posSize = new BigDecimal(pos.getString("pos"));
-                BigDecimal avgPx = new BigDecimal(pos.getString("avgPx"));
+                String posStr = pos.getString("pos");
+                String avgPxStr = pos.getString("avgPx");
+                if (posStr == null || posStr.isEmpty() || avgPxStr == null || avgPxStr.isEmpty()) continue;
+
+                BigDecimal posSize = new BigDecimal(posStr);
+                BigDecimal avgPx = new BigDecimal(avgPxStr);
                 log.info("[OKX-WS] 持仓更新, instId:{}, posSide:{}, pos:{}, avgPx:{}",
                         instId, posSide, posSize, avgPx);
 

--
Gitblit v1.9.1