@okx_ai/okx-trade-mcp 1.2.7-beta.2 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3013,8 +3013,12 @@ function registerDcaTools() {
3013
3013
  slPct: { type: "string", description: "Stop-loss ratio, 0.05=5%" },
3014
3014
  slMode: { type: "string", enum: ["limit", "market"] },
3015
3015
  allowReinvest: { type: "boolean", description: "Default true" },
3016
- triggerStrategy: { type: "string", enum: ["instant", "price"] },
3017
- triggerPx: { type: "string", description: "Need if triggerStrategy=price" },
3016
+ triggerStrategy: { type: "string", enum: ["instant", "price", "rsi"], description: "contract_dca: instant|price|rsi; spot_dca: instant|rsi. Default: instant" },
3017
+ triggerPx: { type: "string", description: "Need if triggerStrategy=price (contract_dca only)" },
3018
+ triggerCond: { type: "string", enum: ["cross_up", "cross_down"], description: "Required when triggerStrategy=rsi. Optional when triggerStrategy=price" },
3019
+ thold: { type: "string", description: "RSI threshold (e.g. '30'). Need if triggerStrategy=rsi" },
3020
+ timeframe: { type: "string", description: "RSI timeframe (e.g. '15m'). Need if triggerStrategy=rsi" },
3021
+ timePeriod: { type: "string", description: "RSI period. Default '14'. Optional when triggerStrategy=rsi" },
3018
3022
  algoClOrdId: { type: "string", description: "Client order ID, 1-32 chars" },
3019
3023
  // Backend expects boolean, but kept as string for backward compatibility with older clients.
3020
3024
  reserveFunds: { type: "string", description: "'true' or 'false', default 'true'" },
@@ -3033,12 +3037,28 @@ function registerDcaTools() {
3033
3037
  });
3034
3038
  }
3035
3039
  const triggerStrategy = readString(args, "triggerStrategy") ?? "instant";
3040
+ if (triggerStrategy === "price" && algoOrdType === "spot_dca") {
3041
+ throw new OkxApiError("triggerStrategy 'price' is only supported for contract_dca. spot_dca supports: instant, rsi", {
3042
+ code: "VALIDATION",
3043
+ endpoint: `${BASE}/create`
3044
+ });
3045
+ }
3036
3046
  const triggerParam = {
3037
3047
  triggerAction: "start",
3038
3048
  triggerStrategy
3039
3049
  };
3040
3050
  if (triggerStrategy === "price") {
3041
3051
  triggerParam["triggerPx"] = requireString(args, "triggerPx");
3052
+ const triggerCond = readString(args, "triggerCond");
3053
+ if (triggerCond) {
3054
+ triggerParam["triggerCond"] = triggerCond;
3055
+ }
3056
+ } else if (triggerStrategy === "rsi") {
3057
+ triggerParam["triggerCond"] = requireString(args, "triggerCond");
3058
+ triggerParam["thold"] = requireString(args, "thold");
3059
+ triggerParam["timeframe"] = requireString(args, "timeframe");
3060
+ const timePeriod = readString(args, "timePeriod");
3061
+ triggerParam["timePeriod"] = timePeriod ?? "14";
3042
3062
  }
3043
3063
  const maxSafetyOrds = requireString(args, "maxSafetyOrds");
3044
3064
  if (Number(maxSafetyOrds) > 0) {
@@ -7050,7 +7070,7 @@ var _require = createRequire(import.meta.url);
7050
7070
  var pkg = _require("../package.json");
7051
7071
  var SERVER_NAME = "okx-trade-mcp";
7052
7072
  var SERVER_VERSION = pkg.version;
7053
- var GIT_HASH = true ? "c270a0b" : "dev";
7073
+ var GIT_HASH = true ? "475621d" : "dev";
7054
7074
 
7055
7075
  // src/server.ts
7056
7076
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";