@candledottv/mcp 0.10.17 → 0.10.18

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -151,7 +151,7 @@ import { lstat, open, realpath } from "node:fs/promises";
151
151
  import { dirname, isAbsolute, relative, sep } from "node:path";
152
152
 
153
153
  // src/version.ts
154
- var SERVER_VERSION = "0.10.17";
154
+ var SERVER_VERSION = "0.10.18";
155
155
 
156
156
  // src/update-notice.ts
157
157
  var PLAIN_VERSION = /^\d+\.\d+\.\d+$/;
@@ -1105,6 +1105,12 @@ function checkActionIntent(action, intent) {
1105
1105
  const trigger = leg.t?.trigger;
1106
1106
  if (leg.a !== first.a || leg.b !== !buy || leg.r !== true || decimal(leg.s) !== decimal(p.size) || trigger?.tpsl !== kind || trigger.isMarket !== true || decimal(trigger.triggerPx) !== decimal(p[field]))
1107
1107
  return "trigger side, size, reduce-only flag or price does not match the request";
1108
+ const px = decimal(leg.p) ?? 0n;
1109
+ const triggerPx = decimal(trigger.triggerPx) ?? 0n;
1110
+ const bound = BigInt(HYPERLIQUID_TPSL_SLIPPAGE_BPS + HYPERLIQUID_MID_DRIFT_BPS);
1111
+ const within = leg.b === true ? px * 10000n <= triggerPx * (10000n + bound) : px * 10000n >= triggerPx * (10000n - bound);
1112
+ if (triggerPx <= 0n || !within)
1113
+ return "trigger order price is outside its slippage of the trigger price";
1108
1114
  }
1109
1115
  } else {
1110
1116
  if (list.length !== 1)
@@ -1146,6 +1152,7 @@ async function hyperliquidCloseOrder(fetcher, network, address, params) {
1146
1152
  }
1147
1153
  var HYPERLIQUID_DEFAULT_SLIPPAGE_BPS = 100;
1148
1154
  var HYPERLIQUID_MID_DRIFT_BPS = 100;
1155
+ var HYPERLIQUID_TPSL_SLIPPAGE_BPS = 500;
1149
1156
  async function hyperliquidOrderMarket(fetcher, network, address, method, params) {
1150
1157
  const read = async (body) => {
1151
1158
  const res = await fetcher(HYPERLIQUID_INFO_URLS[network], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candledottv/mcp",
3
- "version": "0.10.17",
3
+ "version": "0.10.18",
4
4
  "description": "MCP server for the Candle agent rail: launch tokens, read markets, report activity",
5
5
  "type": "module",
6
6
  "license": "MIT",