Administrator
19 hours ago 6a51f45e6a00b65a9e7b0b0707b453c11311f3ef
src/main/java/com/xcong/excoin/modules/okxApi/OkxConfig.java
@@ -48,6 +48,7 @@
    private final String contract;
    private final String leverage;
    private final String marginMode;
    private final String posMode;
    private final BigDecimal gridRate;
    private final BigDecimal overallTp;
    private final BigDecimal maxLoss;
@@ -65,6 +66,7 @@
        this.contract = builder.contract;
        this.leverage = builder.leverage;
        this.marginMode = builder.marginMode;
        this.posMode = builder.posMode;
        this.gridRate = builder.gridRate;
        this.overallTp = builder.overallTp;
        this.maxLoss = builder.maxLoss;
@@ -90,6 +92,14 @@
                : "wss://wspap.okx.com:8443/ws/v5/private";
    }
    // ==================== REST 地址 ====================
    public String getRestBaseUrl() {
        return isProduction
                ? "https://www.okx.com"
                : "https://www.okx.cab";
    }
    // ==================== 认证信息 ====================
    public String getApiKey() { return apiKey; }
@@ -104,6 +114,7 @@
    // ==================== 持仓配置 ====================
    public String getMarginMode() { return marginMode; }
    public String getPosMode() { return posMode; }
    // ==================== 策略参数 ====================
@@ -137,6 +148,7 @@
        private String contract = "BTC-USDT-SWAP";
        private String leverage = "100";
        private String marginMode = "cross";
        private String posMode = "long_short_mode";
        private BigDecimal gridRate = new BigDecimal("0.0035");
        private BigDecimal overallTp = new BigDecimal("5");
        private BigDecimal maxLoss = new BigDecimal("15");
@@ -153,6 +165,7 @@
        public Builder contract(String contract) { this.contract = contract; return this; }
        public Builder leverage(String leverage) { this.leverage = leverage; return this; }
        public Builder marginMode(String marginMode) { this.marginMode = marginMode; return this; }
        public Builder posMode(String posMode) { this.posMode = posMode; return this; }
        public Builder gridRate(BigDecimal gridRate) { this.gridRate = gridRate; return this; }
        public Builder overallTp(BigDecimal overallTp) { this.overallTp = overallTp; return this; }
        public Builder maxLoss(BigDecimal maxLoss) { this.maxLoss = maxLoss; return this; }