@continuumdao/ctm-mpc-defi 0.2.12 → 0.2.16
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/agent/catalog.cjs +868 -283
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1657 -304
- package/dist/agent/catalog.js +861 -284
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/morpho/SKILL.md +8 -22
- package/dist/chains/evm/index.cjs +75 -0
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.ts +31 -1
- package/dist/chains/evm/index.js +73 -2
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/index.cjs +140 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +138 -34
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +29 -2
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +23 -1
- package/dist/protocols/evm/euler-v2/index.js +29 -3
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +42 -8
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.d.ts +20 -4
- package/dist/protocols/evm/gmx/index.js +42 -9
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +9 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.d.ts +2 -1
- package/dist/protocols/evm/maple/index.js +9 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +56 -0
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +28 -1
- package/dist/protocols/evm/morpho/index.js +56 -1
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +98 -26
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +99 -27
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +1 -1
package/dist/agent/catalog.js
CHANGED
|
@@ -524,6 +524,41 @@ function zodSchemaToMcpJsonSchema(schema) {
|
|
|
524
524
|
}
|
|
525
525
|
return raw;
|
|
526
526
|
}
|
|
527
|
+
function parseAgentBoolean(raw, defaultValue = false) {
|
|
528
|
+
if (raw === void 0 || raw === null) return defaultValue;
|
|
529
|
+
if (typeof raw === "boolean") return raw;
|
|
530
|
+
if (typeof raw === "number") return raw !== 0;
|
|
531
|
+
if (typeof raw === "string") {
|
|
532
|
+
const t = raw.trim().toLowerCase();
|
|
533
|
+
if (t === "true" || t === "1" || t === "yes") return true;
|
|
534
|
+
if (t === "false" || t === "0" || t === "no" || t === "") return false;
|
|
535
|
+
}
|
|
536
|
+
return Boolean(raw);
|
|
537
|
+
}
|
|
538
|
+
var CHAIN_ID_DECIMAL_HEX_TYPOS = {
|
|
539
|
+
33875: 8453
|
|
540
|
+
};
|
|
541
|
+
function parseAgentEvmChainId(raw) {
|
|
542
|
+
if (typeof raw === "number" && Number.isInteger(raw) && raw > 0) return raw;
|
|
543
|
+
if (typeof raw !== "string") return Number.NaN;
|
|
544
|
+
const t = raw.trim();
|
|
545
|
+
if (!t) return Number.NaN;
|
|
546
|
+
if (t.toLowerCase().startsWith("0x")) {
|
|
547
|
+
const hexVal = Number.parseInt(t, 16);
|
|
548
|
+
if (!Number.isFinite(hexVal) || hexVal <= 0) return Number.NaN;
|
|
549
|
+
return CHAIN_ID_DECIMAL_HEX_TYPOS[hexVal] ?? hexVal;
|
|
550
|
+
}
|
|
551
|
+
const dec = Number.parseInt(t, 10);
|
|
552
|
+
return Number.isFinite(dec) && dec > 0 ? dec : Number.NaN;
|
|
553
|
+
}
|
|
554
|
+
var agentBooleanSchema = (defaultValue = false) => z.preprocess((val) => parseAgentBoolean(val, defaultValue), z.boolean());
|
|
555
|
+
var agentOptionalBooleanSchema = () => z.preprocess((val) => val === void 0 || val === null ? void 0 : parseAgentBoolean(val, false), z.boolean().optional());
|
|
556
|
+
var agentEvmChainIdSchema = z.preprocess(
|
|
557
|
+
(val) => parseAgentEvmChainId(val),
|
|
558
|
+
z.number().int().positive().describe("EVM chain id (decimal, e.g. 8453 for Base \u2014 not 0x8453).")
|
|
559
|
+
);
|
|
560
|
+
|
|
561
|
+
// src/agent/schemas/common.ts
|
|
527
562
|
var evmAddressSchema = z.string().min(1).describe("EVM address (0x-prefixed, 40 hex nibbles)");
|
|
528
563
|
var keyGenSchema = z.object({
|
|
529
564
|
pubkeyhex: z.string().min(1).describe("MPC secp256k1 public key hex (required for multiSignRequest pubKey)"),
|
|
@@ -551,10 +586,10 @@ var evmMultisignCommonInputSchema = z.object({
|
|
|
551
586
|
purposeText: z.string().min(1).describe(
|
|
552
587
|
"Human-readable purpose for the sign request. Stored in bodyForSign.purpose (may be appended with an automatic batch suffix)."
|
|
553
588
|
),
|
|
554
|
-
useCustomGas:
|
|
555
|
-
"
|
|
589
|
+
useCustomGas: agentBooleanSchema(false).describe(
|
|
590
|
+
"JSON boolean only: false = live RPC fees (default), true = chain registry Custom Gas Config. Omitted baseFee/priorityFee is valid when true."
|
|
556
591
|
),
|
|
557
|
-
chainId:
|
|
592
|
+
chainId: agentEvmChainIdSchema,
|
|
558
593
|
rpcUrl: z.string().min(1).optional().describe("Server-filled from chain registry when keyGenId is set. Agents must not pass rpcUrl."),
|
|
559
594
|
executorAddress: evmAddressSchema.optional().describe("Server-filled MPC wallet from keyGenId. Agents must not pass executorAddress."),
|
|
560
595
|
chainDetail: chainDetailSchema.optional().describe("Server-filled gas row from chain registry when keyGenId is set."),
|
|
@@ -581,13 +616,287 @@ var jsonObjectSchema = z.record(z.unknown());
|
|
|
581
616
|
function parseMultisignBuilderOutput(data) {
|
|
582
617
|
return multisignOutputSchema.parse(data);
|
|
583
618
|
}
|
|
619
|
+
|
|
620
|
+
// src/agent/schemas/chainPreprocess.ts
|
|
621
|
+
function preprocessObject(raw) {
|
|
622
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
623
|
+
return { ...raw };
|
|
624
|
+
}
|
|
625
|
+
function firstDefined(...values) {
|
|
626
|
+
for (const v of values) {
|
|
627
|
+
if (v === void 0 || v === null) continue;
|
|
628
|
+
if (typeof v === "string" && !v.trim()) continue;
|
|
629
|
+
return v;
|
|
630
|
+
}
|
|
631
|
+
return void 0;
|
|
632
|
+
}
|
|
633
|
+
function aliasField(o, target, ...sources) {
|
|
634
|
+
if (firstDefined(o[target]) != null) return;
|
|
635
|
+
const val = firstDefined(...sources.map((k) => o[k]));
|
|
636
|
+
if (val != null) o[target] = val;
|
|
637
|
+
}
|
|
638
|
+
function derivePurposeIfMissing(o, build) {
|
|
639
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
640
|
+
if (purposeText) {
|
|
641
|
+
o.purposeText = purposeText;
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
const derived = build(o);
|
|
645
|
+
if (derived) o.purposeText = derived;
|
|
646
|
+
}
|
|
647
|
+
function isLongToDirection(o) {
|
|
648
|
+
if (firstDefined(o.direction) != null) return;
|
|
649
|
+
const raw = o.isLong;
|
|
650
|
+
if (typeof raw === "boolean") {
|
|
651
|
+
o.direction = raw ? "long" : "short";
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
if (typeof raw === "string") {
|
|
655
|
+
const t = raw.trim().toLowerCase();
|
|
656
|
+
if (t === "true" || t === "long") o.direction = "long";
|
|
657
|
+
else if (t === "false" || t === "short") o.direction = "short";
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
function preprocessGmxGmBuildInput(raw) {
|
|
661
|
+
const o = preprocessObject(raw);
|
|
662
|
+
if (!o) return raw;
|
|
663
|
+
aliasField(o, "marketSymbol", "symbol", "market", "gmSymbol");
|
|
664
|
+
derivePurposeIfMissing(o, (x) => {
|
|
665
|
+
const sym = String(x.marketSymbol ?? x.symbol ?? "").trim();
|
|
666
|
+
const amt = String(x.collateralAmountHuman ?? x.gmAmountHuman ?? "").trim();
|
|
667
|
+
if (sym && amt) return `GMX GM ${sym} ${amt}`;
|
|
668
|
+
return void 0;
|
|
669
|
+
});
|
|
670
|
+
return o;
|
|
671
|
+
}
|
|
672
|
+
function preprocessGmxDecreaseInput(raw) {
|
|
673
|
+
const o = preprocessObject(raw);
|
|
674
|
+
if (!o) return raw;
|
|
675
|
+
aliasField(o, "symbol", "symbol", "indexName", "marketSymbol");
|
|
676
|
+
aliasField(o, "sizeUsdHuman", "sizeUsdHuman", "sizeUsd", "sizeInUsd");
|
|
677
|
+
aliasField(o, "collateralToken", "collateralToken", "collateralSymbol");
|
|
678
|
+
isLongToDirection(o);
|
|
679
|
+
derivePurposeIfMissing(o, (x) => {
|
|
680
|
+
const sym = String(x.symbol ?? "").trim();
|
|
681
|
+
const dir = String(x.direction ?? "").trim();
|
|
682
|
+
const size = String(x.sizeUsdHuman ?? "").trim();
|
|
683
|
+
if (sym && dir && size) return `GMX decrease ${dir} ${sym} ${size} USD`;
|
|
684
|
+
return void 0;
|
|
685
|
+
});
|
|
686
|
+
return o;
|
|
687
|
+
}
|
|
688
|
+
function preprocessGmxIncreaseInput(raw) {
|
|
689
|
+
const o = preprocessObject(raw);
|
|
690
|
+
if (!o) return raw;
|
|
691
|
+
aliasField(o, "symbol", "symbol", "indexName", "marketSymbol");
|
|
692
|
+
derivePurposeIfMissing(o, (x) => {
|
|
693
|
+
const sym = String(x.symbol ?? "").trim();
|
|
694
|
+
const dir = String(x.direction ?? "").trim();
|
|
695
|
+
const size = String(x.sizeUsdHuman ?? "").trim();
|
|
696
|
+
if (sym && dir && size) return `GMX ${dir} ${sym} ${size} USD`;
|
|
697
|
+
return void 0;
|
|
698
|
+
});
|
|
699
|
+
return o;
|
|
700
|
+
}
|
|
701
|
+
function preprocessHyperliquidCoinInput(raw) {
|
|
702
|
+
const o = preprocessObject(raw);
|
|
703
|
+
if (!o) return raw;
|
|
704
|
+
aliasField(o, "coin", "coin", "name", "resolvedCoin", "symbol");
|
|
705
|
+
return o;
|
|
706
|
+
}
|
|
707
|
+
function preprocessHyperliquidLimitOrderInput(raw) {
|
|
708
|
+
const o = preprocessHyperliquidCoinInput(raw);
|
|
709
|
+
if (!preprocessObject(o)) return raw;
|
|
710
|
+
aliasField(o, "limitPxHuman", "limitPxHuman", "limitPx", "markPx");
|
|
711
|
+
aliasField(o, "szHuman", "szHuman", "sz", "size");
|
|
712
|
+
derivePurposeIfMissing(o, (x) => {
|
|
713
|
+
const coin = String(x.coin ?? "").trim();
|
|
714
|
+
const side = x.isBuy === true || x.isBuy === "true" ? "buy" : "sell";
|
|
715
|
+
const sz = String(x.szHuman ?? "").trim();
|
|
716
|
+
if (coin && sz) return `HL limit ${side} ${coin} ${sz}`;
|
|
717
|
+
return void 0;
|
|
718
|
+
});
|
|
719
|
+
return o;
|
|
720
|
+
}
|
|
721
|
+
function preprocessHyperliquidCloseInput(raw) {
|
|
722
|
+
const o = preprocessHyperliquidCoinInput(raw);
|
|
723
|
+
if (!preprocessObject(o)) return raw;
|
|
724
|
+
aliasField(o, "szHuman", "szHuman", "sz", "size");
|
|
725
|
+
aliasField(o, "limitPxHuman", "limitPxHuman", "limitPx", "markPx");
|
|
726
|
+
derivePurposeIfMissing(o, (x) => {
|
|
727
|
+
const coin = String(x.coin ?? "").trim();
|
|
728
|
+
const sz = String(x.szHuman ?? "").trim();
|
|
729
|
+
if (coin && sz) return `HL close ${coin} ${sz}`;
|
|
730
|
+
return void 0;
|
|
731
|
+
});
|
|
732
|
+
return o;
|
|
733
|
+
}
|
|
734
|
+
function preprocessHyperliquidVaultDepositInput(raw) {
|
|
735
|
+
const o = preprocessObject(raw);
|
|
736
|
+
if (!o) return raw;
|
|
737
|
+
derivePurposeIfMissing(o, (x) => {
|
|
738
|
+
const name = String(x.vaultName ?? "").trim();
|
|
739
|
+
const usd = String(x.usdHuman ?? "").trim();
|
|
740
|
+
if (name && usd) return `HL vault deposit ${usd} into ${name}`;
|
|
741
|
+
if (usd) return `HL vault deposit ${usd}`;
|
|
742
|
+
return void 0;
|
|
743
|
+
});
|
|
744
|
+
return o;
|
|
745
|
+
}
|
|
746
|
+
function preprocessHyperliquidVaultWithdrawInput(raw) {
|
|
747
|
+
const o = preprocessObject(raw);
|
|
748
|
+
if (!o) return raw;
|
|
749
|
+
aliasField(o, "usdHuman", "usdHuman", "equity");
|
|
750
|
+
derivePurposeIfMissing(o, (x) => {
|
|
751
|
+
const usd = String(x.usdHuman ?? "").trim();
|
|
752
|
+
if (usd) return `HL vault withdraw ${usd}`;
|
|
753
|
+
return void 0;
|
|
754
|
+
});
|
|
755
|
+
return o;
|
|
756
|
+
}
|
|
757
|
+
function preprocessHyperliquidUndelegateInput(raw) {
|
|
758
|
+
const o = preprocessObject(raw);
|
|
759
|
+
if (!o) return raw;
|
|
760
|
+
aliasField(o, "hypeHuman", "hypeHuman", "amount");
|
|
761
|
+
return o;
|
|
762
|
+
}
|
|
763
|
+
function preprocessUniswapLpCreateInput(raw) {
|
|
764
|
+
const o = preprocessObject(raw);
|
|
765
|
+
if (!o) return raw;
|
|
766
|
+
aliasField(o, "poolPreset", "poolPreset", "presetId");
|
|
767
|
+
const pool = o.existingPool;
|
|
768
|
+
if (pool && typeof pool === "object" && !Array.isArray(pool)) {
|
|
769
|
+
const p = pool;
|
|
770
|
+
aliasField(p, "token0Address", "token0Address", "token0");
|
|
771
|
+
aliasField(p, "token1Address", "token1Address", "token1");
|
|
772
|
+
aliasField(p, "poolReference", "poolReference", "poolId");
|
|
773
|
+
}
|
|
774
|
+
return o;
|
|
775
|
+
}
|
|
776
|
+
function preprocessUniswapLpNftInput(raw) {
|
|
777
|
+
const o = preprocessObject(raw);
|
|
778
|
+
if (!o) return raw;
|
|
779
|
+
aliasField(o, "nftTokenId", "nftTokenId", "tokenId");
|
|
780
|
+
return o;
|
|
781
|
+
}
|
|
782
|
+
function preprocessUniswapLpCollectInput(raw) {
|
|
783
|
+
const o = preprocessObject(raw);
|
|
784
|
+
if (!o) return raw;
|
|
785
|
+
aliasField(o, "tokenId", "tokenId", "nftTokenId");
|
|
786
|
+
return o;
|
|
787
|
+
}
|
|
788
|
+
function tokenAddressFromQuoteSnapshot(quote, side) {
|
|
789
|
+
const inner = quote.quote;
|
|
790
|
+
if (!inner || typeof inner !== "object" || Array.isArray(inner)) return void 0;
|
|
791
|
+
const row = inner[side];
|
|
792
|
+
const token = row?.token;
|
|
793
|
+
return typeof token === "string" && token.trim() ? token.trim() : void 0;
|
|
794
|
+
}
|
|
795
|
+
function preprocessUniswapBuildSwapInput(raw) {
|
|
796
|
+
const o = preprocessObject(raw);
|
|
797
|
+
if (!o) return raw;
|
|
798
|
+
aliasField(o, "fullQuoteSnapshot", "fullQuoteSnapshot", "fullQuoteFromPermit", "quote");
|
|
799
|
+
const createResp = firstDefined(o.createSwapResponse, o.create_swap_response, o.createSwap);
|
|
800
|
+
if (createResp != null) o.createSwapResponse = createResp;
|
|
801
|
+
if (!firstDefined(o.swap) && createResp && typeof createResp === "object" && !Array.isArray(createResp)) {
|
|
802
|
+
const nested = createResp.swap;
|
|
803
|
+
if (nested != null) o.swap = nested;
|
|
804
|
+
}
|
|
805
|
+
const quote = o.fullQuoteSnapshot && typeof o.fullQuoteSnapshot === "object" && !Array.isArray(o.fullQuoteSnapshot) ? o.fullQuoteSnapshot : null;
|
|
806
|
+
if (quote && !firstDefined(o.tokenIn)) {
|
|
807
|
+
const tokenIn = tokenAddressFromQuoteSnapshot(quote, "input");
|
|
808
|
+
if (tokenIn) o.tokenIn = tokenIn;
|
|
809
|
+
}
|
|
810
|
+
derivePurposeIfMissing(o, () => "Uniswap V4 swap");
|
|
811
|
+
return o;
|
|
812
|
+
}
|
|
813
|
+
function preprocessUniswapBuildLpInput(raw) {
|
|
814
|
+
const o = preprocessUniswapLpNftInput(raw);
|
|
815
|
+
if (!preprocessObject(o)) return raw;
|
|
816
|
+
derivePurposeIfMissing(o, () => "Uniswap V4 liquidity");
|
|
817
|
+
return o;
|
|
818
|
+
}
|
|
819
|
+
function preprocessCurveBuildSwapInput(raw) {
|
|
820
|
+
const o = preprocessObject(raw);
|
|
821
|
+
if (!o) return raw;
|
|
822
|
+
const quote = o.quoteSnapshot && typeof o.quoteSnapshot === "object" && !Array.isArray(o.quoteSnapshot) ? o.quoteSnapshot : o;
|
|
823
|
+
aliasField(o, "tokenIn", "tokenIn", "tokenInRouterId", "tokenInAddress");
|
|
824
|
+
aliasField(o, "tokenOut", "tokenOut", "tokenOutRouterId", "tokenOutAddress");
|
|
825
|
+
aliasField(o, "amountHuman", "amountHuman", "inputAmount");
|
|
826
|
+
if (!firstDefined(o.tokenIn) && firstDefined(quote.tokenInRouterId)) {
|
|
827
|
+
o.tokenIn = quote.tokenInRouterId;
|
|
828
|
+
}
|
|
829
|
+
if (!firstDefined(o.tokenOut) && firstDefined(quote.tokenOutRouterId)) {
|
|
830
|
+
o.tokenOut = quote.tokenOutRouterId;
|
|
831
|
+
}
|
|
832
|
+
if (!firstDefined(o.amountHuman) && firstDefined(quote.inputAmount)) {
|
|
833
|
+
o.amountHuman = quote.inputAmount;
|
|
834
|
+
}
|
|
835
|
+
derivePurposeIfMissing(o, (x) => {
|
|
836
|
+
const amt = String(x.amountHuman ?? "").trim();
|
|
837
|
+
if (amt) return `Curve swap ${amt}`;
|
|
838
|
+
return void 0;
|
|
839
|
+
});
|
|
840
|
+
return o;
|
|
841
|
+
}
|
|
842
|
+
function preprocessMorphoBlueCollateralDepositInput(raw) {
|
|
843
|
+
const o = preprocessObject(raw);
|
|
844
|
+
if (!o) return raw;
|
|
845
|
+
aliasField(o, "collateralToken", "collateralToken", "collateralTokenAddress");
|
|
846
|
+
aliasField(o, "marketId", "marketId", "marketID");
|
|
847
|
+
derivePurposeIfMissing(o, (x) => {
|
|
848
|
+
const amt = String(x.amountHuman ?? "").trim();
|
|
849
|
+
const label = String(x.marketLabel ?? "").trim();
|
|
850
|
+
if (amt && label) return `Morpho Blue collateral ${amt} for ${label}`;
|
|
851
|
+
if (amt) return `Morpho Blue collateral deposit ${amt}`;
|
|
852
|
+
return void 0;
|
|
853
|
+
});
|
|
854
|
+
return o;
|
|
855
|
+
}
|
|
856
|
+
function preprocessMorphoBlueBorrowRepayInput(raw) {
|
|
857
|
+
const o = preprocessObject(raw);
|
|
858
|
+
if (!o) return raw;
|
|
859
|
+
aliasField(o, "loanToken", "loanToken", "loanTokenAddress");
|
|
860
|
+
return o;
|
|
861
|
+
}
|
|
862
|
+
function preprocessEulerV2IsolatedLendInput(raw) {
|
|
863
|
+
const o = preprocessObject(raw);
|
|
864
|
+
if (!o) return raw;
|
|
865
|
+
aliasField(o, "vault", "vault", "evaultAddress");
|
|
866
|
+
aliasField(o, "underlyingAddress", "underlyingAddress", "underlying");
|
|
867
|
+
aliasField(o, "marketName", "marketName", "vaultName");
|
|
868
|
+
derivePurposeIfMissing(o, (x) => {
|
|
869
|
+
const amt = String(x.assetAmountHuman ?? x.amountHuman ?? "").trim();
|
|
870
|
+
const label = String(x.marketName ?? x.vaultName ?? "").trim();
|
|
871
|
+
if (amt && label) return `Euler lend ${amt} into ${label}`;
|
|
872
|
+
if (amt) return `Euler vault deposit ${amt}`;
|
|
873
|
+
return void 0;
|
|
874
|
+
});
|
|
875
|
+
return o;
|
|
876
|
+
}
|
|
877
|
+
function preprocessAaveMultisignInput(action) {
|
|
878
|
+
return (raw) => {
|
|
879
|
+
const o = preprocessObject(raw);
|
|
880
|
+
if (!o) return raw;
|
|
881
|
+
derivePurposeIfMissing(o, (x) => {
|
|
882
|
+
const amt = String(x.amountHuman ?? "").trim();
|
|
883
|
+
const asset = String(x.underlying ?? "").trim();
|
|
884
|
+
if (amt && asset) return `Aave ${action} ${amt} ${asset}`;
|
|
885
|
+
if (amt) return `Aave ${action} ${amt}`;
|
|
886
|
+
return void 0;
|
|
887
|
+
});
|
|
888
|
+
return o;
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// src/agent/schemas/uniswapV4.ts
|
|
584
893
|
var uniswapQuoteTradeTypeSchema = z.enum(["EXACT_INPUT", "EXACT_OUTPUT"]);
|
|
585
894
|
var mcpUniswapV4QuoteInputSchema = z.object({
|
|
586
895
|
type: uniswapQuoteTradeTypeSchema.describe("EXACT_INPUT or EXACT_OUTPUT"),
|
|
587
896
|
amount: z.string().min(1).describe("Amount in token-in base units (wei string for ERC-20)"),
|
|
588
897
|
tokenIn: z.string().min(1).describe("Input token; 0x0 for native ETH"),
|
|
589
898
|
tokenOut: z.string().min(1).describe("Output token address"),
|
|
590
|
-
chainId:
|
|
899
|
+
chainId: agentEvmChainIdSchema.describe("tokenInChainId / same-chain default"),
|
|
591
900
|
uniswapApiKey: z.string().min(1).describe("Uniswap Trade API x-api-key"),
|
|
592
901
|
swapper: evmAddressSchema.optional().describe("MPC executor; omit if keyGen + managementNodeUrl provided"),
|
|
593
902
|
slippage: z.union([z.number(), z.string()]).optional().describe("Slippage percent; omit for API auto slippage"),
|
|
@@ -595,7 +904,7 @@ var mcpUniswapV4QuoteInputSchema = z.object({
|
|
|
595
904
|
managementNodeUrl: z.string().min(1).optional().describe("MPC node base URL; required with keyGen when swapper is omitted"),
|
|
596
905
|
tokenInChainId: z.union([z.number(), z.string()]).optional(),
|
|
597
906
|
tokenOutChainId: z.union([z.number(), z.string()]).optional(),
|
|
598
|
-
permit2Disabled:
|
|
907
|
+
permit2Disabled: agentOptionalBooleanSchema(),
|
|
599
908
|
baseUrl: z.string().optional(),
|
|
600
909
|
universalRouterVersion: z.string().optional()
|
|
601
910
|
});
|
|
@@ -617,18 +926,21 @@ var mcpUniswapV4CreateSwapOutputSchema = z.object({
|
|
|
617
926
|
}).passthrough().describe("{ swap: TransactionRequest, requestId?, gasFee? }");
|
|
618
927
|
var swapTxRequestSchema = jsonObjectSchema.describe("swap field from create_swap response (to, data, value)");
|
|
619
928
|
var mcpUniswapV4BuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
929
|
+
z.preprocess(
|
|
930
|
+
preprocessUniswapBuildSwapInput,
|
|
931
|
+
evmMultisignCommonInputSchema.extend({
|
|
932
|
+
tokenIn: evmAddressSchema.describe("Token in; 0x0 for native ETH"),
|
|
624
933
|
swap: swapTxRequestSchema,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
934
|
+
createSwapResponse: z.object({
|
|
935
|
+
swap: swapTxRequestSchema,
|
|
936
|
+
requestId: z.string().optional(),
|
|
937
|
+
gasFee: z.string().optional()
|
|
938
|
+
}).passthrough().describe("Full create_swap response"),
|
|
939
|
+
fullQuoteSnapshot: jsonObjectSchema.describe("Quote JSON used for the swap"),
|
|
940
|
+
swapDeadlineUnix: z.number().describe("Same deadline passed to create_swap"),
|
|
941
|
+
slippagePercent: z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
|
|
942
|
+
})
|
|
943
|
+
)
|
|
632
944
|
);
|
|
633
945
|
var lpExistingPoolSchema = z.object({
|
|
634
946
|
token0Address: evmAddressSchema,
|
|
@@ -658,22 +970,26 @@ var lpTickBoundsSchema = z.object({
|
|
|
658
970
|
var lpCommonApiInputSchema = z.object({
|
|
659
971
|
uniswapApiKey: z.string().min(1),
|
|
660
972
|
walletAddress: evmAddressSchema.optional(),
|
|
661
|
-
chainId:
|
|
973
|
+
chainId: agentEvmChainIdSchema,
|
|
662
974
|
slippageTolerance: z.number().optional(),
|
|
663
|
-
simulateTransaction:
|
|
975
|
+
simulateTransaction: agentOptionalBooleanSchema(),
|
|
664
976
|
baseUrl: z.string().optional(),
|
|
665
977
|
keyGen: z.string().optional(),
|
|
666
978
|
managementNodeUrl: z.string().optional()
|
|
667
979
|
});
|
|
668
|
-
var mcpUniswapV4LpCreatePositionInputSchema =
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
980
|
+
var mcpUniswapV4LpCreatePositionInputSchema = z.preprocess(
|
|
981
|
+
preprocessUniswapLpCreateInput,
|
|
982
|
+
lpCommonApiInputSchema.extend({
|
|
983
|
+
poolPreset: z.string().optional().describe("presetId from ctm_uniswap_v4_list_lp_pools \u2014 server resolves existingPool"),
|
|
984
|
+
existingPool: lpExistingPoolSchema.optional(),
|
|
985
|
+
newPool: lpNewPoolSchema.optional(),
|
|
986
|
+
independentToken: lpIndependentTokenSchema,
|
|
987
|
+
priceBounds: lpPriceBoundsSchema.optional(),
|
|
988
|
+
tickBounds: lpTickBoundsSchema.optional()
|
|
989
|
+
})
|
|
990
|
+
);
|
|
675
991
|
var mcpUniswapV4LpListPoolsInputSchema = z.object({
|
|
676
|
-
chainId:
|
|
992
|
+
chainId: agentEvmChainIdSchema,
|
|
677
993
|
pair: z.string().optional().describe("Optional filter, e.g. eth-usdc or ETH/USDC")
|
|
678
994
|
});
|
|
679
995
|
var mcpUniswapV4LpListPoolsOutputSchema = z.object({
|
|
@@ -700,26 +1016,35 @@ var mcpUniswapV4LpListPoolsOutputSchema = z.object({
|
|
|
700
1016
|
notes: z.string()
|
|
701
1017
|
});
|
|
702
1018
|
var mcpUniswapV4LpCreatePositionOutputSchema = jsonObjectSchema;
|
|
703
|
-
var mcpUniswapV4LpIncreaseInputSchema =
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
1019
|
+
var mcpUniswapV4LpIncreaseInputSchema = z.preprocess(
|
|
1020
|
+
preprocessUniswapLpNftInput,
|
|
1021
|
+
lpCommonApiInputSchema.extend({
|
|
1022
|
+
token0Address: evmAddressSchema,
|
|
1023
|
+
token1Address: evmAddressSchema,
|
|
1024
|
+
nftTokenId: z.union([z.string(), z.number()]).describe("tokenId from lp_list_positions"),
|
|
1025
|
+
independentToken: lpIndependentTokenSchema
|
|
1026
|
+
})
|
|
1027
|
+
);
|
|
709
1028
|
var mcpUniswapV4LpIncreaseOutputSchema = jsonObjectSchema;
|
|
710
|
-
var mcpUniswapV4LpDecreaseInputSchema =
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
1029
|
+
var mcpUniswapV4LpDecreaseInputSchema = z.preprocess(
|
|
1030
|
+
preprocessUniswapLpNftInput,
|
|
1031
|
+
lpCommonApiInputSchema.extend({
|
|
1032
|
+
token0Address: evmAddressSchema,
|
|
1033
|
+
token1Address: evmAddressSchema,
|
|
1034
|
+
nftTokenId: z.union([z.string(), z.number()]).describe("tokenId from lp_list_positions"),
|
|
1035
|
+
liquidityPercentageToDecrease: z.number().int().min(1).max(100)
|
|
1036
|
+
})
|
|
1037
|
+
);
|
|
716
1038
|
var mcpUniswapV4LpDecreaseOutputSchema = jsonObjectSchema;
|
|
717
|
-
var mcpUniswapV4LpClaimInputSchema =
|
|
718
|
-
|
|
719
|
-
|
|
1039
|
+
var mcpUniswapV4LpClaimInputSchema = z.preprocess(
|
|
1040
|
+
preprocessUniswapLpCollectInput,
|
|
1041
|
+
lpCommonApiInputSchema.extend({
|
|
1042
|
+
tokenId: z.union([z.string(), z.number()]).describe("tokenId from lp_list_positions")
|
|
1043
|
+
})
|
|
1044
|
+
);
|
|
720
1045
|
var mcpUniswapV4LpClaimOutputSchema = jsonObjectSchema;
|
|
721
1046
|
var mcpUniswapV4LpListPositionsInputSchema = z.object({
|
|
722
|
-
chainId:
|
|
1047
|
+
chainId: agentEvmChainIdSchema,
|
|
723
1048
|
keyGenId: z.string().min(1).optional(),
|
|
724
1049
|
walletAddress: evmAddressSchema.optional(),
|
|
725
1050
|
positionManagerAddress: evmAddressSchema.optional()
|
|
@@ -737,7 +1062,7 @@ var mcpUniswapV4LpListPositionsOutputSchema = z.object({
|
|
|
737
1062
|
)
|
|
738
1063
|
});
|
|
739
1064
|
var mcpUniswapV4RegisterPositionNftInputSchema = z.object({
|
|
740
|
-
chainId:
|
|
1065
|
+
chainId: agentEvmChainIdSchema,
|
|
741
1066
|
tokenId: z.union([z.string(), z.number()]),
|
|
742
1067
|
keyGenId: z.string().min(1).optional(),
|
|
743
1068
|
positionManagerAddress: evmAddressSchema.optional(),
|
|
@@ -751,7 +1076,7 @@ var mcpUniswapV4RegisterPositionNftOutputSchema = z.object({
|
|
|
751
1076
|
positionManager: evmAddressSchema
|
|
752
1077
|
});
|
|
753
1078
|
var mcpUniswapV4RegisterPositionFromMintTxInputSchema = z.object({
|
|
754
|
-
chainId:
|
|
1079
|
+
chainId: agentEvmChainIdSchema,
|
|
755
1080
|
txHash: z.string().min(1),
|
|
756
1081
|
keyGenId: z.string().min(1).optional(),
|
|
757
1082
|
walletAddress: evmAddressSchema.optional(),
|
|
@@ -770,28 +1095,37 @@ var lpBuildCommonSchema = {
|
|
|
770
1095
|
poolReference: z.string().optional()
|
|
771
1096
|
};
|
|
772
1097
|
var mcpUniswapV4BuildMintLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
773
|
-
evmMultisignCommonInputSchema.extend(lpBuildCommonSchema)
|
|
1098
|
+
z.preprocess(preprocessUniswapBuildLpInput, evmMultisignCommonInputSchema.extend(lpBuildCommonSchema))
|
|
774
1099
|
);
|
|
775
1100
|
var mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
1101
|
+
z.preprocess(
|
|
1102
|
+
preprocessUniswapBuildLpInput,
|
|
1103
|
+
evmMultisignCommonInputSchema.extend({
|
|
1104
|
+
...lpBuildCommonSchema,
|
|
1105
|
+
nftTokenId: z.union([z.string(), z.number()]).describe("tokenId from lp_list_positions")
|
|
1106
|
+
})
|
|
1107
|
+
)
|
|
780
1108
|
);
|
|
781
1109
|
var mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
1110
|
+
z.preprocess(
|
|
1111
|
+
preprocessUniswapBuildLpInput,
|
|
1112
|
+
evmMultisignCommonInputSchema.extend({
|
|
1113
|
+
...lpBuildCommonSchema,
|
|
1114
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
1115
|
+
})
|
|
1116
|
+
)
|
|
786
1117
|
);
|
|
787
1118
|
var mcpUniswapV4BuildCollectFeesMultisignInputSchema = withMultisignKeySourceRefine(
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
1119
|
+
z.preprocess(
|
|
1120
|
+
preprocessUniswapBuildLpInput,
|
|
1121
|
+
evmMultisignCommonInputSchema.extend({
|
|
1122
|
+
...lpBuildCommonSchema,
|
|
1123
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
1124
|
+
})
|
|
1125
|
+
)
|
|
792
1126
|
);
|
|
793
1127
|
var mcpCurveDaoQuoteInputSchema = z.object({
|
|
794
|
-
chainId:
|
|
1128
|
+
chainId: agentEvmChainIdSchema.describe("EVM chain id (rpcUrl resolved from get_chain_registry rpcGateway)"),
|
|
795
1129
|
rpcUrl: z.string().min(1).optional().describe("JSON-RPC URL; continuum-mcp-server injects from chain registry \u2014 do not pass a public RPC URL"),
|
|
796
1130
|
tokenIn: z.string().min(1).describe("Input token address, or 0xeeee\u2026 / 0x0 / eth for native"),
|
|
797
1131
|
tokenOut: z.string().min(1).describe("Output token address or 0xeeee\u2026 native placeholder"),
|
|
@@ -802,13 +1136,112 @@ var mcpCurveDaoQuoteOutputSchema = jsonObjectSchema.describe(
|
|
|
802
1136
|
"Curve router quote: { inputAmount, output, route, priceImpactPercent?, tokenInRouterId, tokenOutRouterId }"
|
|
803
1137
|
);
|
|
804
1138
|
var mcpCurveDaoBuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1139
|
+
z.preprocess(
|
|
1140
|
+
preprocessCurveBuildSwapInput,
|
|
1141
|
+
evmMultisignCommonInputSchema.extend({
|
|
1142
|
+
tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
|
|
1143
|
+
tokenOut: z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
|
|
1144
|
+
amountHuman: z.string().min(1).describe("Human-readable amount of tokenIn"),
|
|
1145
|
+
slippagePercent: z.number().gt(0).lt(100).describe("Slippage 0\u2013100 exclusive"),
|
|
1146
|
+
quoteSnapshot: jsonObjectSchema.optional().describe("Optional quote row from ctm_curve_dao_quote \u2014 aliases tokenIn/tokenOut/amountHuman")
|
|
1147
|
+
})
|
|
1148
|
+
)
|
|
811
1149
|
);
|
|
1150
|
+
var morphoExposureRowSchema = z.object({
|
|
1151
|
+
label: z.string(),
|
|
1152
|
+
allocatedUsdLabel: z.string(),
|
|
1153
|
+
allocationPercentLabel: z.string()
|
|
1154
|
+
});
|
|
1155
|
+
function preprocessMorphoVaultDepositInput(raw) {
|
|
1156
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
1157
|
+
const o = { ...raw };
|
|
1158
|
+
const vaultAddr = o.vaultAddress ?? o.vault;
|
|
1159
|
+
if (vaultAddr != null) {
|
|
1160
|
+
o.vaultAddress = vaultAddr;
|
|
1161
|
+
o.vault = vaultAddr;
|
|
1162
|
+
}
|
|
1163
|
+
const underlyingAddr = o.underlyingAddress ?? o.underlying;
|
|
1164
|
+
if (underlyingAddr != null) {
|
|
1165
|
+
o.underlyingAddress = underlyingAddr;
|
|
1166
|
+
o.underlying = underlyingAddr;
|
|
1167
|
+
}
|
|
1168
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
1169
|
+
if (!purposeText) {
|
|
1170
|
+
const amt = String(o.amountHuman ?? "").trim();
|
|
1171
|
+
const label = String(o.vaultName ?? o.vaultSymbol ?? "").trim();
|
|
1172
|
+
if (amt && label) o.purposeText = `Deposit ${amt} into ${label}`;
|
|
1173
|
+
else if (amt) o.purposeText = `Morpho vault deposit ${amt}`;
|
|
1174
|
+
}
|
|
1175
|
+
return o;
|
|
1176
|
+
}
|
|
1177
|
+
function preprocessMorphoVaultWithdrawInput(raw) {
|
|
1178
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
1179
|
+
const o = { ...raw };
|
|
1180
|
+
const vaultAddr = o.vaultAddress ?? o.vault;
|
|
1181
|
+
if (vaultAddr != null) {
|
|
1182
|
+
o.vaultAddress = vaultAddr;
|
|
1183
|
+
o.vault = vaultAddr;
|
|
1184
|
+
}
|
|
1185
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
1186
|
+
if (!purposeText) {
|
|
1187
|
+
const amt = String(o.amountHuman ?? "").trim();
|
|
1188
|
+
const label = String(o.vaultName ?? o.vaultSymbol ?? "").trim();
|
|
1189
|
+
if (amt && label) o.purposeText = `Withdraw ${amt} from ${label}`;
|
|
1190
|
+
else if (amt) o.purposeText = `Morpho vault withdraw ${amt}`;
|
|
1191
|
+
}
|
|
1192
|
+
return o;
|
|
1193
|
+
}
|
|
1194
|
+
var mcpMorphoFetchEarnVaultsInputSchema = z.object({
|
|
1195
|
+
chainId: agentEvmChainIdSchema,
|
|
1196
|
+
underlying: z.string().trim().min(1).optional().describe("Deposit asset symbol (e.g. USDC) or ERC-20 address. Omit to search all listed vaults on the chain."),
|
|
1197
|
+
query: z.string().trim().min(1).optional().describe("Case-insensitive filter on vault name, symbol, address, or underlying symbol (e.g. Steakhouse, bbqUSDC)."),
|
|
1198
|
+
limit: z.number().int().min(1).max(200).optional().describe("Max rows (default 50).")
|
|
1199
|
+
});
|
|
1200
|
+
var mcpMorphoFetchEarnVaultsOutputSchema = z.object({
|
|
1201
|
+
vaults: z.array(
|
|
1202
|
+
z.object({
|
|
1203
|
+
vaultAddress: z.string(),
|
|
1204
|
+
vaultName: z.string(),
|
|
1205
|
+
vaultSymbol: z.string(),
|
|
1206
|
+
underlyingAddress: z.string(),
|
|
1207
|
+
underlyingSymbol: z.string(),
|
|
1208
|
+
apy: z.string(),
|
|
1209
|
+
netApy: z.string(),
|
|
1210
|
+
netApy7d: z.string(),
|
|
1211
|
+
netApy30d: z.string(),
|
|
1212
|
+
netApy90d: z.string(),
|
|
1213
|
+
performanceFee: z.string(),
|
|
1214
|
+
managementFee: z.string().nullable(),
|
|
1215
|
+
totalDepositsUsd: z.string(),
|
|
1216
|
+
liquidityUsd: z.string(),
|
|
1217
|
+
exposure: z.array(morphoExposureRowSchema)
|
|
1218
|
+
})
|
|
1219
|
+
)
|
|
1220
|
+
});
|
|
1221
|
+
var mcpMorphoFetchBlueMarketsInputSchema = z.object({
|
|
1222
|
+
chainId: agentEvmChainIdSchema,
|
|
1223
|
+
collateral: z.string().trim().min(1).optional().describe("Collateral asset symbol or address (e.g. WETH, cbETH)."),
|
|
1224
|
+
loan: z.string().trim().min(1).optional().describe("Loan asset symbol or address (e.g. USDC)."),
|
|
1225
|
+
query: z.string().trim().min(1).optional().describe("Filter on market label, symbols, or marketId."),
|
|
1226
|
+
limit: z.number().int().min(1).max(200).optional()
|
|
1227
|
+
});
|
|
1228
|
+
var mcpMorphoFetchBlueMarketsOutputSchema = z.object({
|
|
1229
|
+
markets: z.array(
|
|
1230
|
+
z.object({
|
|
1231
|
+
marketId: z.string().describe("Pass to build_blue_* multisign tools"),
|
|
1232
|
+
marketLabel: z.string(),
|
|
1233
|
+
morphoBlueAddress: z.string(),
|
|
1234
|
+
collateralTokenAddress: z.string().describe("Copy as collateralToken for supply collateral"),
|
|
1235
|
+
collateralTokenSymbol: z.string(),
|
|
1236
|
+
collateralTokenDecimals: z.number().int(),
|
|
1237
|
+
loanTokenAddress: z.string().describe("Copy as loanToken for borrow/repay"),
|
|
1238
|
+
loanTokenSymbol: z.string(),
|
|
1239
|
+
loanTokenDecimals: z.number().int(),
|
|
1240
|
+
borrowApyLabel: z.string(),
|
|
1241
|
+
supplyApyLabel: z.string()
|
|
1242
|
+
})
|
|
1243
|
+
)
|
|
1244
|
+
});
|
|
812
1245
|
var mcpServerCommonInputSchema = z.object({
|
|
813
1246
|
keyGenId: z.string().min(1).describe("KeyGen id from fetch_key_gen_result / node preferred KeyGen"),
|
|
814
1247
|
chainId: z.number().int().positive().describe("EVM chain id; RPC and gas config resolved from chain registry"),
|
|
@@ -905,48 +1338,79 @@ var mcpSkySusdsRedeemInputSchema = mcpMultisignInput({
|
|
|
905
1338
|
sharesHuman: z.string().min(1)
|
|
906
1339
|
});
|
|
907
1340
|
var mcpAaveV4MarketIdSchema = z.string().min(1).optional().describe("UI market segment: main (Plus), core, or bluechip (Prime). Default main.");
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
1341
|
+
function mcpAaveV4MultisignInput(fields, action) {
|
|
1342
|
+
return withMultisignKeySourceRefine(
|
|
1343
|
+
z.preprocess(preprocessAaveMultisignInput(action), evmMultisignCommonInputSchema.extend(fields))
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
var mcpAaveV4HealthPreviewFields = {
|
|
1347
|
+
skipHealthPreview: agentOptionalBooleanSchema().describe(
|
|
1348
|
+
"Skip Aave v4 health-factor preview before withdraw/borrow/repay (not recommended)."
|
|
1349
|
+
),
|
|
1350
|
+
acknowledgeHealthRisk: agentOptionalBooleanSchema().describe(
|
|
911
1351
|
"Required true when preview returns a confirm-level health risk (withdraw/borrow/repay)."
|
|
912
1352
|
)
|
|
913
1353
|
};
|
|
914
|
-
var mcpAaveV4DepositInputSchema =
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
var
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}
|
|
1354
|
+
var mcpAaveV4DepositInputSchema = mcpAaveV4MultisignInput(
|
|
1355
|
+
{
|
|
1356
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 continuum-mcp-server resolves spoke from Aave v4 API."),
|
|
1357
|
+
underlying: evmAddressSchema.describe(
|
|
1358
|
+
"Asset to supply. Native ETH: 0x0 or wrapped native with isNativeIn true."
|
|
1359
|
+
),
|
|
1360
|
+
amountHuman: z.string().min(1),
|
|
1361
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1362
|
+
isNativeIn: agentOptionalBooleanSchema().describe(
|
|
1363
|
+
"Wrap native to wrapped native before supply (e.g. ETH \u2192 WETH)."
|
|
1364
|
+
),
|
|
1365
|
+
enableAsCollateralAfterSupply: agentOptionalBooleanSchema().describe(
|
|
1366
|
+
"Append setUsingAsCollateral after supply in the same batch."
|
|
1367
|
+
)
|
|
1368
|
+
},
|
|
1369
|
+
"deposit"
|
|
1370
|
+
);
|
|
1371
|
+
var mcpAaveV4WithdrawInputSchema = mcpAaveV4MultisignInput(
|
|
1372
|
+
{
|
|
1373
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
|
|
1374
|
+
underlying: evmAddressSchema.describe("Supplied asset to withdraw."),
|
|
1375
|
+
amountHuman: z.string().min(1),
|
|
1376
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1377
|
+
...mcpAaveV4HealthPreviewFields
|
|
1378
|
+
},
|
|
1379
|
+
"withdraw"
|
|
1380
|
+
);
|
|
1381
|
+
var mcpAaveV4BorrowInputSchema = mcpAaveV4MultisignInput(
|
|
1382
|
+
{
|
|
1383
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
|
|
1384
|
+
underlying: evmAddressSchema.describe("Debt asset to borrow (e.g. USDC), not collateral."),
|
|
1385
|
+
amountHuman: z.string().min(1),
|
|
1386
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1387
|
+
collateralUnderlying: evmAddressSchema.optional().describe("Collateral token already supplied; helps pick hub when debt exists on multiple hubs."),
|
|
1388
|
+
...mcpAaveV4HealthPreviewFields
|
|
1389
|
+
},
|
|
1390
|
+
"borrow"
|
|
1391
|
+
);
|
|
1392
|
+
var mcpAaveV4RepayInputSchema = mcpAaveV4MultisignInput(
|
|
1393
|
+
{
|
|
1394
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
|
|
1395
|
+
underlying: evmAddressSchema.describe("Debt token to repay."),
|
|
1396
|
+
amountHuman: z.string().min(1),
|
|
1397
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1398
|
+
...mcpAaveV4HealthPreviewFields
|
|
1399
|
+
},
|
|
1400
|
+
"repay"
|
|
1401
|
+
);
|
|
1402
|
+
var mcpEulerV2IsolatedLendInputSchema = withMultisignKeySourceRefine(
|
|
1403
|
+
z.preprocess(
|
|
1404
|
+
preprocessEulerV2IsolatedLendInput,
|
|
1405
|
+
evmMultisignCommonInputSchema.extend({
|
|
1406
|
+
vault: evmAddressSchema.describe("evaultAddress from ctm_euler_v2_fetch_lend_vaults"),
|
|
1407
|
+
assetAmountHuman: z.string().min(1),
|
|
1408
|
+
underlyingAddress: evmAddressSchema.optional().describe("underlyingAddress from fetch row \u2014 server resolves if omitted"),
|
|
1409
|
+
marketName: z.string().optional().describe("marketName from fetch row (purposeText)"),
|
|
1410
|
+
isNativeIn: agentOptionalBooleanSchema()
|
|
1411
|
+
})
|
|
1412
|
+
)
|
|
1413
|
+
);
|
|
950
1414
|
var mcpEulerV2IsolatedBorrowInputSchema = mcpMultisignInput({
|
|
951
1415
|
vault: evmAddressSchema,
|
|
952
1416
|
collateralAsset: evmAddressSchema,
|
|
@@ -972,32 +1436,68 @@ var mcpEulerV2CollateralWithdrawInputSchema = mcpMultisignInput({
|
|
|
972
1436
|
collateralAsset: evmAddressSchema,
|
|
973
1437
|
amountHuman: z.string().min(1)
|
|
974
1438
|
});
|
|
975
|
-
var mcpMorphoVaultDepositInputSchema =
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1439
|
+
var mcpMorphoVaultDepositInputSchema = withMultisignKeySourceRefine(
|
|
1440
|
+
z.preprocess(
|
|
1441
|
+
preprocessMorphoVaultDepositInput,
|
|
1442
|
+
evmMultisignCommonInputSchema.extend({
|
|
1443
|
+
vaultAddress: evmAddressSchema.describe(
|
|
1444
|
+
"Vault contract address \u2014 copy vaultAddress from ctm_morpho_fetch_earn_vaults row."
|
|
1445
|
+
),
|
|
1446
|
+
underlyingAddress: evmAddressSchema.describe(
|
|
1447
|
+
"Deposit asset address \u2014 copy underlyingAddress from the same fetch row."
|
|
1448
|
+
),
|
|
1449
|
+
amountHuman: z.string().min(1).describe('Human-readable deposit amount (e.g. "1000" USDC).'),
|
|
1450
|
+
vaultName: z.string().optional().describe("Optional vaultName from fetch row (fills purposeText when omitted)."),
|
|
1451
|
+
vaultSymbol: z.string().optional().describe("Optional vaultSymbol from fetch row."),
|
|
1452
|
+
isNativeIn: agentOptionalBooleanSchema()
|
|
1453
|
+
})
|
|
1454
|
+
)
|
|
1455
|
+
);
|
|
1456
|
+
var mcpMorphoVaultWithdrawInputSchema = withMultisignKeySourceRefine(
|
|
1457
|
+
z.preprocess(
|
|
1458
|
+
preprocessMorphoVaultWithdrawInput,
|
|
1459
|
+
evmMultisignCommonInputSchema.extend({
|
|
1460
|
+
vaultAddress: evmAddressSchema.describe(
|
|
1461
|
+
"Vault contract address \u2014 copy vaultAddress from ctm_morpho_fetch_earn_vaults or positions."
|
|
1462
|
+
),
|
|
1463
|
+
amountHuman: z.string().min(1),
|
|
1464
|
+
vaultName: z.string().optional(),
|
|
1465
|
+
vaultSymbol: z.string().optional()
|
|
1466
|
+
})
|
|
1467
|
+
)
|
|
1468
|
+
);
|
|
1469
|
+
var mcpMorphoBlueCollateralDepositInputSchema = withMultisignKeySourceRefine(
|
|
1470
|
+
z.preprocess(
|
|
1471
|
+
preprocessMorphoBlueCollateralDepositInput,
|
|
1472
|
+
evmMultisignCommonInputSchema.extend({
|
|
1473
|
+
marketId: z.string().min(1).describe("marketId from ctm_morpho_fetch_blue_markets"),
|
|
1474
|
+
collateralToken: evmAddressSchema.describe("collateralTokenAddress from fetch row"),
|
|
1475
|
+
amountHuman: z.string().min(1),
|
|
1476
|
+
marketLabel: z.string().optional(),
|
|
1477
|
+
isNativeIn: agentOptionalBooleanSchema()
|
|
1478
|
+
})
|
|
1479
|
+
)
|
|
1480
|
+
);
|
|
1481
|
+
var mcpMorphoBlueBorrowInputSchema = withMultisignKeySourceRefine(
|
|
1482
|
+
z.preprocess(
|
|
1483
|
+
preprocessMorphoBlueBorrowRepayInput,
|
|
1484
|
+
evmMultisignCommonInputSchema.extend({
|
|
1485
|
+
marketId: z.string().min(1),
|
|
1486
|
+
loanToken: evmAddressSchema.describe("loanTokenAddress from ctm_morpho_fetch_blue_markets"),
|
|
1487
|
+
amountHuman: z.string().min(1)
|
|
1488
|
+
})
|
|
1489
|
+
)
|
|
1490
|
+
);
|
|
1491
|
+
var mcpMorphoBlueRepayInputSchema = withMultisignKeySourceRefine(
|
|
1492
|
+
z.preprocess(
|
|
1493
|
+
preprocessMorphoBlueBorrowRepayInput,
|
|
1494
|
+
evmMultisignCommonInputSchema.extend({
|
|
1495
|
+
marketId: z.string().min(1),
|
|
1496
|
+
loanToken: evmAddressSchema.describe("loanTokenAddress from fetch row"),
|
|
1497
|
+
amountHuman: z.string().min(1)
|
|
1498
|
+
})
|
|
1499
|
+
)
|
|
1500
|
+
);
|
|
1001
1501
|
var mcpMorphoBlueCollateralWithdrawInputSchema = mcpMultisignInput({
|
|
1002
1502
|
marketId: z.string().min(1),
|
|
1003
1503
|
amountHuman: z.string().min(1),
|
|
@@ -1008,46 +1508,39 @@ var mcpMorphoMerklClaimInputSchema = mcpMultisignInput({
|
|
|
1008
1508
|
distributor: evmAddressSchema.optional(),
|
|
1009
1509
|
valueWei: z.string().optional()
|
|
1010
1510
|
});
|
|
1011
|
-
var
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
chainId: z.number().int().positive(),
|
|
1018
|
-
underlying: z.string().trim().min(1).optional().describe("Deposit asset symbol (e.g. USDC) or ERC-20 address. Omit to search all listed vaults on the chain."),
|
|
1019
|
-
query: z.string().trim().min(1).optional().describe("Case-insensitive filter on vault name, symbol, address, or underlying symbol (e.g. Steakhouse, bbqUSDC)."),
|
|
1020
|
-
limit: z.number().int().min(1).max(200).optional().describe("Max rows (default 50).")
|
|
1511
|
+
var mcpEulerV2FetchLendVaultsInputSchema = z.object({
|
|
1512
|
+
chainId: agentEvmChainIdSchema,
|
|
1513
|
+
underlyingAddress: evmAddressSchema.describe(
|
|
1514
|
+
"Underlying asset address from get_defi_protocol_supported_tokens."
|
|
1515
|
+
),
|
|
1516
|
+
limit: z.number().int().min(1).max(100).optional().describe("Max vault rows (default 30).")
|
|
1021
1517
|
});
|
|
1022
|
-
var
|
|
1518
|
+
var mcpEulerV2FetchLendVaultsOutputSchema = z.object({
|
|
1023
1519
|
vaults: z.array(
|
|
1024
1520
|
z.object({
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
vaultSymbol: z.string(),
|
|
1521
|
+
evaultAddress: z.string().describe("Copy as vault / evaultAddress for isolated lend multisign"),
|
|
1522
|
+
marketName: z.string(),
|
|
1028
1523
|
underlyingAddress: z.string(),
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
performanceFee: z.string(),
|
|
1036
|
-
managementFee: z.string().nullable(),
|
|
1037
|
-
totalDepositsUsd: z.string(),
|
|
1038
|
-
liquidityUsd: z.string(),
|
|
1039
|
-
exposure: z.array(morphoExposureRowSchema)
|
|
1524
|
+
underlyingDecimals: z.number().int(),
|
|
1525
|
+
supplyApyPercentLabel: z.string(),
|
|
1526
|
+
borrowApyPercentLabel: z.string(),
|
|
1527
|
+
availableLiquidityFormatted: z.string(),
|
|
1528
|
+
totalSupplyFormatted: z.string(),
|
|
1529
|
+
evcAddress: z.string().nullable()
|
|
1040
1530
|
})
|
|
1041
1531
|
)
|
|
1042
1532
|
});
|
|
1043
|
-
function mcpGmxMultisignInput(fields) {
|
|
1044
|
-
|
|
1533
|
+
function mcpGmxMultisignInput(fields, preprocess) {
|
|
1534
|
+
const inner = evmMultisignCommonInputSchema.extend(fields);
|
|
1535
|
+
const shaped = preprocess ? z.preprocess(preprocess, inner) : inner;
|
|
1536
|
+
return withMultisignKeySourceRefine(shaped);
|
|
1045
1537
|
}
|
|
1046
1538
|
var gmxDirectionSchema = z.enum(["long", "short"]);
|
|
1047
1539
|
var gmxOrderTypeSchema = z.enum(["market", "limit"]);
|
|
1048
|
-
var
|
|
1049
|
-
chainId:
|
|
1540
|
+
var gmxFetchChainInputSchema = z.object({
|
|
1541
|
+
chainId: agentEvmChainIdSchema
|
|
1050
1542
|
});
|
|
1543
|
+
var mcpGmxFetchMarketsInputSchema = gmxFetchChainInputSchema;
|
|
1051
1544
|
var mcpGmxFetchMarketsOutputSchema = z.object({
|
|
1052
1545
|
markets: z.array(
|
|
1053
1546
|
z.object({
|
|
@@ -1058,53 +1551,95 @@ var mcpGmxFetchMarketsOutputSchema = z.object({
|
|
|
1058
1551
|
)
|
|
1059
1552
|
});
|
|
1060
1553
|
var mcpGmxFetchPositionsInputSchema = z.object({
|
|
1061
|
-
chainId:
|
|
1554
|
+
chainId: agentEvmChainIdSchema,
|
|
1062
1555
|
executorAddress: evmAddressSchema
|
|
1063
1556
|
});
|
|
1064
1557
|
var mcpGmxFetchPositionsOutputSchema = z.object({
|
|
1065
|
-
positions: z.array(
|
|
1558
|
+
positions: z.array(
|
|
1559
|
+
z.object({
|
|
1560
|
+
key: z.string(),
|
|
1561
|
+
symbol: z.string().nullable().describe("GMX market symbol \u2014 pass to build_decrease as symbol"),
|
|
1562
|
+
indexName: z.string(),
|
|
1563
|
+
isLong: z.boolean(),
|
|
1564
|
+
direction: z.enum(["long", "short"]).describe("Derived from isLong \u2014 pass to build_decrease"),
|
|
1565
|
+
sizeUsd: z.string().nullable().describe("Copy as sizeUsdHuman for partial close"),
|
|
1566
|
+
collateralUsd: z.string().nullable(),
|
|
1567
|
+
collateralSymbol: z.string().nullable().describe("Copy as collateralToken"),
|
|
1568
|
+
entryPriceUsd: z.string().nullable(),
|
|
1569
|
+
markPriceUsd: z.string().nullable(),
|
|
1570
|
+
liquidationPriceUsd: z.string().nullable(),
|
|
1571
|
+
leverageLabel: z.string().nullable(),
|
|
1572
|
+
pnlUsd: z.string().nullable()
|
|
1573
|
+
})
|
|
1574
|
+
)
|
|
1066
1575
|
});
|
|
1067
|
-
var
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
orderType: gmxOrderTypeSchema,
|
|
1071
|
-
sizeUsdHuman: z.string().min(1),
|
|
1072
|
-
collateralToken: z.string().min(1),
|
|
1073
|
-
collateralAmountHuman: z.string().min(1),
|
|
1074
|
-
triggerPriceUsdHuman: z.string().optional(),
|
|
1075
|
-
slippageBps: z.number().int().nonnegative().optional(),
|
|
1076
|
-
executionFeeBufferBps: z.number().int().nonnegative().optional()
|
|
1576
|
+
var mcpGmxFetchOrdersInputSchema = z.object({
|
|
1577
|
+
chainId: agentEvmChainIdSchema,
|
|
1578
|
+
executorAddress: evmAddressSchema
|
|
1077
1579
|
});
|
|
1078
|
-
var
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
slippageBps: z.number().int().nonnegative().optional(),
|
|
1088
|
-
executionFeeBufferBps: z.number().int().nonnegative().optional()
|
|
1580
|
+
var mcpGmxFetchOrdersOutputSchema = z.object({
|
|
1581
|
+
orders: z.array(
|
|
1582
|
+
z.object({
|
|
1583
|
+
orderId: z.string().describe("Order key \u2014 pass to build_cancel_multisign as orderId"),
|
|
1584
|
+
isLong: z.boolean().optional(),
|
|
1585
|
+
sizeDeltaUsd: z.string().nullable().optional(),
|
|
1586
|
+
triggerPrice: z.string().nullable().optional()
|
|
1587
|
+
})
|
|
1588
|
+
)
|
|
1089
1589
|
});
|
|
1590
|
+
var mcpGmxIncreaseInputSchema = mcpGmxMultisignInput(
|
|
1591
|
+
{
|
|
1592
|
+
symbol: z.string().min(1).describe("Market symbol from ctm_gmx_fetch_markets"),
|
|
1593
|
+
direction: gmxDirectionSchema,
|
|
1594
|
+
orderType: gmxOrderTypeSchema,
|
|
1595
|
+
sizeUsdHuman: z.string().min(1),
|
|
1596
|
+
collateralToken: z.string().min(1),
|
|
1597
|
+
collateralAmountHuman: z.string().min(1),
|
|
1598
|
+
triggerPriceUsdHuman: z.string().optional(),
|
|
1599
|
+
slippageBps: z.number().int().nonnegative().optional(),
|
|
1600
|
+
executionFeeBufferBps: z.number().int().nonnegative().optional()
|
|
1601
|
+
},
|
|
1602
|
+
preprocessGmxIncreaseInput
|
|
1603
|
+
);
|
|
1604
|
+
var mcpGmxDecreaseInputSchema = mcpGmxMultisignInput(
|
|
1605
|
+
{
|
|
1606
|
+
symbol: z.string().min(1).describe("symbol from ctm_gmx_fetch_positions or fetch_markets"),
|
|
1607
|
+
direction: gmxDirectionSchema.describe("direction from position row or isLong"),
|
|
1608
|
+
orderType: gmxOrderTypeSchema,
|
|
1609
|
+
sizeUsdHuman: z.string().min(1).describe("sizeUsd from position row"),
|
|
1610
|
+
collateralToken: z.string().min(1).describe("collateralSymbol from position row"),
|
|
1611
|
+
receiveToken: z.string().optional(),
|
|
1612
|
+
triggerPriceUsdHuman: z.string().optional(),
|
|
1613
|
+
keepLeverage: agentOptionalBooleanSchema(),
|
|
1614
|
+
slippageBps: z.number().int().nonnegative().optional(),
|
|
1615
|
+
executionFeeBufferBps: z.number().int().nonnegative().optional()
|
|
1616
|
+
},
|
|
1617
|
+
preprocessGmxDecreaseInput
|
|
1618
|
+
);
|
|
1090
1619
|
var mcpGmxCancelInputSchema = mcpGmxMultisignInput({
|
|
1091
|
-
orderId: z.string().min(1)
|
|
1092
|
-
});
|
|
1093
|
-
var mcpGmxGmDepositInputSchema = mcpGmxMultisignInput({
|
|
1094
|
-
marketSymbol: z.string().min(1),
|
|
1095
|
-
collateralToken: z.string().min(1),
|
|
1096
|
-
collateralAmountHuman: z.string().min(1),
|
|
1097
|
-
executionFeeBufferBps: z.number().int().nonnegative().optional(),
|
|
1098
|
-
isNativeIn: z.boolean().optional(),
|
|
1099
|
-
nativeWrapped: evmAddressSchema.optional()
|
|
1100
|
-
});
|
|
1101
|
-
var mcpGmxGmWithdrawInputSchema = mcpGmxMultisignInput({
|
|
1102
|
-
marketSymbol: z.string().min(1),
|
|
1103
|
-
gmAmountHuman: z.string().min(1),
|
|
1104
|
-
gmDecimals: z.number().int().nonnegative().optional(),
|
|
1105
|
-
executionFeeBufferBps: z.number().int().nonnegative().optional(),
|
|
1106
|
-
isNativeOut: z.boolean().optional()
|
|
1620
|
+
orderId: z.string().min(1).describe("orderId from ctm_gmx_fetch_orders")
|
|
1107
1621
|
});
|
|
1622
|
+
var mcpGmxGmDepositInputSchema = mcpGmxMultisignInput(
|
|
1623
|
+
{
|
|
1624
|
+
marketSymbol: z.string().min(1).describe("symbol from ctm_gmx_fetch_gm_markets"),
|
|
1625
|
+
collateralToken: z.string().min(1).describe("longTokenSymbol or shortTokenSymbol from GM market row"),
|
|
1626
|
+
collateralAmountHuman: z.string().min(1),
|
|
1627
|
+
executionFeeBufferBps: z.number().int().nonnegative().optional(),
|
|
1628
|
+
isNativeIn: agentOptionalBooleanSchema(),
|
|
1629
|
+
nativeWrapped: evmAddressSchema.optional()
|
|
1630
|
+
},
|
|
1631
|
+
preprocessGmxGmBuildInput
|
|
1632
|
+
);
|
|
1633
|
+
var mcpGmxGmWithdrawInputSchema = mcpGmxMultisignInput(
|
|
1634
|
+
{
|
|
1635
|
+
marketSymbol: z.string().min(1).describe("symbol from ctm_gmx_fetch_gm_markets"),
|
|
1636
|
+
gmAmountHuman: z.string().min(1),
|
|
1637
|
+
gmDecimals: z.number().int().nonnegative().optional(),
|
|
1638
|
+
executionFeeBufferBps: z.number().int().nonnegative().optional(),
|
|
1639
|
+
isNativeOut: agentOptionalBooleanSchema()
|
|
1640
|
+
},
|
|
1641
|
+
preprocessGmxGmBuildInput
|
|
1642
|
+
);
|
|
1108
1643
|
var mcpGmxStakeGmxInputSchema = mcpGmxMultisignInput({
|
|
1109
1644
|
amountHuman: z.string().min(1),
|
|
1110
1645
|
gmxDecimals: z.number().int().nonnegative().optional()
|
|
@@ -1113,9 +1648,7 @@ var mcpGmxUnstakeGmxInputSchema = mcpGmxMultisignInput({
|
|
|
1113
1648
|
amountHuman: z.string().min(1),
|
|
1114
1649
|
gmxDecimals: z.number().int().nonnegative().optional()
|
|
1115
1650
|
});
|
|
1116
|
-
var mcpGmxFetchGmMarketsInputSchema =
|
|
1117
|
-
chainId: z.number().int().positive()
|
|
1118
|
-
});
|
|
1651
|
+
var mcpGmxFetchGmMarketsInputSchema = gmxFetchChainInputSchema;
|
|
1119
1652
|
var mcpGmxGmMarketApyRowSchema = z.object({
|
|
1120
1653
|
symbol: z.string(),
|
|
1121
1654
|
marketTokenAddress: z.string(),
|
|
@@ -1129,9 +1662,7 @@ var mcpGmxGmMarketApyRowSchema = z.object({
|
|
|
1129
1662
|
var mcpGmxFetchGmMarketsOutputSchema = z.object({
|
|
1130
1663
|
markets: z.array(mcpGmxGmMarketApyRowSchema)
|
|
1131
1664
|
});
|
|
1132
|
-
var mcpGmxFetchGmApyInputSchema =
|
|
1133
|
-
chainId: z.number().int().positive()
|
|
1134
|
-
});
|
|
1665
|
+
var mcpGmxFetchGmApyInputSchema = gmxFetchChainInputSchema;
|
|
1135
1666
|
var mcpGmxFetchGmApyOutputSchema = z.object({
|
|
1136
1667
|
markets: z.array(
|
|
1137
1668
|
z.object({
|
|
@@ -1147,7 +1678,7 @@ var mcpGmxFetchGmApyOutputSchema = z.object({
|
|
|
1147
1678
|
)
|
|
1148
1679
|
});
|
|
1149
1680
|
var mcpGmxFetchStakingPowerInputSchema = z.object({
|
|
1150
|
-
chainId:
|
|
1681
|
+
chainId: agentEvmChainIdSchema,
|
|
1151
1682
|
executorAddress: evmAddressSchema
|
|
1152
1683
|
});
|
|
1153
1684
|
var mcpGmxFetchStakingPowerOutputSchema = z.object({
|
|
@@ -1163,7 +1694,7 @@ var gmxOhlcvCandleSchema = z.object({
|
|
|
1163
1694
|
close: z.string()
|
|
1164
1695
|
});
|
|
1165
1696
|
var mcpGmxFetchMarketPricesInputSchema = z.object({
|
|
1166
|
-
chainId:
|
|
1697
|
+
chainId: agentEvmChainIdSchema,
|
|
1167
1698
|
symbol: z.string().min(1),
|
|
1168
1699
|
collateralSymbol: z.string().min(1)
|
|
1169
1700
|
});
|
|
@@ -1177,7 +1708,7 @@ var mcpGmxFetchMarketPricesOutputSchema = z.object({
|
|
|
1177
1708
|
fetchedAtMs: z.number()
|
|
1178
1709
|
});
|
|
1179
1710
|
var mcpGmxFetchOhlcvInputSchema = z.object({
|
|
1180
|
-
chainId:
|
|
1711
|
+
chainId: agentEvmChainIdSchema,
|
|
1181
1712
|
symbol: z.string().min(1),
|
|
1182
1713
|
timeframe: gmxOhlcvTimeframeSchema.optional(),
|
|
1183
1714
|
limit: z.number().int().positive().max(500).optional(),
|
|
@@ -1188,8 +1719,10 @@ var mcpGmxFetchOhlcvOutputSchema = z.object({
|
|
|
1188
1719
|
timeframe: gmxOhlcvTimeframeSchema,
|
|
1189
1720
|
candles: z.array(gmxOhlcvCandleSchema)
|
|
1190
1721
|
});
|
|
1191
|
-
function mcpHyperliquidMultisignInput(fields) {
|
|
1192
|
-
|
|
1722
|
+
function mcpHyperliquidMultisignInput(fields, preprocess) {
|
|
1723
|
+
const inner = evmMultisignCommonInputSchema.extend(fields);
|
|
1724
|
+
const shaped = preprocess ? z.preprocess(preprocess, inner) : inner;
|
|
1725
|
+
return withMultisignKeySourceRefine(shaped);
|
|
1193
1726
|
}
|
|
1194
1727
|
var hyperliquidTifSchema = z.enum(["alo", "gtc", "ioc"]);
|
|
1195
1728
|
var hyperliquidOhlcvIntervalSchema = z.enum([
|
|
@@ -1208,11 +1741,14 @@ var hyperliquidOhlcvIntervalSchema = z.enum([
|
|
|
1208
1741
|
"1w",
|
|
1209
1742
|
"1M"
|
|
1210
1743
|
]);
|
|
1744
|
+
var hyperliquidFetchChainInputSchema = z.object({
|
|
1745
|
+
chainId: agentEvmChainIdSchema
|
|
1746
|
+
});
|
|
1211
1747
|
var hyperliquidPositionRowSchema = z.object({
|
|
1212
1748
|
key: z.string(),
|
|
1213
1749
|
coin: z.string(),
|
|
1214
1750
|
isLong: z.boolean(),
|
|
1215
|
-
size: z.string().nullable(),
|
|
1751
|
+
size: z.string().nullable().describe("Copy as szHuman for build_close_multisign"),
|
|
1216
1752
|
entryPx: z.string().nullable(),
|
|
1217
1753
|
positionValueUsd: z.string().nullable(),
|
|
1218
1754
|
unrealizedPnlUsd: z.string().nullable(),
|
|
@@ -1233,14 +1769,13 @@ var hyperliquidAccountSummarySchema = z.object({
|
|
|
1233
1769
|
totalMarginUsedUsd: z.string().nullable(),
|
|
1234
1770
|
withdrawableUsd: z.string().nullable()
|
|
1235
1771
|
});
|
|
1236
|
-
var mcpHyperliquidFetchMarketsInputSchema =
|
|
1237
|
-
chainId: z.number().int().positive(),
|
|
1772
|
+
var mcpHyperliquidFetchMarketsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1238
1773
|
dex: z.string().optional()
|
|
1239
1774
|
});
|
|
1240
1775
|
var mcpHyperliquidFetchMarketsOutputSchema = z.object({
|
|
1241
1776
|
markets: z.array(
|
|
1242
1777
|
z.object({
|
|
1243
|
-
name: z.string(),
|
|
1778
|
+
name: z.string().describe("Perp coin name \u2014 alias for build limit order coin"),
|
|
1244
1779
|
asset: z.number(),
|
|
1245
1780
|
szDecimals: z.number(),
|
|
1246
1781
|
maxLeverage: z.number(),
|
|
@@ -1255,8 +1790,7 @@ var mcpHyperliquidFetchMarketsOutputSchema = z.object({
|
|
|
1255
1790
|
})
|
|
1256
1791
|
)
|
|
1257
1792
|
});
|
|
1258
|
-
var mcpHyperliquidSearchMarketsInputSchema =
|
|
1259
|
-
chainId: z.number().int().positive(),
|
|
1793
|
+
var mcpHyperliquidSearchMarketsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1260
1794
|
query: z.string().min(1),
|
|
1261
1795
|
dex: z.string().optional(),
|
|
1262
1796
|
limit: z.number().int().positive().max(50).optional()
|
|
@@ -1279,8 +1813,7 @@ var mcpHyperliquidSearchMarketsOutputSchema = z.object({
|
|
|
1279
1813
|
})
|
|
1280
1814
|
)
|
|
1281
1815
|
});
|
|
1282
|
-
var mcpHyperliquidFetchOpenContextInputSchema =
|
|
1283
|
-
chainId: z.number().int().positive(),
|
|
1816
|
+
var mcpHyperliquidFetchOpenContextInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1284
1817
|
executorAddress: evmAddressSchema,
|
|
1285
1818
|
coin: z.string().min(1),
|
|
1286
1819
|
dex: z.string().optional()
|
|
@@ -1291,16 +1824,14 @@ var mcpHyperliquidFetchOpenContextOutputSchema = z.object({
|
|
|
1291
1824
|
activeAsset: hyperliquidActiveAssetSchema
|
|
1292
1825
|
})
|
|
1293
1826
|
});
|
|
1294
|
-
var mcpHyperliquidFetchPositionsInputSchema =
|
|
1295
|
-
chainId: z.number().int().positive(),
|
|
1827
|
+
var mcpHyperliquidFetchPositionsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1296
1828
|
executorAddress: evmAddressSchema,
|
|
1297
1829
|
dex: z.string().optional()
|
|
1298
1830
|
});
|
|
1299
1831
|
var mcpHyperliquidFetchPositionsOutputSchema = z.object({
|
|
1300
1832
|
positions: z.array(hyperliquidPositionRowSchema)
|
|
1301
1833
|
});
|
|
1302
|
-
var mcpHyperliquidFetchOpenOrdersInputSchema =
|
|
1303
|
-
chainId: z.number().int().positive(),
|
|
1834
|
+
var mcpHyperliquidFetchOpenOrdersInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1304
1835
|
executorAddress: evmAddressSchema,
|
|
1305
1836
|
dex: z.string().optional()
|
|
1306
1837
|
});
|
|
@@ -1311,18 +1842,16 @@ var mcpHyperliquidFetchOpenOrdersOutputSchema = z.object({
|
|
|
1311
1842
|
side: z.string(),
|
|
1312
1843
|
limitPx: z.string(),
|
|
1313
1844
|
sz: z.string(),
|
|
1314
|
-
oid: z.number(),
|
|
1845
|
+
oid: z.number().describe("Pass to build_cancel_multisign as oid"),
|
|
1315
1846
|
timestamp: z.number(),
|
|
1316
1847
|
reduceOnly: z.boolean().optional()
|
|
1317
1848
|
})
|
|
1318
1849
|
)
|
|
1319
1850
|
});
|
|
1320
|
-
var mcpHyperliquidFetchMarketSnapshotInputSchema =
|
|
1321
|
-
chainId: z.number().int().positive(),
|
|
1851
|
+
var mcpHyperliquidFetchMarketSnapshotInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1322
1852
|
coin: z.string().min(1),
|
|
1323
1853
|
interval: hyperliquidOhlcvIntervalSchema.optional(),
|
|
1324
1854
|
dex: z.string().optional(),
|
|
1325
|
-
/** Recent OHLCV bars to return (default 48, max 200). Live price is always current. */
|
|
1326
1855
|
candleLimit: z.number().int().positive().max(200).optional()
|
|
1327
1856
|
});
|
|
1328
1857
|
var hyperliquidOhlcvCandleSchema = z.object({
|
|
@@ -1353,21 +1882,16 @@ var mcpHyperliquidFetchMarketSnapshotOutputSchema = z.object({
|
|
|
1353
1882
|
candles: z.array(hyperliquidOhlcvCandleSchema),
|
|
1354
1883
|
candleCount: z.number()
|
|
1355
1884
|
}),
|
|
1356
|
-
resolvedCoin: z.string(),
|
|
1885
|
+
resolvedCoin: z.string().describe("Canonical coin \u2014 alias for build coin"),
|
|
1357
1886
|
dex: z.string().nullable()
|
|
1358
1887
|
});
|
|
1359
|
-
var mcpHyperliquidFetchOhlcvInputSchema =
|
|
1360
|
-
chainId: z.number().int().positive(),
|
|
1888
|
+
var mcpHyperliquidFetchOhlcvInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1361
1889
|
coin: z.string().min(1),
|
|
1362
1890
|
interval: hyperliquidOhlcvIntervalSchema.optional(),
|
|
1363
1891
|
dex: z.string().optional(),
|
|
1364
|
-
/** Calendar-day lookback ending now (e.g. 7 = last week). Preferred for agent requests. */
|
|
1365
1892
|
lookbackDays: z.number().positive().max(90).optional(),
|
|
1366
|
-
/** Hour lookback ending now. Alternative to lookbackDays. */
|
|
1367
1893
|
lookbackHours: z.number().positive().max(90 * 24).optional(),
|
|
1368
|
-
/** Explicit range start (ms since epoch). Use with endTimeMs. */
|
|
1369
1894
|
startTimeMs: z.number().int().positive().optional(),
|
|
1370
|
-
/** Explicit range end (ms since epoch). Defaults to now. */
|
|
1371
1895
|
endTimeMs: z.number().int().positive().optional()
|
|
1372
1896
|
});
|
|
1373
1897
|
var mcpHyperliquidFetchOhlcvOutputSchema = z.object({
|
|
@@ -1386,8 +1910,7 @@ var mcpHyperliquidFetchOhlcvOutputSchema = z.object({
|
|
|
1386
1910
|
resolvedCoin: z.string(),
|
|
1387
1911
|
dex: z.string().nullable()
|
|
1388
1912
|
});
|
|
1389
|
-
var mcpHyperliquidFetchUsdClassBalancesInputSchema =
|
|
1390
|
-
chainId: z.number().int().positive(),
|
|
1913
|
+
var mcpHyperliquidFetchUsdClassBalancesInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1391
1914
|
executorAddress: evmAddressSchema
|
|
1392
1915
|
});
|
|
1393
1916
|
var mcpHyperliquidFetchUsdClassBalancesOutputSchema = z.object({
|
|
@@ -1396,34 +1919,31 @@ var mcpHyperliquidFetchUsdClassBalancesOutputSchema = z.object({
|
|
|
1396
1919
|
perpWithdrawable: z.string()
|
|
1397
1920
|
})
|
|
1398
1921
|
});
|
|
1399
|
-
var mcpHyperliquidFetchVaultsInputSchema =
|
|
1400
|
-
chainId: z.number().int().positive(),
|
|
1922
|
+
var mcpHyperliquidFetchVaultsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1401
1923
|
executorAddress: evmAddressSchema.optional()
|
|
1402
1924
|
});
|
|
1403
1925
|
var mcpHyperliquidFetchVaultsOutputSchema = z.object({
|
|
1404
1926
|
vaults: z.array(
|
|
1405
1927
|
z.object({
|
|
1406
1928
|
vaultAddress: z.string(),
|
|
1407
|
-
name: z.string(),
|
|
1929
|
+
name: z.string().describe("Optional vaultName for purposeText on deposit"),
|
|
1408
1930
|
apr: z.number().nullable(),
|
|
1409
1931
|
tvlUsd: z.string().nullable()
|
|
1410
1932
|
})
|
|
1411
1933
|
)
|
|
1412
1934
|
});
|
|
1413
|
-
var mcpHyperliquidFetchUserVaultEquitiesInputSchema =
|
|
1414
|
-
chainId: z.number().int().positive(),
|
|
1935
|
+
var mcpHyperliquidFetchUserVaultEquitiesInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1415
1936
|
executorAddress: evmAddressSchema
|
|
1416
1937
|
});
|
|
1417
1938
|
var mcpHyperliquidFetchUserVaultEquitiesOutputSchema = z.object({
|
|
1418
1939
|
rows: z.array(
|
|
1419
1940
|
z.object({
|
|
1420
1941
|
vaultAddress: z.string(),
|
|
1421
|
-
equity: z.string()
|
|
1942
|
+
equity: z.string().describe("Copy as usdHuman for build_vault_withdraw_multisign")
|
|
1422
1943
|
})
|
|
1423
1944
|
)
|
|
1424
1945
|
});
|
|
1425
|
-
var mcpHyperliquidFetchStakingSummaryInputSchema =
|
|
1426
|
-
chainId: z.number().int().positive(),
|
|
1946
|
+
var mcpHyperliquidFetchStakingSummaryInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1427
1947
|
executorAddress: evmAddressSchema
|
|
1428
1948
|
});
|
|
1429
1949
|
var mcpHyperliquidFetchStakingSummaryOutputSchema = z.object({
|
|
@@ -1432,53 +1952,68 @@ var mcpHyperliquidFetchStakingSummaryOutputSchema = z.object({
|
|
|
1432
1952
|
undelegated: z.string()
|
|
1433
1953
|
})
|
|
1434
1954
|
});
|
|
1435
|
-
var mcpHyperliquidFetchDelegationsInputSchema =
|
|
1436
|
-
chainId: z.number().int().positive(),
|
|
1955
|
+
var mcpHyperliquidFetchDelegationsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1437
1956
|
executorAddress: evmAddressSchema
|
|
1438
1957
|
});
|
|
1439
1958
|
var mcpHyperliquidFetchDelegationsOutputSchema = z.object({
|
|
1440
1959
|
delegations: z.array(
|
|
1441
1960
|
z.object({
|
|
1442
1961
|
validator: z.string(),
|
|
1443
|
-
amount: z.string()
|
|
1962
|
+
amount: z.string().describe("Copy as hypeHuman for build_undelegate_multisign")
|
|
1444
1963
|
})
|
|
1445
1964
|
)
|
|
1446
1965
|
});
|
|
1447
|
-
var mcpHyperliquidLimitOrderInputSchema = mcpHyperliquidMultisignInput(
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1966
|
+
var mcpHyperliquidLimitOrderInputSchema = mcpHyperliquidMultisignInput(
|
|
1967
|
+
{
|
|
1968
|
+
coin: z.string().min(1).describe("coin from fetch_markets (name) or search_markets"),
|
|
1969
|
+
isBuy: agentBooleanSchema(),
|
|
1970
|
+
limitPxHuman: z.string().min(1).describe("limitPx or markPx from open_context"),
|
|
1971
|
+
szHuman: z.string().min(1),
|
|
1972
|
+
marketKind: z.enum(["perp", "spot"]).optional(),
|
|
1973
|
+
tif: hyperliquidTifSchema.optional(),
|
|
1974
|
+
dex: z.string().optional()
|
|
1975
|
+
},
|
|
1976
|
+
preprocessHyperliquidLimitOrderInput
|
|
1977
|
+
);
|
|
1978
|
+
var mcpHyperliquidCloseInputSchema = mcpHyperliquidMultisignInput(
|
|
1979
|
+
{
|
|
1980
|
+
coin: z.string().min(1),
|
|
1981
|
+
isLong: agentBooleanSchema(),
|
|
1982
|
+
limitPxHuman: z.string().min(1),
|
|
1983
|
+
szHuman: z.string().min(1).describe("size from fetch_positions"),
|
|
1984
|
+
dex: z.string().optional(),
|
|
1985
|
+
tif: hyperliquidTifSchema.optional()
|
|
1986
|
+
},
|
|
1987
|
+
preprocessHyperliquidCloseInput
|
|
1988
|
+
);
|
|
1989
|
+
var mcpHyperliquidCancelInputSchema = mcpHyperliquidMultisignInput(
|
|
1990
|
+
{
|
|
1991
|
+
coin: z.string().min(1),
|
|
1992
|
+
oid: z.number().int().positive().describe("oid from fetch_open_orders"),
|
|
1993
|
+
marketKind: z.enum(["perp", "spot"]).optional(),
|
|
1994
|
+
dex: z.string().optional()
|
|
1995
|
+
},
|
|
1996
|
+
preprocessHyperliquidCoinInput
|
|
1997
|
+
);
|
|
1470
1998
|
var mcpHyperliquidUsdTransferInputSchema = mcpHyperliquidMultisignInput({
|
|
1471
1999
|
usdHuman: z.string().min(1),
|
|
1472
|
-
toPerp:
|
|
1473
|
-
});
|
|
1474
|
-
var mcpHyperliquidVaultDepositInputSchema = mcpHyperliquidMultisignInput({
|
|
1475
|
-
vaultAddress: evmAddressSchema,
|
|
1476
|
-
usdHuman: z.string().min(1)
|
|
1477
|
-
});
|
|
1478
|
-
var mcpHyperliquidVaultWithdrawInputSchema = mcpHyperliquidMultisignInput({
|
|
1479
|
-
vaultAddress: evmAddressSchema,
|
|
1480
|
-
usdHuman: z.string().min(1)
|
|
2000
|
+
toPerp: agentBooleanSchema()
|
|
1481
2001
|
});
|
|
2002
|
+
var mcpHyperliquidVaultDepositInputSchema = mcpHyperliquidMultisignInput(
|
|
2003
|
+
{
|
|
2004
|
+
vaultAddress: evmAddressSchema.describe("vaultAddress from fetch_vaults"),
|
|
2005
|
+
usdHuman: z.string().min(1),
|
|
2006
|
+
vaultName: z.string().optional().describe("name from fetch_vaults row")
|
|
2007
|
+
},
|
|
2008
|
+
preprocessHyperliquidVaultDepositInput
|
|
2009
|
+
);
|
|
2010
|
+
var mcpHyperliquidVaultWithdrawInputSchema = mcpHyperliquidMultisignInput(
|
|
2011
|
+
{
|
|
2012
|
+
vaultAddress: evmAddressSchema,
|
|
2013
|
+
usdHuman: z.string().min(1).describe("equity from fetch_user_vault_equities")
|
|
2014
|
+
},
|
|
2015
|
+
preprocessHyperliquidVaultWithdrawInput
|
|
2016
|
+
);
|
|
1482
2017
|
var mcpHyperliquidStakeInputSchema = mcpHyperliquidMultisignInput({
|
|
1483
2018
|
hypeHuman: z.string().min(1)
|
|
1484
2019
|
});
|
|
@@ -1489,10 +2024,13 @@ var mcpHyperliquidDelegateInputSchema = mcpHyperliquidMultisignInput({
|
|
|
1489
2024
|
hypeHuman: z.string().min(1),
|
|
1490
2025
|
validator: evmAddressSchema
|
|
1491
2026
|
});
|
|
1492
|
-
var mcpHyperliquidUndelegateInputSchema = mcpHyperliquidMultisignInput(
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
2027
|
+
var mcpHyperliquidUndelegateInputSchema = mcpHyperliquidMultisignInput(
|
|
2028
|
+
{
|
|
2029
|
+
hypeHuman: z.string().min(1).describe("amount from fetch_delegations"),
|
|
2030
|
+
validator: evmAddressSchema
|
|
2031
|
+
},
|
|
2032
|
+
preprocessHyperliquidUndelegateInput
|
|
2033
|
+
);
|
|
1496
2034
|
|
|
1497
2035
|
// src/agent/mcpProtocolTools.ts
|
|
1498
2036
|
function defineProtocolMcpTool(def) {
|
|
@@ -1804,8 +2342,7 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1804
2342
|
prerequisites: [
|
|
1805
2343
|
"keyGenId",
|
|
1806
2344
|
"chainId",
|
|
1807
|
-
"vaultAddress from ctm_morpho_fetch_earn_vaults",
|
|
1808
|
-
"underlying",
|
|
2345
|
+
"vaultAddress + underlyingAddress from ctm_morpho_fetch_earn_vaults",
|
|
1809
2346
|
"amountHuman"
|
|
1810
2347
|
],
|
|
1811
2348
|
handler: { importPath: "protocols/evm/morpho", exportName: "buildEvmMultisignBodyMorphoVaultDepositBatch" },
|
|
@@ -2331,13 +2868,25 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
2331
2868
|
actionId: "gmx.fetch-positions",
|
|
2332
2869
|
protocolId: "gmx",
|
|
2333
2870
|
chainCategory: "evm",
|
|
2334
|
-
description: "Fetch open GMX perp positions
|
|
2871
|
+
description: "Fetch open GMX perp positions (symbol, direction, sizeUsd, collateralSymbol) for build_decrease. Read-only.",
|
|
2335
2872
|
prerequisites: ["chainId", "executorAddress (MPC ethereumaddress)"],
|
|
2336
2873
|
followUp: ["ctm_gmx_build_decrease_multisign"],
|
|
2337
2874
|
handler: { importPath: "protocols/evm/gmx", exportName: "gmxFetchPositionsForExecutor" },
|
|
2338
2875
|
inputZod: mcpGmxFetchPositionsInputSchema,
|
|
2339
2876
|
outputZod: mcpGmxFetchPositionsOutputSchema
|
|
2340
2877
|
}),
|
|
2878
|
+
defineMcpTool({
|
|
2879
|
+
name: "ctm_gmx_fetch_orders",
|
|
2880
|
+
actionId: "gmx.fetch-orders",
|
|
2881
|
+
protocolId: "gmx",
|
|
2882
|
+
chainCategory: "evm",
|
|
2883
|
+
description: "Fetch pending GMX orders (orderId) for build_cancel_multisign. Read-only.",
|
|
2884
|
+
prerequisites: ["chainId", "executorAddress"],
|
|
2885
|
+
followUp: ["ctm_gmx_build_cancel_multisign"],
|
|
2886
|
+
handler: { importPath: "protocols/evm/gmx", exportName: "gmxFetchOrdersSummary" },
|
|
2887
|
+
inputZod: mcpGmxFetchOrdersInputSchema,
|
|
2888
|
+
outputZod: mcpGmxFetchOrdersOutputSchema
|
|
2889
|
+
}),
|
|
2341
2890
|
defineMcpTool({
|
|
2342
2891
|
name: "ctm_gmx_fetch_market_prices",
|
|
2343
2892
|
actionId: "gmx.fetch-market-prices",
|
|
@@ -2542,6 +3091,34 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
2542
3091
|
inputZod: mcpHyperliquidFetchDelegationsInputSchema,
|
|
2543
3092
|
outputZod: mcpHyperliquidFetchDelegationsOutputSchema
|
|
2544
3093
|
}),
|
|
3094
|
+
defineMcpTool({
|
|
3095
|
+
name: "ctm_morpho_fetch_blue_markets",
|
|
3096
|
+
actionId: "morpho.fetch-blue-markets",
|
|
3097
|
+
protocolId: "morpho",
|
|
3098
|
+
chainCategory: "evm",
|
|
3099
|
+
description: "Morpho Blue borrow markets. Filter by collateral/loan asset; returns marketId and token addresses for blue multisign tools.",
|
|
3100
|
+
prerequisites: ["chainId"],
|
|
3101
|
+
followUp: [
|
|
3102
|
+
"ctm_morpho_build_blue_collateral_deposit_multisign",
|
|
3103
|
+
"ctm_morpho_build_blue_borrow_multisign",
|
|
3104
|
+
"ctm_morpho_build_blue_repay_multisign"
|
|
3105
|
+
],
|
|
3106
|
+
handler: { importPath: "protocols/evm/morpho", exportName: "morphoFetchBlueMarketsSummary" },
|
|
3107
|
+
inputZod: mcpMorphoFetchBlueMarketsInputSchema,
|
|
3108
|
+
outputZod: mcpMorphoFetchBlueMarketsOutputSchema
|
|
3109
|
+
}),
|
|
3110
|
+
defineMcpTool({
|
|
3111
|
+
name: "ctm_euler_v2_fetch_lend_vaults",
|
|
3112
|
+
actionId: "euler-v2.fetch-lend-vaults",
|
|
3113
|
+
protocolId: "euler-v2",
|
|
3114
|
+
chainCategory: "evm",
|
|
3115
|
+
description: "Euler v2 isolated lend vaults for an underlying asset. Returns evaultAddress for build_isolated_lend_multisign.",
|
|
3116
|
+
prerequisites: ["chainId", "underlyingAddress from get_defi_protocol_supported_tokens"],
|
|
3117
|
+
followUp: ["ctm_euler_v2_build_isolated_lend_multisign"],
|
|
3118
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "eulerV2FetchLendVaultsSummary" },
|
|
3119
|
+
inputZod: mcpEulerV2FetchLendVaultsInputSchema,
|
|
3120
|
+
outputZod: mcpEulerV2FetchLendVaultsOutputSchema
|
|
3121
|
+
}),
|
|
2545
3122
|
defineMcpTool({
|
|
2546
3123
|
name: "ctm_morpho_fetch_earn_vaults",
|
|
2547
3124
|
actionId: "morpho.fetch-earn-vaults",
|
|
@@ -3876,6 +4453,6 @@ function getAgentCatalog() {
|
|
|
3876
4453
|
};
|
|
3877
4454
|
}
|
|
3878
4455
|
|
|
3879
|
-
export { EVM_COMMON_PARAM_DOCS, MANAGEMENT_SIG_DOC, MCP_NON_SUBMIT_TOOL_NAMES, MCP_TOOL_DEFINITIONS, MCP_TOOL_INPUT_SCHEMAS, MCP_TOOL_OUTPUT_SCHEMAS, MULTISIGN_OUTPUT_DOC, MULTISIGN_SUBMIT_OUTPUT_DOC, PROTOCOL_SUPPORT_ADVISORS, chainDetailSchema, evmAddressSchema, evmMultisignCommonInputSchema, getActionsByChainCategory, getAgentCatalog, getAgentCatalogForMcp, getMcpToolByName, getMcpToolDefinitions, getMcpToolInputSchema, getMcpToolOutputSchema, getProtocolDiscoverySummary, getProtocolModules, getProtocolSkill, getProtocolSupportAdvisor, getToolsForProtocol, jsonObjectSchema, keyGenSchema, listProtocolSupportAdvisorIds, listProtocolsWithSkills, mcpAaveV4BorrowInputSchema, mcpAaveV4DepositInputSchema, mcpAaveV4RepayInputSchema, mcpAaveV4WithdrawInputSchema, mcpCurveDaoBuildSwapMultisignInputSchema, mcpCurveDaoQuoteInputSchema, mcpCurveDaoQuoteOutputSchema, mcpEthenaClaimInputSchema, mcpEthenaCooldownInputSchema, mcpEthenaRedeemInputSchema, mcpEthenaStakeInputSchema, mcpEulerV2BorrowRepayInputSchema, mcpEulerV2CollateralDepositInputSchema, mcpEulerV2CollateralWithdrawInputSchema, mcpEulerV2IsolatedBorrowInputSchema, mcpEulerV2IsolatedLendInputSchema, mcpEulerV2VaultWithdrawInputSchema, mcpGmxCancelInputSchema, mcpGmxDecreaseInputSchema, mcpGmxFetchGmApyInputSchema, mcpGmxFetchGmApyOutputSchema, mcpGmxFetchGmMarketsInputSchema, mcpGmxFetchGmMarketsOutputSchema, mcpGmxFetchMarketPricesInputSchema, mcpGmxFetchMarketPricesOutputSchema, mcpGmxFetchMarketsInputSchema, mcpGmxFetchMarketsOutputSchema, mcpGmxFetchOhlcvInputSchema, mcpGmxFetchOhlcvOutputSchema, mcpGmxFetchPositionsInputSchema, mcpGmxFetchPositionsOutputSchema, mcpGmxFetchStakingPowerInputSchema, mcpGmxFetchStakingPowerOutputSchema, mcpGmxGmDepositInputSchema, mcpGmxGmWithdrawInputSchema, mcpGmxIncreaseInputSchema, mcpServerSubmitOutputSchema as mcpGmxMultisignOutputSchema, mcpGmxStakeGmxInputSchema, mcpGmxUnstakeGmxInputSchema, mcpHyperliquidCancelInputSchema, mcpHyperliquidCloseInputSchema, mcpHyperliquidDelegateInputSchema, mcpHyperliquidFetchDelegationsInputSchema, mcpHyperliquidFetchDelegationsOutputSchema, mcpHyperliquidFetchMarketSnapshotInputSchema, mcpHyperliquidFetchMarketSnapshotOutputSchema, mcpHyperliquidFetchMarketsInputSchema, mcpHyperliquidFetchMarketsOutputSchema, mcpHyperliquidFetchOhlcvInputSchema, mcpHyperliquidFetchOhlcvOutputSchema, mcpHyperliquidFetchOpenContextInputSchema, mcpHyperliquidFetchOpenContextOutputSchema, mcpHyperliquidFetchOpenOrdersInputSchema, mcpHyperliquidFetchOpenOrdersOutputSchema, mcpHyperliquidFetchPositionsInputSchema, mcpHyperliquidFetchPositionsOutputSchema, mcpHyperliquidFetchStakingSummaryInputSchema, mcpHyperliquidFetchStakingSummaryOutputSchema, mcpHyperliquidFetchUsdClassBalancesInputSchema, mcpHyperliquidFetchUsdClassBalancesOutputSchema, mcpHyperliquidFetchUserVaultEquitiesInputSchema, mcpHyperliquidFetchUserVaultEquitiesOutputSchema, mcpHyperliquidFetchVaultsInputSchema, mcpHyperliquidFetchVaultsOutputSchema, mcpHyperliquidLimitOrderInputSchema, mcpHyperliquidSearchMarketsInputSchema, mcpHyperliquidSearchMarketsOutputSchema, mcpHyperliquidStakeInputSchema, mcpHyperliquidUndelegateInputSchema, mcpHyperliquidUnstakeInputSchema, mcpHyperliquidUsdTransferInputSchema, mcpHyperliquidVaultDepositInputSchema, mcpHyperliquidVaultWithdrawInputSchema, mcpLidoClaimWithdrawalInputSchema, mcpLidoRequestWithdrawalsInputSchema, mcpLidoSubmitInputSchema, mcpLidoUnwrapWstEthInputSchema, mcpLidoWrapStEthInputSchema, mcpMapleDepositInputSchema, mcpMapleRequestRedeemInputSchema, mcpMorphoBlueBorrowInputSchema, mcpMorphoBlueCollateralDepositInputSchema, mcpMorphoBlueCollateralWithdrawInputSchema, mcpMorphoBlueRepayInputSchema, mcpMorphoFetchEarnVaultsInputSchema, mcpMorphoFetchEarnVaultsOutputSchema, mcpMorphoMerklClaimInputSchema, mcpMorphoVaultDepositInputSchema, mcpMorphoVaultWithdrawInputSchema, mcpMultisignInput, multisignOutputSchema as mcpMultisignOutputSchema, mcpServerSubmitOutputSchema as mcpMultisignSubmitOutputSchema, mcpServerCommonInputSchema, mcpServerMultisignInput, mcpServerSubmitOutputSchema, mcpSkyLockstakeCloseInputSchema, mcpSkyLockstakeDrawInputSchema, mcpSkyLockstakeGetRewardInputSchema, mcpSkyLockstakeStakeInputSchema, mcpSkyLockstakeWipeInputSchema, mcpSkySusdsDepositInputSchema, mcpSkySusdsRedeemInputSchema, mcpUniswapV4BuildCollectFeesMultisignInputSchema, mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema, mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema, mcpUniswapV4BuildMintLiquidityMultisignInputSchema, mcpUniswapV4BuildSwapMultisignInputSchema, mcpUniswapV4CreateSwapInputSchema, mcpUniswapV4CreateSwapOutputSchema, mcpUniswapV4LpClaimInputSchema, mcpUniswapV4LpClaimOutputSchema, mcpUniswapV4LpCreatePositionInputSchema, mcpUniswapV4LpCreatePositionOutputSchema, mcpUniswapV4LpDecreaseInputSchema, mcpUniswapV4LpDecreaseOutputSchema, mcpUniswapV4LpIncreaseInputSchema, mcpUniswapV4LpIncreaseOutputSchema, mcpUniswapV4LpListPoolsInputSchema, mcpUniswapV4LpListPoolsOutputSchema, mcpUniswapV4LpListPositionsInputSchema, mcpUniswapV4LpListPositionsOutputSchema, mcpUniswapV4QuoteInputSchema, mcpUniswapV4QuoteOutputSchema, mcpUniswapV4RegisterPositionFromMintTxInputSchema, mcpUniswapV4RegisterPositionFromMintTxOutputSchema, mcpUniswapV4RegisterPositionNftInputSchema, mcpUniswapV4RegisterPositionNftOutputSchema, multisignOutputSchema, parseMcpToolInput, parseMcpToolOutput, parseMultisignBuilderOutput, uniswapQuoteTradeTypeSchema, zodSchemaToMcpJsonSchema };
|
|
4456
|
+
export { EVM_COMMON_PARAM_DOCS, MANAGEMENT_SIG_DOC, MCP_NON_SUBMIT_TOOL_NAMES, MCP_TOOL_DEFINITIONS, MCP_TOOL_INPUT_SCHEMAS, MCP_TOOL_OUTPUT_SCHEMAS, MULTISIGN_OUTPUT_DOC, MULTISIGN_SUBMIT_OUTPUT_DOC, PROTOCOL_SUPPORT_ADVISORS, chainDetailSchema, evmAddressSchema, evmMultisignCommonInputSchema, getActionsByChainCategory, getAgentCatalog, getAgentCatalogForMcp, getMcpToolByName, getMcpToolDefinitions, getMcpToolInputSchema, getMcpToolOutputSchema, getProtocolDiscoverySummary, getProtocolModules, getProtocolSkill, getProtocolSupportAdvisor, getToolsForProtocol, jsonObjectSchema, keyGenSchema, listProtocolSupportAdvisorIds, listProtocolsWithSkills, mcpAaveV4BorrowInputSchema, mcpAaveV4DepositInputSchema, mcpAaveV4RepayInputSchema, mcpAaveV4WithdrawInputSchema, mcpCurveDaoBuildSwapMultisignInputSchema, mcpCurveDaoQuoteInputSchema, mcpCurveDaoQuoteOutputSchema, mcpEthenaClaimInputSchema, mcpEthenaCooldownInputSchema, mcpEthenaRedeemInputSchema, mcpEthenaStakeInputSchema, mcpEulerV2BorrowRepayInputSchema, mcpEulerV2CollateralDepositInputSchema, mcpEulerV2CollateralWithdrawInputSchema, mcpEulerV2FetchLendVaultsInputSchema, mcpEulerV2FetchLendVaultsOutputSchema, mcpEulerV2IsolatedBorrowInputSchema, mcpEulerV2IsolatedLendInputSchema, mcpEulerV2VaultWithdrawInputSchema, mcpGmxCancelInputSchema, mcpGmxDecreaseInputSchema, mcpGmxFetchGmApyInputSchema, mcpGmxFetchGmApyOutputSchema, mcpGmxFetchGmMarketsInputSchema, mcpGmxFetchGmMarketsOutputSchema, mcpGmxFetchMarketPricesInputSchema, mcpGmxFetchMarketPricesOutputSchema, mcpGmxFetchMarketsInputSchema, mcpGmxFetchMarketsOutputSchema, mcpGmxFetchOhlcvInputSchema, mcpGmxFetchOhlcvOutputSchema, mcpGmxFetchOrdersInputSchema, mcpGmxFetchOrdersOutputSchema, mcpGmxFetchPositionsInputSchema, mcpGmxFetchPositionsOutputSchema, mcpGmxFetchStakingPowerInputSchema, mcpGmxFetchStakingPowerOutputSchema, mcpGmxGmDepositInputSchema, mcpGmxGmWithdrawInputSchema, mcpGmxIncreaseInputSchema, mcpServerSubmitOutputSchema as mcpGmxMultisignOutputSchema, mcpGmxStakeGmxInputSchema, mcpGmxUnstakeGmxInputSchema, mcpHyperliquidCancelInputSchema, mcpHyperliquidCloseInputSchema, mcpHyperliquidDelegateInputSchema, mcpHyperliquidFetchDelegationsInputSchema, mcpHyperliquidFetchDelegationsOutputSchema, mcpHyperliquidFetchMarketSnapshotInputSchema, mcpHyperliquidFetchMarketSnapshotOutputSchema, mcpHyperliquidFetchMarketsInputSchema, mcpHyperliquidFetchMarketsOutputSchema, mcpHyperliquidFetchOhlcvInputSchema, mcpHyperliquidFetchOhlcvOutputSchema, mcpHyperliquidFetchOpenContextInputSchema, mcpHyperliquidFetchOpenContextOutputSchema, mcpHyperliquidFetchOpenOrdersInputSchema, mcpHyperliquidFetchOpenOrdersOutputSchema, mcpHyperliquidFetchPositionsInputSchema, mcpHyperliquidFetchPositionsOutputSchema, mcpHyperliquidFetchStakingSummaryInputSchema, mcpHyperliquidFetchStakingSummaryOutputSchema, mcpHyperliquidFetchUsdClassBalancesInputSchema, mcpHyperliquidFetchUsdClassBalancesOutputSchema, mcpHyperliquidFetchUserVaultEquitiesInputSchema, mcpHyperliquidFetchUserVaultEquitiesOutputSchema, mcpHyperliquidFetchVaultsInputSchema, mcpHyperliquidFetchVaultsOutputSchema, mcpHyperliquidLimitOrderInputSchema, mcpHyperliquidSearchMarketsInputSchema, mcpHyperliquidSearchMarketsOutputSchema, mcpHyperliquidStakeInputSchema, mcpHyperliquidUndelegateInputSchema, mcpHyperliquidUnstakeInputSchema, mcpHyperliquidUsdTransferInputSchema, mcpHyperliquidVaultDepositInputSchema, mcpHyperliquidVaultWithdrawInputSchema, mcpLidoClaimWithdrawalInputSchema, mcpLidoRequestWithdrawalsInputSchema, mcpLidoSubmitInputSchema, mcpLidoUnwrapWstEthInputSchema, mcpLidoWrapStEthInputSchema, mcpMapleDepositInputSchema, mcpMapleRequestRedeemInputSchema, mcpMorphoBlueBorrowInputSchema, mcpMorphoBlueCollateralDepositInputSchema, mcpMorphoBlueCollateralWithdrawInputSchema, mcpMorphoBlueRepayInputSchema, mcpMorphoFetchBlueMarketsInputSchema, mcpMorphoFetchBlueMarketsOutputSchema, mcpMorphoFetchEarnVaultsInputSchema, mcpMorphoFetchEarnVaultsOutputSchema, mcpMorphoMerklClaimInputSchema, mcpMorphoVaultDepositInputSchema, mcpMorphoVaultWithdrawInputSchema, mcpMultisignInput, multisignOutputSchema as mcpMultisignOutputSchema, mcpServerSubmitOutputSchema as mcpMultisignSubmitOutputSchema, mcpServerCommonInputSchema, mcpServerMultisignInput, mcpServerSubmitOutputSchema, mcpSkyLockstakeCloseInputSchema, mcpSkyLockstakeDrawInputSchema, mcpSkyLockstakeGetRewardInputSchema, mcpSkyLockstakeStakeInputSchema, mcpSkyLockstakeWipeInputSchema, mcpSkySusdsDepositInputSchema, mcpSkySusdsRedeemInputSchema, mcpUniswapV4BuildCollectFeesMultisignInputSchema, mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema, mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema, mcpUniswapV4BuildMintLiquidityMultisignInputSchema, mcpUniswapV4BuildSwapMultisignInputSchema, mcpUniswapV4CreateSwapInputSchema, mcpUniswapV4CreateSwapOutputSchema, mcpUniswapV4LpClaimInputSchema, mcpUniswapV4LpClaimOutputSchema, mcpUniswapV4LpCreatePositionInputSchema, mcpUniswapV4LpCreatePositionOutputSchema, mcpUniswapV4LpDecreaseInputSchema, mcpUniswapV4LpDecreaseOutputSchema, mcpUniswapV4LpIncreaseInputSchema, mcpUniswapV4LpIncreaseOutputSchema, mcpUniswapV4LpListPoolsInputSchema, mcpUniswapV4LpListPoolsOutputSchema, mcpUniswapV4LpListPositionsInputSchema, mcpUniswapV4LpListPositionsOutputSchema, mcpUniswapV4QuoteInputSchema, mcpUniswapV4QuoteOutputSchema, mcpUniswapV4RegisterPositionFromMintTxInputSchema, mcpUniswapV4RegisterPositionFromMintTxOutputSchema, mcpUniswapV4RegisterPositionNftInputSchema, mcpUniswapV4RegisterPositionNftOutputSchema, multisignOutputSchema, parseAgentBoolean, parseAgentEvmChainId, parseMcpToolInput, parseMcpToolOutput, parseMultisignBuilderOutput, uniswapQuoteTradeTypeSchema, zodSchemaToMcpJsonSchema };
|
|
3880
4457
|
//# sourceMappingURL=catalog.js.map
|
|
3881
4458
|
//# sourceMappingURL=catalog.js.map
|