@continuumdao/ctm-mpc-defi 0.2.44 → 0.2.46

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.
@@ -1288,6 +1288,25 @@ function preprocessHyperliquidUndelegateInput(raw) {
1288
1288
  aliasField(o, "hypeHuman", "hypeHuman", "amount");
1289
1289
  return o;
1290
1290
  }
1291
+ function preprocessHyperliquidLendInput(raw) {
1292
+ const o = preprocessHyperliquidCoinInput(raw);
1293
+ if (!preprocessObject(o)) return raw;
1294
+ aliasField(o, "amountHuman", "amountHuman", "amount", "sz", "szHuman");
1295
+ const amount = String(o.amountHuman ?? "").trim().toLowerCase();
1296
+ if (amount === "max") {
1297
+ o.amountMax = true;
1298
+ o.amountHuman = void 0;
1299
+ }
1300
+ derivePurposeIfMissing(o, (x) => {
1301
+ const coin = String(x.coin ?? "").trim();
1302
+ const op = String(x.operation ?? "").trim();
1303
+ const amt = x.amountMax === true || x.amountMax === "true" ? "max" : String(x.amountHuman ?? "").trim();
1304
+ if (coin && op && amt) return `HL ${op} ${amt} ${coin}`;
1305
+ if (coin && op) return `HL ${op} ${coin}`;
1306
+ return void 0;
1307
+ });
1308
+ return o;
1309
+ }
1291
1310
  function preprocessUniswapLpCreateInput(raw) {
1292
1311
  const o = preprocessObject(raw);
1293
1312
  if (!o) return raw;
@@ -3139,12 +3158,14 @@ var mcpContinuumDaoFetchProposalStateOutputSchema = zod.z.object({
3139
3158
  abstainVotes: zod.z.string()
3140
3159
  });
3141
3160
  var mcpContinuumDaoFetchProposalsInputSchema = zod.z.object({
3142
- start: zod.z.number().int().nonnegative().optional(),
3143
- end: zod.z.number().int().positive().optional()
3161
+ start: zod.z.number().int().optional(),
3162
+ end: zod.z.number().int().optional()
3144
3163
  });
3145
3164
  var mcpContinuumDaoFetchProposalsOutputSchema = zod.z.object({
3146
3165
  proposals: zod.z.array(zod.z.unknown()),
3147
- total: zod.z.number().optional()
3166
+ total: zod.z.number().optional(),
3167
+ minIndex: zod.z.number().optional(),
3168
+ maxIndex: zod.z.number().optional()
3148
3169
  });
3149
3170
  var mcpContinuumDaoFetchProposalInputSchema = zod.z.object({
3150
3171
  id: zod.z.union([zod.z.string(), zod.z.number()])
@@ -3157,6 +3178,7 @@ var liveProposalRowSchema = zod.z.object({
3157
3178
  onchainId: zod.z.string(),
3158
3179
  title: zod.z.string(),
3159
3180
  configuration: zod.z.number().optional(),
3181
+ governorAddress: zod.z.string().optional(),
3160
3182
  state: zod.z.number().nullable(),
3161
3183
  stateLabel: zod.z.string(),
3162
3184
  bucket: zod.z.enum(["live", "pending", "readyToExecute", "recentlyCompleted", "unknown"]),
@@ -3198,6 +3220,7 @@ var mcpContinuumDaoExplainProposalOutputSchema = zod.z.object({
3198
3220
  typeLabel: zod.z.string(),
3199
3221
  configuration: zod.z.enum(["bravo", "delta"]),
3200
3222
  nWinners: zod.z.number().optional(),
3223
+ governorAddress: zod.z.string().optional(),
3201
3224
  briefing: zod.z.string(),
3202
3225
  actions: zod.z.array(zod.z.unknown()),
3203
3226
  options: zod.z.array(zod.z.unknown()),
@@ -4504,6 +4527,57 @@ var mcpHyperliquidUpdateLeverageInputSchema = mcpHyperliquidMultisignInput(
4504
4527
  },
4505
4528
  preprocessHyperliquidCoinInput
4506
4529
  );
4530
+ var hyperliquidLendMarketRowSchema = zod.z.object({
4531
+ tokenIndex: zod.z.number(),
4532
+ coin: zod.z.string().describe("Spot token name \u2014 pass as coin to build_lend_multisign (USDT aliases to USDT0, BTC to UBTC)"),
4533
+ role: zod.z.enum(["collateral", "quote"]),
4534
+ szDecimals: zod.z.number().nullable(),
4535
+ supplyYearlyRate: zod.z.string().describe("Current supply APR as a yearly decimal (0.05 = 5% APR)"),
4536
+ borrowYearlyRate: zod.z.string().describe("Current borrow APR as a yearly decimal (0.05 = 5% APR)"),
4537
+ supplyAprPercent: zod.z.number().nullable(),
4538
+ borrowAprPercent: zod.z.number().nullable(),
4539
+ utilization: zod.z.string(),
4540
+ oraclePx: zod.z.string(),
4541
+ ltv: zod.z.string(),
4542
+ totalSupplied: zod.z.string(),
4543
+ totalBorrowed: zod.z.string(),
4544
+ balance: zod.z.string()
4545
+ });
4546
+ var mcpHyperliquidFetchLendMarketsInputSchema = hyperliquidFetchChainInputSchema;
4547
+ var mcpHyperliquidFetchLendMarketsOutputSchema = zod.z.object({
4548
+ markets: zod.z.array(hyperliquidLendMarketRowSchema),
4549
+ notes: zod.z.string()
4550
+ });
4551
+ var mcpHyperliquidFetchLendPositionsInputSchema = hyperliquidFetchChainInputSchema.extend({
4552
+ executorAddress: evmAddressSchema
4553
+ });
4554
+ var mcpHyperliquidFetchLendPositionsOutputSchema = zod.z.object({
4555
+ positions: zod.z.array(
4556
+ zod.z.object({
4557
+ tokenIndex: zod.z.number(),
4558
+ coin: zod.z.string(),
4559
+ role: zod.z.enum(["collateral", "quote"]).nullable(),
4560
+ suppliedBasis: zod.z.string(),
4561
+ suppliedValue: zod.z.string().describe("Copy as amountHuman for withdraw when not using amountMax"),
4562
+ borrowedBasis: zod.z.string(),
4563
+ borrowedValue: zod.z.string().describe("Copy as amountHuman for repay when not using amountMax")
4564
+ })
4565
+ ),
4566
+ health: zod.z.string(),
4567
+ healthFactor: zod.z.string().nullable(),
4568
+ userAbstraction: zod.z.string(),
4569
+ manualBorrowEnabled: zod.z.boolean(),
4570
+ notes: zod.z.string()
4571
+ });
4572
+ var mcpHyperliquidLendInputSchema = mcpHyperliquidMultisignInput(
4573
+ {
4574
+ coin: zod.z.string().min(1).describe("Spot token from fetch_lend_markets (USDC, USDT/USDT0, HYPE, BTC/UBTC)"),
4575
+ operation: zod.z.enum(["supply", "withdraw", "borrow", "repay"]),
4576
+ amountHuman: zod.z.string().min(1).optional().describe("Human amount. Omit or set amountMax for full withdraw/repay."),
4577
+ amountMax: agentBooleanSchema().optional().describe("true = wire amount null (max withdraw/repay).")
4578
+ },
4579
+ preprocessHyperliquidLendInput
4580
+ );
4507
4581
  var arcusFetchChainInputSchema = zod.z.object({
4508
4582
  chainId: zod.z.coerce.number().int().positive().default(4663).describe("Robinhood Chain (4663).")
4509
4583
  });
@@ -5566,6 +5640,24 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
5566
5640
  handler: { importPath: "protocols/evm/hyperliquid", exportName: "buildHyperliquidUpdateLeverageMultisign" },
5567
5641
  inputZod: mcpHyperliquidUpdateLeverageInputSchema
5568
5642
  }),
5643
+ defineProtocolMcpTool({
5644
+ name: "ctm_hyperliquid_build_lend_multisign",
5645
+ actionId: "hyperliquid.lend",
5646
+ protocolId: "hyperliquid",
5647
+ chainCategory: "evm",
5648
+ description: "Supply, withdraw, borrow, or repay on Hyperliquid Core lend via L1 /exchange EIP-712 \u2014 not CoreWriter. No useCustomGas. trigger_sign_result without txParams; broadcast_sign_result POSTs to /exchange. Manual borrow is disabled on portfolio-margin accounts. HYPE/UBTC supply is collateral (no yield); USDC/USDT0 supply earns APR but does not increase borrow capacity.",
5649
+ prerequisites: [
5650
+ "keyGenId",
5651
+ "chainId 999 or 998",
5652
+ "coin from ctm_hyperliquid_fetch_lend_markets",
5653
+ "operation supply|withdraw|borrow|repay",
5654
+ "amountHuman or amountMax",
5655
+ "ctm_hyperliquid_fetch_lend_positions for health and manualBorrowEnabled before borrow"
5656
+ ],
5657
+ followUp: ["sign_request_agree", "trigger_sign_result", "broadcast_sign_result"],
5658
+ handler: { importPath: "protocols/evm/hyperliquid", exportName: "buildHyperliquidBorrowLendMultisign" },
5659
+ inputZod: mcpHyperliquidLendInputSchema
5660
+ }),
5569
5661
  defineProtocolMcpTool({
5570
5662
  name: "ctm_arcus_build_create_api_key_multisign",
5571
5663
  actionId: "arcus.createApiKey",
@@ -6894,6 +6986,30 @@ var CORE_MCP_TOOL_DEFINITIONS = [
6894
6986
  inputZod: mcpHyperliquidFetchDelegationsInputSchema,
6895
6987
  outputZod: mcpHyperliquidFetchDelegationsOutputSchema
6896
6988
  }),
6989
+ defineMcpTool({
6990
+ name: "ctm_hyperliquid_fetch_lend_markets",
6991
+ actionId: "hyperliquid.fetch-lend-markets",
6992
+ protocolId: "hyperliquid",
6993
+ chainCategory: "evm",
6994
+ description: "Hyperliquid Core lend reserves with current supply APR and borrow APR (yearly rates, not APY), utilization, LTV, and totals. Collateral (HYPE, UBTC) earns no supply interest. Quote (USDC, USDT0, USDH) earns utilization APR. chainId 999 mainnet or 998 testnet.",
6995
+ prerequisites: ["chainId 999 or 998"],
6996
+ followUp: ["ctm_hyperliquid_fetch_lend_positions", "ctm_hyperliquid_build_lend_multisign"],
6997
+ handler: { importPath: "protocols/evm/hyperliquid", exportName: "hyperliquidFetchLendMarketsSummary" },
6998
+ inputZod: mcpHyperliquidFetchLendMarketsInputSchema,
6999
+ outputZod: mcpHyperliquidFetchLendMarketsOutputSchema
7000
+ }),
7001
+ defineMcpTool({
7002
+ name: "ctm_hyperliquid_fetch_lend_positions",
7003
+ actionId: "hyperliquid.fetch-lend-positions",
7004
+ protocolId: "hyperliquid",
7005
+ chainCategory: "evm",
7006
+ description: "User Hyperliquid Core lend positions (supplied/borrowed), health, and whether manual borrow is enabled. Portfolio-margin accounts disable the manual borrow action.",
7007
+ prerequisites: ["chainId 999 or 998", "executorAddress"],
7008
+ followUp: ["ctm_hyperliquid_build_lend_multisign"],
7009
+ handler: { importPath: "protocols/evm/hyperliquid", exportName: "hyperliquidFetchLendPositionsSummary" },
7010
+ inputZod: mcpHyperliquidFetchLendPositionsInputSchema,
7011
+ outputZod: mcpHyperliquidFetchLendPositionsOutputSchema
7012
+ }),
6897
7013
  defineMcpTool({
6898
7014
  name: "ctm_arcus_fetch_markets",
6899
7015
  actionId: "arcus.fetch-markets",
@@ -7343,7 +7459,7 @@ var CORE_MCP_TOOL_DEFINITIONS = [
7343
7459
  actionId: "continuum-dao.fetch-proposal-state",
7344
7460
  protocolId: "continuum-dao",
7345
7461
  chainCategory: "evm",
7346
- description: "Read ContinuumDAO.state and proposalVotes for an on-chain proposal id.",
7462
+ description: "Read ContinuumDAO.state and proposalVotes for an on-chain proposal id. Pass the proposal\u2019s own `governorAddress` when set \u2014 catalog ids -2 and -1 live on the superseded Linea governor 0x4800F9f1dC1b6daCA841B71E0531F547D374168E, not the current contract.",
7347
7463
  prerequisites: ["rpcUrl", "proposalId", "governor"],
7348
7464
  followUp: [
7349
7465
  "ctm_continuum_dao_build_cast_vote_bravo_multisign",
@@ -7358,7 +7474,7 @@ var CORE_MCP_TOOL_DEFINITIONS = [
7358
7474
  actionId: "continuum-dao.fetch-proposals",
7359
7475
  protocolId: "continuum-dao",
7360
7476
  chainCategory: "evm",
7361
- description: "List proposals from the public ContinuumDAO backend (POST /proposals). Do not use this to answer \u201Cwhat is live now\u201D \u2014 use ctm_continuum_dao_fetch_live_proposals so on-chain state is overlaid.",
7477
+ description: "List proposals from the public ContinuumDAO backend (POST /proposals). start/end are catalog id indexes (end exclusive), not offsets, and may be negative: the superseded Linea governor 0x4800F9f1\u2026 is stored as ids -2 and -1 so the current contract can start at 0. Omit start/end to fetch the full catalog (minIndex..maxIndex). Do not use this to answer \u201Cwhat is live now\u201D \u2014 use ctm_continuum_dao_fetch_live_proposals so on-chain state is overlaid.",
7362
7478
  prerequisites: [],
7363
7479
  followUp: ["ctm_continuum_dao_fetch_live_proposals", "ctm_continuum_dao_fetch_proposal"],
7364
7480
  handler: { importPath: "protocols/evm/continuum-dao", exportName: "continuumDaoFetchProposals" },
@@ -7370,7 +7486,7 @@ var CORE_MCP_TOOL_DEFINITIONS = [
7370
7486
  actionId: "continuum-dao.fetch-proposal",
7371
7487
  protocolId: "continuum-dao",
7372
7488
  chainCategory: "evm",
7373
- description: "Fetch one proposal from the public ContinuumDAO backend (GET /proposals/:id).",
7489
+ description: "Fetch one proposal from the public ContinuumDAO backend (GET /proposals/:id). Id may be negative: -2 and -1 are the two proposals from the superseded Linea governor 0x4800F9f1dC1b6daCA841B71E0531F547D374168E.",
7374
7490
  prerequisites: ["id"],
7375
7491
  followUp: ["ctm_continuum_dao_explain_proposal", "ctm_continuum_dao_fetch_proposal_state"],
7376
7492
  handler: { importPath: "protocols/evm/continuum-dao", exportName: "continuumDaoFetchProposal" },
@@ -7382,7 +7498,7 @@ var CORE_MCP_TOOL_DEFINITIONS = [
7382
7498
  actionId: "continuum-dao.fetch-live-proposals",
7383
7499
  protocolId: "continuum-dao",
7384
7500
  chainCategory: "evm",
7385
- description: "Answer \u201Cwhat proposals are live now?\u201D. Lists the backend catalog and overlays ContinuumDAO.state. live = Active (voting). pending = Pending. readyToExecute = Succeeded (execute from here; no queue). recentlyCompleted = Canceled/Defeated/Expired/Executed in this scan. Requires Linea chainId + rpcUrl + governor for on-chain overlay. Read the `note` field aloud.",
7501
+ description: "Answer \u201Cwhat proposals are live now?\u201D. Lists the backend catalog (including negative ids on the superseded Linea governor) and overlays ContinuumDAO.state using each row\u2019s governorAddress. live = Active (voting). pending = Pending. readyToExecute = Succeeded (execute from here; no queue). recentlyCompleted = Canceled/Defeated/Expired/Executed in this scan. Requires Linea chainId + rpcUrl + governor for on-chain overlay. Read the `note` field aloud.",
7386
7502
  prerequisites: ["load_defi_protocol continuum-dao", "Linea chainId 59144 or 59141", "rpcUrl", "governor if constant is zero"],
7387
7503
  followUp: [
7388
7504
  "ctm_continuum_dao_explain_proposal",
@@ -7399,7 +7515,7 @@ var CORE_MCP_TOOL_DEFINITIONS = [
7399
7515
  actionId: "continuum-dao.explain-proposal",
7400
7516
  protocolId: "continuum-dao",
7401
7517
  chainCategory: "evm",
7402
- description: "Deconstruct a ContinuumDAO proposal for the operator. Walks every user action (Bravo) or every option (Delta), labels encoder no-ops as signaling, flags C3 / value / approve / unknown signatures, and checks the forum thread section against the proposal type. Read the `briefing` field aloud. Does not vote. For a policy recommendation load the mpc-config continuum-dao-vote-policy skill.",
7518
+ description: "Deconstruct a ContinuumDAO proposal for the operator. Walks every user action (Bravo) or every option (Delta), labels encoder no-ops as signaling, flags C3 / value / approve / unknown signatures, and checks the forum thread section against the proposal type. `network.c3governor` is always present; an action is C3-remote only when network.name is not Linea (home chain 59144 / 59141). Read the `briefing` field aloud. Does not vote. For a policy recommendation load the mpc-config continuum-dao-vote-policy skill.",
7403
7519
  prerequisites: ["id (backend) or onchainId"],
7404
7520
  followUp: ["ctm_continuum_dao_fetch_proposal_state", "ctm_continuum_dao_forum_fetch_thread"],
7405
7521
  handler: { importPath: "protocols/evm/continuum-dao", exportName: "continuumDaoExplainProposal" },
@@ -9151,6 +9267,19 @@ var hyperliquidProtocolModule = {
9151
9267
  marketKind: { type: "string", required: false, description: "perp (default) or spot" }
9152
9268
  }
9153
9269
  },
9270
+ {
9271
+ id: "hyperliquid.lend",
9272
+ protocolId: HYPERLIQUID_PROTOCOL_ID,
9273
+ chainCategory: "evm",
9274
+ description: "Hyperliquid Core borrow/lend via L1 /exchange EIP-712 (supply, withdraw, borrow, repay). Not CoreWriter.",
9275
+ commonParams: ["keyGen", "purposeText"],
9276
+ params: {
9277
+ coin: { type: "string", required: true, description: "Spot token e.g. USDC, USDT, HYPE, BTC/UBTC" },
9278
+ operation: { type: "string", required: true, description: "supply | withdraw | borrow | repay" },
9279
+ amountHuman: { type: "string", required: false, description: "Amount; omit or max for full withdraw/repay" },
9280
+ amountMax: { type: "boolean", required: false, description: "true = full amount (amount null on wire)" }
9281
+ }
9282
+ },
9154
9283
  {
9155
9284
  id: "hyperliquid.undelegate",
9156
9285
  protocolId: HYPERLIQUID_PROTOCOL_ID,
@@ -9941,6 +10070,8 @@ var UNSET = {
9941
10070
  };
9942
10071
  var CTM_TOKEN_ADDRESS = viem.getAddress("0x2026027054F5beBCEB650aBD62dC623e327658e7");
9943
10072
  var VOTING_ESCROW_LINEA_ADDRESS = viem.getAddress("0x221EC90B3B083A8501A37bdeb7035CeaedF3C31f");
10073
+ viem.getAddress("0x76FF2CB03175900F1D83328C82D27EA9aeaF2355");
10074
+ viem.getAddress("0x4800F9f1dC1b6daCA841B71E0531F547D374168E");
9944
10075
  var CONTINUUM_DAO_DEPLOYMENTS = {
9945
10076
  [CONTINUUM_DAO_LINEA_CHAIN_ID]: {
9946
10077
  ...UNSET,
@@ -11955,6 +12086,10 @@ exports.mcpHyperliquidCloseInputSchema = mcpHyperliquidCloseInputSchema;
11955
12086
  exports.mcpHyperliquidDelegateInputSchema = mcpHyperliquidDelegateInputSchema;
11956
12087
  exports.mcpHyperliquidFetchDelegationsInputSchema = mcpHyperliquidFetchDelegationsInputSchema;
11957
12088
  exports.mcpHyperliquidFetchDelegationsOutputSchema = mcpHyperliquidFetchDelegationsOutputSchema;
12089
+ exports.mcpHyperliquidFetchLendMarketsInputSchema = mcpHyperliquidFetchLendMarketsInputSchema;
12090
+ exports.mcpHyperliquidFetchLendMarketsOutputSchema = mcpHyperliquidFetchLendMarketsOutputSchema;
12091
+ exports.mcpHyperliquidFetchLendPositionsInputSchema = mcpHyperliquidFetchLendPositionsInputSchema;
12092
+ exports.mcpHyperliquidFetchLendPositionsOutputSchema = mcpHyperliquidFetchLendPositionsOutputSchema;
11958
12093
  exports.mcpHyperliquidFetchMarketSnapshotInputSchema = mcpHyperliquidFetchMarketSnapshotInputSchema;
11959
12094
  exports.mcpHyperliquidFetchMarketSnapshotOutputSchema = mcpHyperliquidFetchMarketSnapshotOutputSchema;
11960
12095
  exports.mcpHyperliquidFetchMarketsInputSchema = mcpHyperliquidFetchMarketsInputSchema;
@@ -11979,6 +12114,7 @@ exports.mcpHyperliquidFetchVaultApysInputSchema = mcpHyperliquidFetchVaultApysIn
11979
12114
  exports.mcpHyperliquidFetchVaultApysOutputSchema = mcpHyperliquidFetchVaultApysOutputSchema;
11980
12115
  exports.mcpHyperliquidFetchVaultsInputSchema = mcpHyperliquidFetchVaultsInputSchema;
11981
12116
  exports.mcpHyperliquidFetchVaultsOutputSchema = mcpHyperliquidFetchVaultsOutputSchema;
12117
+ exports.mcpHyperliquidLendInputSchema = mcpHyperliquidLendInputSchema;
11982
12118
  exports.mcpHyperliquidLimitOrderInputSchema = mcpHyperliquidLimitOrderInputSchema;
11983
12119
  exports.mcpHyperliquidSearchMarketsInputSchema = mcpHyperliquidSearchMarketsInputSchema;
11984
12120
  exports.mcpHyperliquidSearchMarketsOutputSchema = mcpHyperliquidSearchMarketsOutputSchema;