felix-mcp 2.0.139 → 2.0.140

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/README.md CHANGED
@@ -9,7 +9,7 @@ previews, places and manages orders across crypto perpetuals, prediction
9
9
  markets and options, runs strategies, and moves money between venues, with
10
10
  your keys on your own computer. Orders are live by default.
11
11
 
12
- Package version: `felix-mcp@2.0.139`. Install with `felix-mcp@latest` so you
12
+ Package version: `felix-mcp@2.0.140`. Install with `felix-mcp@latest` so you
13
13
  always run the newest build; `get_status` tells you when an update is out.
14
14
 
15
15
  ## Quick start
@@ -70,7 +70,7 @@ felix-keys --help
70
70
  ```
71
71
 
72
72
  To build from a checkout instead: `npm ci`, `npm pack`, then
73
- `npm install --global ./felix-mcp-2.0.139.tgz`.
73
+ `npm install --global ./felix-mcp-2.0.140.tgz`.
74
74
 
75
75
  ### 2. Set up keys locally
76
76
 
@@ -349,6 +349,25 @@ Owner-controlled off-device recovery is optional and separate from normal
349
349
  onboarding. Felix cannot recover a lost owner key and will not replace an
350
350
  existing identity silently.
351
351
 
352
+ ### If the backup file is missing
353
+
354
+ If `get_custody_recovery_status` reports the backup as missing (for example the
355
+ file was moved or deleted), your keys still work, but recreate the backup. Run
356
+ this yourself in a terminal on the same computer:
357
+
358
+ ```bash
359
+ npx -y --package felix-mcp@latest felix-keys backup
360
+ ```
361
+
362
+ It writes a new encrypted backup to your Documents folder (add
363
+ `--output /absolute/path/felix-backup.json` to choose the file). It asks you to
364
+ confirm on screen and never prints a key, so an agent cannot run it for you.
365
+ Then call `get_custody_recovery_status` again and expect `ready: true`.
366
+
367
+ On Linux without a keyring, keys live in an encrypted file. Also run
368
+ `felix-keys export-recovery-code` once and keep the code somewhere off the
369
+ computer.
370
+
352
371
  ## Account binding and keys
353
372
 
354
373
  `create_account` switches the MCP session to that child account. The selected
@@ -427,8 +446,46 @@ the first failure, so a batch is not an atomic exposure basket.
427
446
  Filled orders return `position_id`. Use it with `close_position`. Use
428
447
  `cancel_order` only for an open resting order.
429
448
 
449
+ ### Algo orders (TWAP, iceberg, scale, trailing stop)
450
+
451
+ Felix runs these for you on your API key. Every order they send is a live
452
+ market order under the key's limits, mandate and risk checks, so they move real
453
+ money until they finish, expire or are cancelled. There is no simulation mode
454
+ for them yet; start small.
455
+
456
+ | Tool | What it does | Required |
457
+ |---|---|---|
458
+ | `start_twap` | Spreads `size_usd` evenly over `duration_minutes` | `duration_minutes` |
459
+ | `start_iceberg` | Sends `clip_usd` clips one at a time, only while the price is at or better than `price_limit` | `clip_usd`, `price_limit` |
460
+ | `start_scale_order` | Splits `size_usd` into `steps` orders across `price_from` to `price_to` | `steps`, `price_from`, `price_to` |
461
+ | `start_trailing_stop` | Follows the price and closes `size_usd` when it gives back `trail_percent` from its best level; reduce-only | `trail_percent` |
462
+
463
+ - `price_limit` on an iceberg is a send condition, not a fill cap. Each fill is
464
+ bounded by `slippage_bps` from the quote at send time (iceberg default 25).
465
+ - For a trailing stop, `side` is the closing side: `sell` closes a long, `buy`
466
+ closes a short. It never opens or flips a position.
467
+ - Every start needs an `idempotency_key`. The same key always returns the same
468
+ order, so if an answer is unclear, retry with the same key, never a new one.
469
+ - `get_twap` reads or lists any algo order; `cancel_twap` stops any of them. An
470
+ order already being sent at cancel time still counts, so read again after a
471
+ few seconds for the final `filled_usd`.
472
+ - At most 10 algo orders run per account at once.
473
+
474
+ ### When trading needs setup
475
+
476
+ If an order answers `setup_required: true`, the account's trading authorization
477
+ is not in place yet and nothing was sent. Follow the hint: usually finish
478
+ `create_account` with its original `idempotency_key`. If the answer is
479
+ `retryable: true` (Felix is still registering the authorization), retry the same
480
+ request with the same key after a few seconds.
481
+
430
482
  ## Money movement and recovery
431
483
 
484
+ `get_status` shows `money_moves_paused: true` while Felix briefly pauses new
485
+ money moves (for example during a release). Trading keeps working. Moves made
486
+ then answer `arc_admission_frozen` with `money_moved: false`; retry shortly
487
+ with the same `idempotency_key`.
488
+
432
489
  `get_money_map` is the canonical money view. It labels scope, completeness,
433
490
  freshness, unavailable sources, reserved balances, and whether the total is
434
491
  partial. Never interpret unavailable as zero.
@@ -18,7 +18,7 @@ then creates the identity and loads it into the session with no restart.
18
18
  Or let your AI agent run this single command:
19
19
 
20
20
  ~~~bash
21
- npx -y --package felix-mcp@2.0.139 felix-keys onboard --accept-terms --client claude
21
+ npx -y --package felix-mcp@2.0.140 felix-keys onboard --accept-terms --client claude
22
22
  ~~~
23
23
 
24
24
  After the user reviews the terms and explicitly authorizes acceptance, the agent
package/dist/index.js CHANGED
@@ -128,7 +128,7 @@ export function validatedApiBase(raw = process.env.FELIX_API_URL || `https://${O
128
128
  return parsed.origin;
129
129
  }
130
130
  const API = validatedApiBase();
131
- const MCP_VERSION = "2.0.139";
131
+ const MCP_VERSION = "2.0.140";
132
132
  // MCP_UPDATE_NOTICE_20261123: a user on an old build hears about it (with the exact command) before a retired
133
133
  // route fails mid-workflow. Only the public npm "latest" record is read; nothing about the user is sent.
134
134
  // Loopback and custom API hosts (tests, staging) stay offline unless FELIX_MCP_UPDATE_URL is set.
@@ -2025,6 +2025,12 @@ async function arcTransferPrecheck() {
2025
2025
  }
2026
2026
  return undefined;
2027
2027
  }
2028
+ // NOT_A_DEPOSIT_ADDRESS_20261124: a tester relayed a Polygon owner/venue address to the owner as "where to deposit".
2029
+ // Every address a read tool returns that is not the Arc deposit flow says so, and names the right flow.
2030
+ const ACCOUNT_DEPOSIT_GUIDANCE = {
2031
+ not_an_account_deposit_address: true,
2032
+ account_deposits: "Fund a Felix account only through get_deposit_address and create_deposit: they give a one-time payment address for the token you pay with, and the money settles as USDC in the account's Arc home. Never send money to this address to fund or activate an account.",
2033
+ };
2028
2034
  // ARC_FIRST_DEPOSIT_MCP_20261117: a new account funds its Arc home exactly like app.felix.trade (Relay deposit into
2029
2035
  // the account's own CREATE2 Arc home Safe). The MCP never hands out the owner EOA on Polygon as a deposit address.
2030
2036
  function arcFundingGate(accountId, funding) {
@@ -4615,7 +4621,7 @@ async function fundMarketPrecheck(venue, amountUsd, resuming, autoSwapNativeUsdc
4615
4621
  ? "An owner source balance could not be read"
4616
4622
  : `Funding $${amountUsd.toFixed(2)} needs $${plan.required_usd.toFixed(2)} on one owner source `
4617
4623
  + `($${networkFeeUsd.toFixed(2)} network fee included)`;
4618
- return markMoneyNotStarted(clientError("insufficient_owner_balance", `${why}; ${sources}.`, "Add USDC to the owner wallet on Arbitrum (or USDC.e on Polygon), or reduce amount_usd. No workflow was started.", {
4624
+ return markMoneyNotStarted(clientError("insufficient_owner_balance", `${why}; ${sources}.`, "The owner wallet has too little for this older funding route. Do not send money to the owner wallet: fund the account through get_deposit_address and create_deposit (it settles in the Arc home), then move it to the venue with fund_hypercore_from_arc or fund_polymarket_from_arc after use_child_account (the launcher account uses arc_home_fund_venue). Or reduce amount_usd. No workflow was started.", {
4619
4625
  reason_code: plan.reason,
4620
4626
  required_usd: plan.required_usd,
4621
4627
  network_fee_usd: networkFeeUsd,
@@ -4627,7 +4633,7 @@ async function fundMarketPrecheck(venue, amountUsd, resuming, autoSwapNativeUsdc
4627
4633
  + `${fmt(arbitrumAvailable)} USDC on Arbitrum`;
4628
4634
  return markMoneyNotStarted(clientError("insufficient_owner_balance", `Funding $${amountUsd.toFixed(2)} requires about $${plan.required_usd.toFixed(2)} on one owner wallet `
4629
4635
  + `($${amountUsd.toFixed(2)} + $${networkFeeUsd.toFixed(2)} network fee `
4630
- + `+ $${FUNDING_GAS_BUFFER_USD.toFixed(2)} gas buffer); ${sources}.`, "Deposit either Polygon USDC or USDC.e to the owner wallet, or reduce amount_usd. No workflow was started."));
4636
+ + `+ $${FUNDING_GAS_BUFFER_USD.toFixed(2)} gas buffer); ${sources}.`, "The owner wallet has too little for this older funding route. Do not send money to the owner wallet: fund the account through get_deposit_address and create_deposit (it settles in the Arc home), then move it to the venue with fund_hypercore_from_arc or fund_polymarket_from_arc after use_child_account (the launcher account uses arc_home_fund_venue). Or reduce amount_usd. No workflow was started."));
4631
4637
  }
4632
4638
  return undefined;
4633
4639
  }
@@ -12170,7 +12176,7 @@ async function ensureNativeUsdcFundingSource(venue, amountUsd, workflowKey, cont
12170
12176
  return markMoneyNotStarted(balances);
12171
12177
  const plan = planNativeUsdcFunding(venue, amountUsd, balances);
12172
12178
  if (!plan.sufficient) {
12173
- return markMoneyNotStarted(clientError("insufficient_owner_balance", `Funding requires about $${plan.required_usd.toFixed(2)} across an eligible owner source.`, "Deposit Polygon USDC or USDC.e, or reduce amount_usd. Nothing was moved."));
12179
+ return markMoneyNotStarted(clientError("insufficient_owner_balance", `Funding requires about $${plan.required_usd.toFixed(2)} across an eligible owner source.`, "The owner wallet has too little for this older funding route. Do not send money to the owner wallet: fund the account through get_deposit_address and create_deposit (it settles in the Arc home), then move it to the venue with fund_hypercore_from_arc or fund_polymarket_from_arc after use_child_account (the launcher account uses arc_home_fund_venue). Or reduce amount_usd. Nothing was moved."));
12174
12180
  }
12175
12181
  if (plan.source !== "native_usdc") {
12176
12182
  const output = { ok: true, converted: false, funding_source: plan.source };
@@ -14551,21 +14557,21 @@ const TOOLS = [
14551
14557
  },
14552
14558
  {
14553
14559
  name: "get_local_wallet",
14554
- description: "Show the public address of the client-held launcher or deterministically derived child owner key. The private key is never returned.",
14560
+ description: "Show the public signing address of the client-held launcher or deterministically derived child owner key. The private key is never returned. This is NOT a deposit address: fund accounts only with get_deposit_address and create_deposit (money settles in the Arc home).",
14555
14561
  inputSchema: schema({
14556
14562
  account_id: stringProp("Optional child account UUID whose owner address should be derived locally.", undefined, { pattern: UUID_RE.source }),
14557
14563
  }),
14558
14564
  },
14559
14565
  {
14560
14566
  name: "get_polymarket_wallet",
14561
- description: "Read the caller-owned Polymarket deposit wallet and setup state without deploying, approving, signing, or spending gas. Pass account_id to inspect an owned child account instead of the active one.",
14567
+ description: "Read the caller-owned Polymarket trading wallet (on Polygon) and setup state without deploying, approving, signing, or spending gas. Pass account_id to inspect an owned child account instead of the active one. This is NOT where to fund an account: deposits go through get_deposit_address and create_deposit into the Arc home, and Polymarket is funded from the Arc home with fund_polymarket_from_arc.",
14562
14568
  inputSchema: schema({
14563
14569
  account_id: stringProp("Optional owned child account UUID.", undefined, { pattern: UUID_RE.source }),
14564
14570
  }),
14565
14571
  },
14566
14572
  {
14567
14573
  name: "deploy_polymarket_wallet",
14568
- description: "Deploy the caller-owned Polymarket deposit wallet without sending an owner key or signature to Felix.",
14574
+ description: "Deploy the caller-owned Polymarket trading wallet without sending an owner key or signature to Felix. It is not where to fund an account (use get_deposit_address and create_deposit).",
14569
14575
  inputSchema: schema({
14570
14576
  idempotency_key: stringProp("Optional retry-safety key. Auto-generated when omitted."),
14571
14577
  dry_run: booleanProp("Read deployment state without deploying or spending gas."),
@@ -14573,7 +14579,7 @@ const TOOLS = [
14573
14579
  },
14574
14580
  {
14575
14581
  name: "approve_polymarket_wallet",
14576
- description: "Locally sign and relay only the fixed pUSD/CTF exchange approval batch for the caller-owned deposit wallet. Requires FELIX_OWNER_PRIVATE_KEY in single-user stdio mode.",
14582
+ description: "Locally sign and relay only the fixed pUSD/CTF exchange approval batch for the caller-owned Polymarket trading wallet. Requires FELIX_OWNER_PRIVATE_KEY in single-user stdio mode.",
14577
14583
  inputSchema: schema({
14578
14584
  idempotency_key: stringProp("Optional retry-safety key for preparation. Auto-generated when omitted."),
14579
14585
  dry_run: booleanProp("Read approval state without signing or submitting a relayer operation."),
@@ -17409,10 +17415,10 @@ export function makeServer() {
17409
17415
  unavailable.push("owner_wallets");
17410
17416
  }
17411
17417
  else {
17412
- push("owner_wallet_polygon", num(fundingB.polygon_usdce), "Owner-controlled USDC.e on Polygon. Check get_deposit_address for the current deposit route; allocated-capital returns use preview_capital_move and start_capital_move(direction=bring_home).", { chain: "polygon", asset: "USDC.e", address: fundingB.owner_address });
17418
+ push("owner_wallet_polygon", num(fundingB.polygon_usdce), "Owner-controlled USDC.e on Polygon. Check get_deposit_address for the current deposit route; allocated-capital returns use preview_capital_move and start_capital_move(direction=bring_home).", { chain: "polygon", asset: "USDC.e", address: fundingB.owner_address, not_an_account_deposit_address: true });
17413
17419
  const nativeUsdc = num(fundingB.polygon_usdc_native);
17414
17420
  if (nativeUsdc !== undefined && nativeUsdc > 0.000001) {
17415
- push("owner_wallet_polygon_native_usdc", nativeUsdc, "Native USDC at the owner wallet. fund_market automatically converts only what it needs to USDC.e, or withdraw source=auto can send it directly.", { chain: "polygon", asset: "USDC (native)", address: fundingB.owner_address });
17421
+ push("owner_wallet_polygon_native_usdc", nativeUsdc, "Native USDC at the owner wallet. fund_market automatically converts only what it needs to USDC.e, or withdraw source=auto can send it directly.", { chain: "polygon", asset: "USDC (native)", address: fundingB.owner_address, not_an_account_deposit_address: true });
17416
17422
  }
17417
17423
  push("owner_wallet_arbitrum", num(fundingB.arbitrum_usdc), "Owner USDC on Arbitrum. Crypto funding may spend from here; options funding and venue-to-home returns are not certified in this release.", { chain: "arbitrum", asset: "USDC" });
17418
17424
  const derive = num(fundingB.derive_wallet_usdc);
@@ -19422,6 +19428,8 @@ export function makeServer() {
19422
19428
  owner_derivation: usesLauncherRoot ? "launcher_root" : "hkdf-sha256/felix-account-owner-v1",
19423
19429
  custody: "client_held",
19424
19430
  transport: "stdio",
19431
+ address_role: "Signing address (the same on every network). It holds no account balance.",
19432
+ ...ACCOUNT_DEPOSIT_GUIDANCE,
19425
19433
  _meta: {
19426
19434
  http_status: 200,
19427
19435
  source: "local",
@@ -19453,6 +19461,9 @@ export function makeServer() {
19453
19461
  client_owned: "Direct orders are signed locally from deposit_wallet.",
19454
19462
  autonomous_agent: "Background agents sign only from autonomous_agent_wallet.agent_wallet through the venue-scoped execution policy.",
19455
19463
  },
19464
+ // deposit_wallet is the Polymarket trading wallet on Polygon, filled from the Arc home by fund_polymarket_from_arc.
19465
+ ...ACCOUNT_DEPOSIT_GUIDANCE,
19466
+ venue_funding: "To put money on Polymarket, move it from the Arc home with fund_polymarket_from_arc.",
19456
19467
  };
19457
19468
  break;
19458
19469
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "felix-mcp",
3
- "version": "2.0.139",
3
+ "version": "2.0.140",
4
4
  "mcpName": "trade.felix/mcp",
5
5
  "description": "Agentic trading infrastructure for everyone: crypto perpetuals, prediction markets and options for AI agents.",
6
6
  "homepage": "https://felix.trade/docs",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "trade.felix/mcp",
4
4
  "title": "Felix MCP",
5
5
  "description": "Agentic trading infrastructure for everyone: crypto perpetuals, prediction markets and options.",
6
- "version": "2.0.139",
6
+ "version": "2.0.140",
7
7
  "websiteUrl": "https://felix.trade/docs",
8
8
  "icons": [
9
9
  {
@@ -25,7 +25,7 @@
25
25
  {
26
26
  "registryType": "npm",
27
27
  "identifier": "felix-mcp",
28
- "version": "2.0.139",
28
+ "version": "2.0.140",
29
29
  "transport": {
30
30
  "type": "stdio"
31
31
  }