@continuumdao/ctm-mpc-defi 0.2.30 → 0.2.31
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 +1637 -6
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +3671 -661
- package/dist/agent/catalog.js +1600 -8
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aerodrome/SKILL.md +93 -0
- package/dist/agent/skills/compound-v3/SKILL.md +132 -0
- package/dist/agent/skills/morpho/SKILL.md +16 -8
- package/dist/buildBatch-CngvebiD.d.ts +45 -0
- package/dist/chains/evm/index.d.ts +6 -44
- package/dist/core/index.cjs +2 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +119 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +119 -2
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aerodrome/index.cjs +3922 -0
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -0
- package/dist/protocols/evm/aerodrome/index.d.ts +792 -0
- package/dist/protocols/evm/aerodrome/index.js +3843 -0
- package/dist/protocols/evm/aerodrome/index.js.map +1 -0
- package/dist/protocols/evm/compound-v3/index.cjs +1542 -0
- package/dist/protocols/evm/compound-v3/index.cjs.map +1 -0
- package/dist/protocols/evm/compound-v3/index.d.ts +683 -0
- package/dist/protocols/evm/compound-v3/index.js +1488 -0
- package/dist/protocols/evm/compound-v3/index.js.map +1 -0
- package/dist/protocols/evm/morpho/index.cjs +746 -39
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +161 -14
- package/dist/protocols/evm/morpho/index.js +736 -42
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/package.json +15 -1
package/dist/agent/catalog.cjs
CHANGED
|
@@ -95,17 +95,27 @@ var init_api = __esm({
|
|
|
95
95
|
// src/protocols/evm/morpho/midnightConstants.ts
|
|
96
96
|
var midnightConstants_exports = {};
|
|
97
97
|
__export(midnightConstants_exports, {
|
|
98
|
+
MORPHO_BLUE_CANONICAL: () => MORPHO_BLUE_CANONICAL,
|
|
98
99
|
MORPHO_MIDNIGHT_ADDRESSES: () => MORPHO_MIDNIGHT_ADDRESSES,
|
|
99
100
|
MORPHO_MIDNIGHT_AUTHORIZE_FALLBACK_GAS: () => MORPHO_MIDNIGHT_AUTHORIZE_FALLBACK_GAS,
|
|
100
101
|
MORPHO_MIDNIGHT_BASE_CHAIN_ID: () => MORPHO_MIDNIGHT_BASE_CHAIN_ID,
|
|
102
|
+
MORPHO_MIDNIGHT_BLUE_SUPPLY_FALLBACK_GAS: () => MORPHO_MIDNIGHT_BLUE_SUPPLY_FALLBACK_GAS,
|
|
103
|
+
MORPHO_MIDNIGHT_BLUE_WITHDRAW_FALLBACK_GAS: () => MORPHO_MIDNIGHT_BLUE_WITHDRAW_FALLBACK_GAS,
|
|
101
104
|
MORPHO_MIDNIGHT_BOOKS_MAX_LIMIT: () => MORPHO_MIDNIGHT_BOOKS_MAX_LIMIT,
|
|
102
105
|
MORPHO_MIDNIGHT_BORROW_FALLBACK_GAS: () => MORPHO_MIDNIGHT_BORROW_FALLBACK_GAS,
|
|
106
|
+
MORPHO_MIDNIGHT_CALLBACK_SALT: () => MORPHO_MIDNIGHT_CALLBACK_SALT,
|
|
107
|
+
MORPHO_MIDNIGHT_CREATE_CALLBACK_FALLBACK_GAS: () => MORPHO_MIDNIGHT_CREATE_CALLBACK_FALLBACK_GAS,
|
|
103
108
|
MORPHO_MIDNIGHT_DEFAULT_DEADLINE_SECONDS: () => MORPHO_MIDNIGHT_DEFAULT_DEADLINE_SECONDS,
|
|
109
|
+
MORPHO_MIDNIGHT_DEFAULT_OFFER_TTL_SECONDS: () => MORPHO_MIDNIGHT_DEFAULT_OFFER_TTL_SECONDS,
|
|
104
110
|
MORPHO_MIDNIGHT_DEFAULT_SLIPPAGE_PCT: () => MORPHO_MIDNIGHT_DEFAULT_SLIPPAGE_PCT,
|
|
105
111
|
MORPHO_MIDNIGHT_ERC20_APPROVE_FALLBACK: () => MORPHO_MIDNIGHT_ERC20_APPROVE_FALLBACK,
|
|
112
|
+
MORPHO_MIDNIGHT_ETHEREUM_CHAIN_ID: () => MORPHO_MIDNIGHT_ETHEREUM_CHAIN_ID,
|
|
106
113
|
MORPHO_MIDNIGHT_LEND_FALLBACK_GAS: () => MORPHO_MIDNIGHT_LEND_FALLBACK_GAS,
|
|
114
|
+
MORPHO_MIDNIGHT_MEMPOOL_PUBLISH_FALLBACK_GAS: () => MORPHO_MIDNIGHT_MEMPOOL_PUBLISH_FALLBACK_GAS,
|
|
107
115
|
MORPHO_MIDNIGHT_REPAY_FALLBACK_GAS: () => MORPHO_MIDNIGHT_REPAY_FALLBACK_GAS,
|
|
108
116
|
MORPHO_MIDNIGHT_REST_BASE: () => MORPHO_MIDNIGHT_REST_BASE,
|
|
117
|
+
MORPHO_MIDNIGHT_SET_CONSUMED_FALLBACK_GAS: () => MORPHO_MIDNIGHT_SET_CONSUMED_FALLBACK_GAS,
|
|
118
|
+
MORPHO_MIDNIGHT_SET_ROOT_FALLBACK_GAS: () => MORPHO_MIDNIGHT_SET_ROOT_FALLBACK_GAS,
|
|
109
119
|
MORPHO_MIDNIGHT_WETH_DEPOSIT_FALLBACK: () => MORPHO_MIDNIGHT_WETH_DEPOSIT_FALLBACK,
|
|
110
120
|
TOKEN_PERMIT_NONE: () => TOKEN_PERMIT_NONE,
|
|
111
121
|
morphoMidnightAddressesForChain: () => morphoMidnightAddressesForChain
|
|
@@ -113,18 +123,36 @@ __export(midnightConstants_exports, {
|
|
|
113
123
|
function morphoMidnightAddressesForChain(chainId) {
|
|
114
124
|
return MORPHO_MIDNIGHT_ADDRESSES[chainId] ?? null;
|
|
115
125
|
}
|
|
116
|
-
var MORPHO_MIDNIGHT_REST_BASE, MORPHO_MIDNIGHT_BOOKS_MAX_LIMIT, MORPHO_MIDNIGHT_DEFAULT_SLIPPAGE_PCT, MORPHO_MIDNIGHT_DEFAULT_DEADLINE_SECONDS, MORPHO_MIDNIGHT_BASE_CHAIN_ID, MORPHO_MIDNIGHT_ADDRESSES, TOKEN_PERMIT_NONE, MORPHO_MIDNIGHT_LEND_FALLBACK_GAS, MORPHO_MIDNIGHT_BORROW_FALLBACK_GAS, MORPHO_MIDNIGHT_REPAY_FALLBACK_GAS, MORPHO_MIDNIGHT_AUTHORIZE_FALLBACK_GAS, MORPHO_MIDNIGHT_ERC20_APPROVE_FALLBACK, MORPHO_MIDNIGHT_WETH_DEPOSIT_FALLBACK;
|
|
126
|
+
var MORPHO_MIDNIGHT_REST_BASE, MORPHO_MIDNIGHT_BOOKS_MAX_LIMIT, MORPHO_MIDNIGHT_DEFAULT_SLIPPAGE_PCT, MORPHO_MIDNIGHT_DEFAULT_DEADLINE_SECONDS, MORPHO_MIDNIGHT_DEFAULT_OFFER_TTL_SECONDS, MORPHO_MIDNIGHT_BASE_CHAIN_ID, MORPHO_MIDNIGHT_ETHEREUM_CHAIN_ID, MORPHO_BLUE_CANONICAL, MORPHO_MIDNIGHT_CALLBACK_SALT, MORPHO_MIDNIGHT_ADDRESSES, TOKEN_PERMIT_NONE, MORPHO_MIDNIGHT_LEND_FALLBACK_GAS, MORPHO_MIDNIGHT_BORROW_FALLBACK_GAS, MORPHO_MIDNIGHT_REPAY_FALLBACK_GAS, MORPHO_MIDNIGHT_AUTHORIZE_FALLBACK_GAS, MORPHO_MIDNIGHT_ERC20_APPROVE_FALLBACK, MORPHO_MIDNIGHT_WETH_DEPOSIT_FALLBACK, MORPHO_MIDNIGHT_CREATE_CALLBACK_FALLBACK_GAS, MORPHO_MIDNIGHT_BLUE_SUPPLY_FALLBACK_GAS, MORPHO_MIDNIGHT_BLUE_WITHDRAW_FALLBACK_GAS, MORPHO_MIDNIGHT_SET_ROOT_FALLBACK_GAS, MORPHO_MIDNIGHT_MEMPOOL_PUBLISH_FALLBACK_GAS, MORPHO_MIDNIGHT_SET_CONSUMED_FALLBACK_GAS;
|
|
117
127
|
var init_midnightConstants = __esm({
|
|
118
128
|
"src/protocols/evm/morpho/midnightConstants.ts"() {
|
|
119
129
|
MORPHO_MIDNIGHT_REST_BASE = "https://api.morpho.org/v0/midnight";
|
|
120
130
|
MORPHO_MIDNIGHT_BOOKS_MAX_LIMIT = 20;
|
|
121
131
|
MORPHO_MIDNIGHT_DEFAULT_SLIPPAGE_PCT = "0.5";
|
|
122
132
|
MORPHO_MIDNIGHT_DEFAULT_DEADLINE_SECONDS = 3600;
|
|
133
|
+
MORPHO_MIDNIGHT_DEFAULT_OFFER_TTL_SECONDS = 7 * 24 * 3600;
|
|
123
134
|
MORPHO_MIDNIGHT_BASE_CHAIN_ID = 8453;
|
|
135
|
+
MORPHO_MIDNIGHT_ETHEREUM_CHAIN_ID = 1;
|
|
136
|
+
MORPHO_BLUE_CANONICAL = "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
137
|
+
MORPHO_MIDNIGHT_CALLBACK_SALT = viem.keccak256(viem.toBytes("continuum-midnight-lend-v1"));
|
|
124
138
|
MORPHO_MIDNIGHT_ADDRESSES = {
|
|
139
|
+
[MORPHO_MIDNIGHT_ETHEREUM_CHAIN_ID]: {
|
|
140
|
+
midnight: "0x471686c42792F93528B000beF54bC10E3aa2045f",
|
|
141
|
+
bundles: "0x7c00dBB2b6b6b9B28745332e550dC8782Fcf77EC",
|
|
142
|
+
mempool: "0xde2d62449301a09A51EbF9326EA60d2e8BF4A8F7",
|
|
143
|
+
setterRatifier: "0xb72c416382c8A6399D0765CebfB032F040B00B3c",
|
|
144
|
+
ecrecoverRatifier: "0xAC439c81CAA6ef4C7B7E8F0110F8CE63A4b6D43e",
|
|
145
|
+
blueBuyCallbackFactory: "0x172d1FdC5f79bFe1ED46448f18541E591E5c93a7",
|
|
146
|
+
morphoBlue: MORPHO_BLUE_CANONICAL
|
|
147
|
+
},
|
|
125
148
|
[MORPHO_MIDNIGHT_BASE_CHAIN_ID]: {
|
|
126
|
-
midnight: "
|
|
127
|
-
bundles: "
|
|
149
|
+
midnight: "0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A",
|
|
150
|
+
bundles: "0x091183d729BE9f808c212b475E387A12E67850A7",
|
|
151
|
+
mempool: "0xdD6DCE32e21f7b020898a8258dA37355b4017993",
|
|
152
|
+
setterRatifier: "0x800B5F12A61B8198a5a6EfD794Cac6699B294d63",
|
|
153
|
+
ecrecoverRatifier: "0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E",
|
|
154
|
+
blueBuyCallbackFactory: "0x7337f119Eca028bD39E0e543cEf71631D2333425",
|
|
155
|
+
morphoBlue: MORPHO_BLUE_CANONICAL
|
|
128
156
|
}
|
|
129
157
|
};
|
|
130
158
|
TOKEN_PERMIT_NONE = { kind: 0, data: "0x" };
|
|
@@ -134,6 +162,12 @@ var init_midnightConstants = __esm({
|
|
|
134
162
|
MORPHO_MIDNIGHT_AUTHORIZE_FALLBACK_GAS = 80000n;
|
|
135
163
|
MORPHO_MIDNIGHT_ERC20_APPROVE_FALLBACK = 100000n;
|
|
136
164
|
MORPHO_MIDNIGHT_WETH_DEPOSIT_FALLBACK = 120000n;
|
|
165
|
+
MORPHO_MIDNIGHT_CREATE_CALLBACK_FALLBACK_GAS = 1200000n;
|
|
166
|
+
MORPHO_MIDNIGHT_BLUE_SUPPLY_FALLBACK_GAS = 400000n;
|
|
167
|
+
MORPHO_MIDNIGHT_BLUE_WITHDRAW_FALLBACK_GAS = 350000n;
|
|
168
|
+
MORPHO_MIDNIGHT_SET_ROOT_FALLBACK_GAS = 80000n;
|
|
169
|
+
MORPHO_MIDNIGHT_MEMPOOL_PUBLISH_FALLBACK_GAS = 250000n;
|
|
170
|
+
MORPHO_MIDNIGHT_SET_CONSUMED_FALLBACK_GAS = 80000n;
|
|
137
171
|
}
|
|
138
172
|
});
|
|
139
173
|
|
|
@@ -143,6 +177,7 @@ __export(midnightApi_exports, {
|
|
|
143
177
|
fetchMorphoMidnightBook: () => fetchMorphoMidnightBook,
|
|
144
178
|
fetchMorphoMidnightBookQuote: () => fetchMorphoMidnightBookQuote,
|
|
145
179
|
fetchMorphoMidnightBooks: () => fetchMorphoMidnightBooks,
|
|
180
|
+
fetchMorphoMidnightMakerOffers: () => fetchMorphoMidnightMakerOffers,
|
|
146
181
|
fetchMorphoMidnightMarketById: () => fetchMorphoMidnightMarketById,
|
|
147
182
|
fetchMorphoMidnightUserMarketPosition: () => fetchMorphoMidnightUserMarketPosition,
|
|
148
183
|
fetchMorphoMidnightUserPositions: () => fetchMorphoMidnightUserPositions,
|
|
@@ -284,6 +319,39 @@ async function fetchMorphoMidnightUserPositions(args) {
|
|
|
284
319
|
}
|
|
285
320
|
return rows;
|
|
286
321
|
}
|
|
322
|
+
async function fetchMorphoMidnightMakerOffers(args) {
|
|
323
|
+
const qs = new URLSearchParams();
|
|
324
|
+
qs.set("maker", viem.getAddress(args.maker));
|
|
325
|
+
if (args.chainId != null) qs.set("chain_ids", String(args.chainId));
|
|
326
|
+
const j = await midnightGetJson(`/takeable-offers?${qs}`);
|
|
327
|
+
const out = [];
|
|
328
|
+
for (const row of j.data ?? []) {
|
|
329
|
+
const o = row.offer;
|
|
330
|
+
if (!o?.maker || !viem.isAddress(o.maker) || !o.market?.loan_token || !viem.isAddress(o.market.loan_token)) continue;
|
|
331
|
+
if (!o.market.midnight || !viem.isAddress(o.market.midnight)) continue;
|
|
332
|
+
const group = (o.group ?? "").trim();
|
|
333
|
+
if (!group.startsWith("0x") || group.length !== 66) continue;
|
|
334
|
+
const callback = o.callback && viem.isAddress(o.callback) ? viem.getAddress(o.callback) : "0x0000000000000000000000000000000000000000";
|
|
335
|
+
out.push({
|
|
336
|
+
marketId: String(row.market_id ?? ""),
|
|
337
|
+
chainId: Number(o.market.chain_id ?? args.chainId ?? 0),
|
|
338
|
+
midnight: viem.getAddress(o.market.midnight),
|
|
339
|
+
loanToken: viem.getAddress(o.market.loan_token),
|
|
340
|
+
maker: viem.getAddress(o.maker),
|
|
341
|
+
buy: o.buy === true,
|
|
342
|
+
tick: String(o.tick ?? "0"),
|
|
343
|
+
maxAssets: String(o.max_assets ?? "0"),
|
|
344
|
+
maxUnits: String(o.max_units ?? "0"),
|
|
345
|
+
expiry: Number(o.expiry ?? 0),
|
|
346
|
+
group,
|
|
347
|
+
callback,
|
|
348
|
+
callbackData: o.callback_data ?? "0x",
|
|
349
|
+
units: String(row.units ?? "0"),
|
|
350
|
+
maturity: o.market.maturity != null ? Number(o.market.maturity) : null
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
return out;
|
|
354
|
+
}
|
|
287
355
|
async function fetchMorphoMidnightUserMarketPosition(args) {
|
|
288
356
|
const marketId = args.marketId.trim();
|
|
289
357
|
const user = args.user.trim();
|
|
@@ -921,7 +989,7 @@ var evmMultisignCommonInputSchema = zod.z.object({
|
|
|
921
989
|
chainDetail: chainDetailSchema.optional().describe("Server-filled gas row from chain registry when keyGenId is set."),
|
|
922
990
|
customGasChainDetails: zod.z.record(zod.z.unknown()).optional().describe("Snapshot written to extraJSON.customGasChainDetails when useCustomGas is true."),
|
|
923
991
|
expiryDate: zod.z.number().int().positive().optional().describe(
|
|
924
|
-
"Optional Unix seconds (UTC) when the MPC sign request expires. Uniswap V4, GMX, Hyperliquid,
|
|
992
|
+
"Optional Unix seconds (UTC) when the MPC sign request expires. Uniswap V4, GMX, Hyperliquid, Curve DAO, and Aerodrome default to 30 minutes when omitted; other protocols use the node default (7 days)."
|
|
925
993
|
)
|
|
926
994
|
});
|
|
927
995
|
function withMultisignKeySourceRefine(schema) {
|
|
@@ -1657,6 +1725,182 @@ var mcpCurveDaoBuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
|
1657
1725
|
})
|
|
1658
1726
|
)
|
|
1659
1727
|
);
|
|
1728
|
+
var chain8453 = agentEvmChainIdSchema.describe("Must be 8453 (Base). Aerodrome is Base-only.");
|
|
1729
|
+
var rpcUrlOptional = zod.z.string().min(1).optional().describe("JSON-RPC URL; continuum-mcp-server injects from chain registry \u2014 do not pass a public RPC URL");
|
|
1730
|
+
var mcpAerodromeDiscoverPoolsInputSchema = zod.z.object({
|
|
1731
|
+
chainId: chain8453,
|
|
1732
|
+
rpcUrl: rpcUrlOptional,
|
|
1733
|
+
token: zod.z.string().min(1).describe("Ticker or 0x address to find pools for (AAPLc, USDC, ETH, WETH, AERO)."),
|
|
1734
|
+
tokenOut: zod.z.string().min(1).optional().describe("Optional counterpart. Defaults to USDC so B20 stocks resolve. Tickers OK.")
|
|
1735
|
+
});
|
|
1736
|
+
var mcpAerodromeDiscoverPoolsOutputSchema = jsonObjectSchema.describe(
|
|
1737
|
+
"{ token, tokenOut, pools[] (lp, kind, tickSpacing, factory), notes }. Factory getPool only \u2014 not LpSugar. Then call ctm_aerodrome_quote."
|
|
1738
|
+
);
|
|
1739
|
+
var mcpAerodromeFetchPoolsInputSchema = zod.z.object({
|
|
1740
|
+
chainId: chain8453,
|
|
1741
|
+
rpcUrl: rpcUrlOptional,
|
|
1742
|
+
limit: zod.z.number().int().positive().max(200).optional(),
|
|
1743
|
+
offset: zod.z.number().int().min(0).optional()
|
|
1744
|
+
});
|
|
1745
|
+
var mcpAerodromeFetchPoolsOutputSchema = jsonObjectSchema.describe("{ chainId, pools[] }");
|
|
1746
|
+
var mcpAerodromeFetchPositionsInputSchema = zod.z.object({
|
|
1747
|
+
chainId: chain8453,
|
|
1748
|
+
rpcUrl: rpcUrlOptional,
|
|
1749
|
+
account: evmAddressSchema.optional(),
|
|
1750
|
+
executorAddress: evmAddressSchema.optional().describe("Server-filled from keyGenId when omitted")
|
|
1751
|
+
});
|
|
1752
|
+
var mcpAerodromeFetchPositionsOutputSchema = jsonObjectSchema.describe(
|
|
1753
|
+
"{ chainId, account, notes, positions[] } \u2014 each row has label (vAMM-USDC/AERO \xB7 #id), kind, gauge, stakedInGauge, claimFees.pool, claimEmissions (gauge + tokenId/cl for Slipstream, or null if no gauge). Dust v2 rows omitted."
|
|
1754
|
+
);
|
|
1755
|
+
var mcpAerodromeQuoteInputSchema = zod.z.object({
|
|
1756
|
+
chainId: chain8453,
|
|
1757
|
+
rpcUrl: rpcUrlOptional,
|
|
1758
|
+
tokenIn: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x address. Native: 0x0 / eth. B20 stocks need no address lookup."),
|
|
1759
|
+
tokenOut: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x address. Native: 0x0 / eth."),
|
|
1760
|
+
amountHuman: zod.z.string().min(1).describe("Human-readable amount of tokenIn (B20 stocks are 8 decimals)"),
|
|
1761
|
+
tokenInDecimals: zod.z.number().int().min(0).max(18).optional().describe("Optional override. Omit for known tickers \u2014 AAPLc and other B20 stocks always use 8.")
|
|
1762
|
+
});
|
|
1763
|
+
var mcpAerodromeQuoteOutputSchema = jsonObjectSchema.describe(
|
|
1764
|
+
"{ tokenIn, tokenOut, amountInWei, amountOutWei, amountOutHuman, priceImpactPercent (0\u2013100 vs a tiny same-route probe, or null), hops, pathPacked, isNativeIn, isNativeOut, source }"
|
|
1765
|
+
);
|
|
1766
|
+
var mcpAerodromeBuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1767
|
+
evmMultisignCommonInputSchema.extend({
|
|
1768
|
+
tokenIn: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x address / 0x0 native"),
|
|
1769
|
+
tokenOut: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x address / 0x0 native"),
|
|
1770
|
+
amountHuman: zod.z.string().min(1),
|
|
1771
|
+
slippagePercent: zod.z.number().gt(0).lt(100),
|
|
1772
|
+
quoteSnapshot: jsonObjectSchema.optional()
|
|
1773
|
+
})
|
|
1774
|
+
);
|
|
1775
|
+
var mcpAerodromeQuoteAddLiquidityInputSchema = zod.z.object({
|
|
1776
|
+
chainId: chain8453,
|
|
1777
|
+
rpcUrl: rpcUrlOptional,
|
|
1778
|
+
tokenA: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x / 0x0 native"),
|
|
1779
|
+
tokenB: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x / 0x0 native"),
|
|
1780
|
+
stable: agentBooleanSchema(false),
|
|
1781
|
+
amountAHuman: zod.z.string().optional().describe("Human amount of tokenA. Omit to solve from tokenB (one-sided, same as the dialog)."),
|
|
1782
|
+
amountBHuman: zod.z.string().optional().describe("Human amount of tokenB. Omit to solve from tokenA (one-sided, same as the dialog)."),
|
|
1783
|
+
tokenADecimals: zod.z.number().int().min(0).max(18).optional(),
|
|
1784
|
+
tokenBDecimals: zod.z.number().int().min(0).max(18).optional()
|
|
1785
|
+
}).refine((v) => Boolean((v.amountAHuman ?? "").trim() || (v.amountBHuman ?? "").trim()), {
|
|
1786
|
+
message: "Enter amountAHuman or amountBHuman. The other side is filled from the current vAMM, sAMM, or Slipstream pool."
|
|
1787
|
+
});
|
|
1788
|
+
var mcpAerodromeQuoteAddLiquidityOutputSchema = jsonObjectSchema.describe(
|
|
1789
|
+
"{ tokenA, tokenB, amountAHuman, amountBHuman, kind (stable|volatile|cl), tickSpacing?, emptyPool, seedable, hint }. seedable:false = do not first-deposit (ETH/AAPLc has no pool \u2014 pair vs USDC). kind:cl is a Slipstream ratio; basic addLiquidity is v2 only."
|
|
1790
|
+
);
|
|
1791
|
+
var mcpAerodromeQuoteClDepositInputSchema = zod.z.object({
|
|
1792
|
+
chainId: chain8453,
|
|
1793
|
+
rpcUrl: rpcUrlOptional,
|
|
1794
|
+
token0: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native"),
|
|
1795
|
+
token1: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native"),
|
|
1796
|
+
amount0Human: zod.z.string().optional(),
|
|
1797
|
+
amount1Human: zod.z.string().optional(),
|
|
1798
|
+
tickSpacing: zod.z.number().int(),
|
|
1799
|
+
tickLower: zod.z.number().int(),
|
|
1800
|
+
tickUpper: zod.z.number().int(),
|
|
1801
|
+
sqrtPriceX96: zod.z.string().min(1).describe("0 if the CL pool already exists")
|
|
1802
|
+
});
|
|
1803
|
+
var mcpAerodromeQuoteClDepositOutputSchema = jsonObjectSchema;
|
|
1804
|
+
var mcpAerodromeBuildAddLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1805
|
+
evmMultisignCommonInputSchema.extend({
|
|
1806
|
+
tokenA: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native"),
|
|
1807
|
+
tokenB: zod.z.string().min(1).describe("Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native"),
|
|
1808
|
+
stable: agentBooleanSchema(false),
|
|
1809
|
+
amountAHuman: zod.z.string().optional().describe("Omit to solve from amountBHuman (one-sided)."),
|
|
1810
|
+
amountBHuman: zod.z.string().optional().describe("Omit to solve from amountAHuman (one-sided)."),
|
|
1811
|
+
slippagePercent: zod.z.number().gt(0).lt(100)
|
|
1812
|
+
}).refine((v) => Boolean((v.amountAHuman ?? "").trim() || (v.amountBHuman ?? "").trim()), {
|
|
1813
|
+
message: "Enter amountAHuman or amountBHuman."
|
|
1814
|
+
})
|
|
1815
|
+
);
|
|
1816
|
+
var mcpAerodromeBuildRemoveLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1817
|
+
evmMultisignCommonInputSchema.extend({
|
|
1818
|
+
tokenA: zod.z.string().min(1),
|
|
1819
|
+
tokenB: zod.z.string().min(1),
|
|
1820
|
+
stable: agentBooleanSchema(false),
|
|
1821
|
+
lpToken: evmAddressSchema,
|
|
1822
|
+
liquidityHuman: zod.z.string().min(1),
|
|
1823
|
+
lpDecimals: zod.z.number().int().min(0).max(18).optional(),
|
|
1824
|
+
amountAMinHuman: zod.z.string().optional(),
|
|
1825
|
+
amountBMinHuman: zod.z.string().optional()
|
|
1826
|
+
})
|
|
1827
|
+
);
|
|
1828
|
+
var mcpAerodromeBuildClMintMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1829
|
+
evmMultisignCommonInputSchema.extend({
|
|
1830
|
+
token0: zod.z.string().min(1),
|
|
1831
|
+
token1: zod.z.string().min(1),
|
|
1832
|
+
amount0Human: zod.z.string().optional(),
|
|
1833
|
+
amount1Human: zod.z.string().optional(),
|
|
1834
|
+
tickSpacing: zod.z.number().int(),
|
|
1835
|
+
tickLower: zod.z.number().int(),
|
|
1836
|
+
tickUpper: zod.z.number().int(),
|
|
1837
|
+
sqrtPriceX96: zod.z.string().min(1),
|
|
1838
|
+
slippagePercent: zod.z.number().gt(0).lt(100)
|
|
1839
|
+
})
|
|
1840
|
+
);
|
|
1841
|
+
var mcpAerodromeBuildClIncreaseMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1842
|
+
evmMultisignCommonInputSchema.extend({
|
|
1843
|
+
tokenId: zod.z.string().min(1),
|
|
1844
|
+
token0: zod.z.string().min(1),
|
|
1845
|
+
token1: zod.z.string().min(1),
|
|
1846
|
+
amount0Wei: zod.z.string().min(1),
|
|
1847
|
+
amount1Wei: zod.z.string().min(1),
|
|
1848
|
+
slippagePercent: zod.z.number().gt(0).lt(100)
|
|
1849
|
+
})
|
|
1850
|
+
);
|
|
1851
|
+
var mcpAerodromeBuildClDecreaseMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1852
|
+
evmMultisignCommonInputSchema.extend({
|
|
1853
|
+
tokenId: zod.z.string().min(1),
|
|
1854
|
+
liquidity: zod.z.string().min(1),
|
|
1855
|
+
amount0MinWei: zod.z.string().optional(),
|
|
1856
|
+
amount1MinWei: zod.z.string().optional()
|
|
1857
|
+
})
|
|
1858
|
+
);
|
|
1859
|
+
var mcpAerodromeBuildClBurnMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1860
|
+
evmMultisignCommonInputSchema.extend({
|
|
1861
|
+
tokenId: zod.z.string().min(1)
|
|
1862
|
+
})
|
|
1863
|
+
);
|
|
1864
|
+
var mcpAerodromeBuildGaugeStakeMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1865
|
+
evmMultisignCommonInputSchema.extend({
|
|
1866
|
+
gauge: evmAddressSchema,
|
|
1867
|
+
lpToken: evmAddressSchema.optional(),
|
|
1868
|
+
amountHuman: zod.z.string().optional(),
|
|
1869
|
+
lpDecimals: zod.z.number().int().min(0).max(18).optional(),
|
|
1870
|
+
tokenId: zod.z.string().optional(),
|
|
1871
|
+
cl: agentBooleanSchema(false)
|
|
1872
|
+
})
|
|
1873
|
+
);
|
|
1874
|
+
var mcpAerodromeBuildGaugeUnstakeMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1875
|
+
evmMultisignCommonInputSchema.extend({
|
|
1876
|
+
gauge: evmAddressSchema,
|
|
1877
|
+
amountHuman: zod.z.string().optional(),
|
|
1878
|
+
lpDecimals: zod.z.number().int().min(0).max(18).optional(),
|
|
1879
|
+
tokenId: zod.z.string().optional(),
|
|
1880
|
+
cl: agentBooleanSchema(false)
|
|
1881
|
+
})
|
|
1882
|
+
);
|
|
1883
|
+
var mcpAerodromeBuildClaimFeesMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1884
|
+
evmMultisignCommonInputSchema.extend({
|
|
1885
|
+
pool: evmAddressSchema.describe(
|
|
1886
|
+
"Pool (lp) from ctm_aerodrome_fetch_positions claimFees.pool \u2014 not the gauge. Dialog: \u201CFees from the pool\u201D."
|
|
1887
|
+
)
|
|
1888
|
+
})
|
|
1889
|
+
);
|
|
1890
|
+
var mcpAerodromeBuildClCollectFeesMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1891
|
+
evmMultisignCommonInputSchema.extend({
|
|
1892
|
+
tokenId: zod.z.string().min(1)
|
|
1893
|
+
})
|
|
1894
|
+
);
|
|
1895
|
+
var mcpAerodromeBuildClaimEmissionsMultisignInputSchema = withMultisignKeySourceRefine(
|
|
1896
|
+
evmMultisignCommonInputSchema.extend({
|
|
1897
|
+
gauge: evmAddressSchema.describe(
|
|
1898
|
+
"Gauge from fetch_positions claimEmissions.gauge \u2014 not the pool. Dialog: \u201CEmissions from the gauge in AERO\u201D. Skip if claimEmissions is null."
|
|
1899
|
+
),
|
|
1900
|
+
tokenId: zod.z.string().optional().describe("Required for Slipstream staked positions (claimEmissions.tokenId)."),
|
|
1901
|
+
cl: agentBooleanSchema(false).describe("true when claimEmissions.cl (Slipstream NFT getReward).")
|
|
1902
|
+
})
|
|
1903
|
+
);
|
|
1660
1904
|
|
|
1661
1905
|
// src/protocols/evm/morpho/robinhoodEarn.ts
|
|
1662
1906
|
var ROBINHOOD_CHAIN_ID = 4663;
|
|
@@ -1833,6 +2077,23 @@ function preprocessMorphoMidnightBorrowInput(raw) {
|
|
|
1833
2077
|
}
|
|
1834
2078
|
return o;
|
|
1835
2079
|
}
|
|
2080
|
+
function preprocessMorphoMidnightLendOfferInput(raw) {
|
|
2081
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
2082
|
+
const o = { ...raw };
|
|
2083
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
2084
|
+
if (!purposeText) {
|
|
2085
|
+
const amt = String(o.amountHuman ?? "").trim();
|
|
2086
|
+
if (amt) o.purposeText = `Morpho Midnight lend offer ${amt}`;
|
|
2087
|
+
}
|
|
2088
|
+
return o;
|
|
2089
|
+
}
|
|
2090
|
+
function preprocessMorphoMidnightCancelLendOfferInput(raw) {
|
|
2091
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
2092
|
+
const o = { ...raw };
|
|
2093
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
2094
|
+
if (!purposeText) o.purposeText = "Morpho Midnight cancel lend offer";
|
|
2095
|
+
return o;
|
|
2096
|
+
}
|
|
1836
2097
|
function preprocessMorphoMidnightRepayInput(raw) {
|
|
1837
2098
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
1838
2099
|
const o = { ...raw };
|
|
@@ -1914,6 +2175,34 @@ var mcpMorphoFetchMidnightPositionsOutputSchema = zod.z.object({
|
|
|
1914
2175
|
})
|
|
1915
2176
|
)
|
|
1916
2177
|
});
|
|
2178
|
+
var mcpMorphoFetchMidnightOffersInputSchema = zod.z.object({
|
|
2179
|
+
user: zod.z.string().min(1).describe("Maker EVM address"),
|
|
2180
|
+
chainId: agentEvmChainIdSchema.optional()
|
|
2181
|
+
});
|
|
2182
|
+
var mcpMorphoFetchMidnightOffersOutputSchema = zod.z.object({
|
|
2183
|
+
offers: zod.z.array(
|
|
2184
|
+
zod.z.object({
|
|
2185
|
+
marketId: zod.z.string(),
|
|
2186
|
+
chainId: zod.z.number().int(),
|
|
2187
|
+
midnightAddress: zod.z.string(),
|
|
2188
|
+
loanTokenAddress: zod.z.string(),
|
|
2189
|
+
maker: zod.z.string(),
|
|
2190
|
+
group: zod.z.string().describe("Pass to ctm_morpho_build_midnight_cancel_lend_offer_multisign"),
|
|
2191
|
+
callback: zod.z.string(),
|
|
2192
|
+
callbackData: zod.z.string(),
|
|
2193
|
+
tick: zod.z.string(),
|
|
2194
|
+
maxAssets: zod.z.string(),
|
|
2195
|
+
remainingUnits: zod.z.string(),
|
|
2196
|
+
expiry: zod.z.number(),
|
|
2197
|
+
expiryIso: zod.z.string(),
|
|
2198
|
+
maturity: zod.z.number().nullable(),
|
|
2199
|
+
maturityIso: zod.z.string(),
|
|
2200
|
+
lendApr: zod.z.string(),
|
|
2201
|
+
lendAprNumeric: zod.z.number().nullable(),
|
|
2202
|
+
marketLabel: zod.z.string()
|
|
2203
|
+
})
|
|
2204
|
+
)
|
|
2205
|
+
});
|
|
1917
2206
|
var mcpServerCommonInputSchema = zod.z.object({
|
|
1918
2207
|
keyGenId: zod.z.string().min(1).describe("KeyGen id from fetch_key_gen_result / node preferred KeyGen"),
|
|
1919
2208
|
chainId: zod.z.number().int().positive().describe("EVM chain id; RPC and gas config resolved from chain registry"),
|
|
@@ -2293,6 +2582,35 @@ var mcpMorphoMidnightBorrowInputSchema = withMultisignKeySourceRefine(
|
|
|
2293
2582
|
})
|
|
2294
2583
|
)
|
|
2295
2584
|
);
|
|
2585
|
+
var mcpMorphoMidnightLendOfferInputSchema = withMultisignKeySourceRefine(
|
|
2586
|
+
zod.z.preprocess(
|
|
2587
|
+
preprocessMorphoMidnightLendOfferInput,
|
|
2588
|
+
evmMultisignCommonInputSchema.extend({
|
|
2589
|
+
marketId: zod.z.string().min(1).describe("marketId from ctm_morpho_fetch_midnight_books"),
|
|
2590
|
+
amountHuman: zod.z.string().min(1).describe("Loan-token amount to park in Blue and quote on Midnight"),
|
|
2591
|
+
loanToken: evmAddressSchema.optional(),
|
|
2592
|
+
lendAprPct: zod.z.string().optional().describe("Target fixed lend APR percent, e.g. 5.2. Defaults to book best bid."),
|
|
2593
|
+
tick: zod.z.string().optional().describe("Override Midnight tick (takes precedence over lendAprPct)"),
|
|
2594
|
+
blueMarketId: zod.z.string().optional().describe("Morpho Blue market to earn variable yield until the offer fills"),
|
|
2595
|
+
expirySeconds: agentCoercedOptionalIntSchema(zod.z.number().int().min(60)),
|
|
2596
|
+
marketLabel: zod.z.string().optional(),
|
|
2597
|
+
isNativeIn: agentOptionalBooleanSchema()
|
|
2598
|
+
})
|
|
2599
|
+
)
|
|
2600
|
+
);
|
|
2601
|
+
var mcpMorphoMidnightCancelLendOfferInputSchema = withMultisignKeySourceRefine(
|
|
2602
|
+
zod.z.preprocess(
|
|
2603
|
+
preprocessMorphoMidnightCancelLendOfferInput,
|
|
2604
|
+
evmMultisignCommonInputSchema.extend({
|
|
2605
|
+
group: zod.z.string().min(1).describe("Offer group id from ctm_morpho_fetch_midnight_offers"),
|
|
2606
|
+
callback: evmAddressSchema.optional(),
|
|
2607
|
+
callbackData: zod.z.string().optional().describe("Hex Blue MarketParams from the offer row"),
|
|
2608
|
+
midnight: evmAddressSchema.optional(),
|
|
2609
|
+
withdrawRemaining: agentOptionalBooleanSchema(),
|
|
2610
|
+
marketLabel: zod.z.string().optional()
|
|
2611
|
+
})
|
|
2612
|
+
)
|
|
2613
|
+
);
|
|
2296
2614
|
var mcpMorphoMidnightRepayInputSchema = withMultisignKeySourceRefine(
|
|
2297
2615
|
zod.z.preprocess(
|
|
2298
2616
|
preprocessMorphoMidnightRepayInput,
|
|
@@ -2794,6 +3112,96 @@ var mcpEulerV2FetchLendVaultsOutputSchema = zod.z.object({
|
|
|
2794
3112
|
})
|
|
2795
3113
|
)
|
|
2796
3114
|
});
|
|
3115
|
+
var mcpCompoundV3FetchMarketsInputSchema = zod.z.object({
|
|
3116
|
+
chainId: agentEvmChainIdSchema,
|
|
3117
|
+
rpcUrl: zod.z.string().min(1).optional().describe("Server-filled from chain registry. Agents should omit.")
|
|
3118
|
+
});
|
|
3119
|
+
var mcpCompoundV3MarketAssetSchema = zod.z.object({
|
|
3120
|
+
asset: zod.z.string(),
|
|
3121
|
+
symbol: zod.z.string(),
|
|
3122
|
+
decimals: zod.z.number(),
|
|
3123
|
+
borrowCollateralFactorPercent: zod.z.number(),
|
|
3124
|
+
liquidateCollateralFactorPercent: zod.z.number(),
|
|
3125
|
+
priceRaw: zod.z.string(),
|
|
3126
|
+
role: zod.z.enum(["base", "collateral"])
|
|
3127
|
+
});
|
|
3128
|
+
var mcpCompoundV3MarketSummarySchema = zod.z.object({
|
|
3129
|
+
chainId: zod.z.number(),
|
|
3130
|
+
slug: zod.z.string(),
|
|
3131
|
+
symbol: zod.z.string(),
|
|
3132
|
+
comet: zod.z.string().describe("Comet proxy \u2014 copy as comet for write tools"),
|
|
3133
|
+
rewards: zod.z.string(),
|
|
3134
|
+
bulker: zod.z.string().nullable(),
|
|
3135
|
+
baseToken: zod.z.string().nullable(),
|
|
3136
|
+
utilization: zod.z.number().nullable(),
|
|
3137
|
+
supplyAprPercent: zod.z.string().nullable(),
|
|
3138
|
+
borrowAprPercent: zod.z.string().nullable(),
|
|
3139
|
+
assets: zod.z.array(mcpCompoundV3MarketAssetSchema)
|
|
3140
|
+
});
|
|
3141
|
+
var mcpCompoundV3FetchMarketsOutputSchema = zod.z.object({
|
|
3142
|
+
markets: zod.z.array(mcpCompoundV3MarketSummarySchema),
|
|
3143
|
+
notes: zod.z.string()
|
|
3144
|
+
});
|
|
3145
|
+
var mcpCompoundV3FetchMarketInputSchema = zod.z.object({
|
|
3146
|
+
chainId: agentEvmChainIdSchema,
|
|
3147
|
+
comet: evmAddressSchema.describe("Comet proxy from ctm_compound_v3_fetch_markets"),
|
|
3148
|
+
rpcUrl: zod.z.string().min(1).optional().describe("Server-filled from chain registry. Agents should omit.")
|
|
3149
|
+
});
|
|
3150
|
+
var mcpCompoundV3FetchMarketOutputSchema = mcpCompoundV3MarketSummarySchema;
|
|
3151
|
+
var mcpCompoundV3FetchAccountInputSchema = zod.z.object({
|
|
3152
|
+
chainId: agentEvmChainIdSchema,
|
|
3153
|
+
comet: evmAddressSchema.describe("Comet proxy from ctm_compound_v3_fetch_markets"),
|
|
3154
|
+
account: evmAddressSchema.describe("MPC executor / user address"),
|
|
3155
|
+
rpcUrl: zod.z.string().min(1).optional().describe("Server-filled from chain registry. Agents should omit.")
|
|
3156
|
+
});
|
|
3157
|
+
var mcpCompoundV3FetchAccountOutputSchema = zod.z.object({
|
|
3158
|
+
comet: zod.z.string(),
|
|
3159
|
+
symbol: zod.z.string(),
|
|
3160
|
+
baseSupplied: zod.z.string(),
|
|
3161
|
+
baseBorrowed: zod.z.string(),
|
|
3162
|
+
collaterals: zod.z.array(
|
|
3163
|
+
zod.z.object({
|
|
3164
|
+
asset: zod.z.string(),
|
|
3165
|
+
symbol: zod.z.string(),
|
|
3166
|
+
balance: zod.z.string()
|
|
3167
|
+
})
|
|
3168
|
+
),
|
|
3169
|
+
isBorrowCollateralized: zod.z.boolean(),
|
|
3170
|
+
isLiquidatable: zod.z.boolean(),
|
|
3171
|
+
rewardToken: zod.z.string().nullable(),
|
|
3172
|
+
rewardOwed: zod.z.string().nullable()
|
|
3173
|
+
});
|
|
3174
|
+
var compoundV3WriteFields = {
|
|
3175
|
+
comet: evmAddressSchema.describe("Comet proxy from ctm_compound_v3_fetch_markets. Never the implementation."),
|
|
3176
|
+
asset: evmAddressSchema.describe(
|
|
3177
|
+
"Token to supply/withdraw. Native ETH: 0x0000000000000000000000000000000000000000 or set isNative true."
|
|
3178
|
+
),
|
|
3179
|
+
amountHuman: zod.z.string().min(1).describe('Human amount (e.g. "100"). Withdraw base while undercollateralized borrows.'),
|
|
3180
|
+
isNative: agentOptionalBooleanSchema().describe(
|
|
3181
|
+
"Wrap/unwrap native ETH automatically (WETH.deposit/withdraw). Independent of useBulker."
|
|
3182
|
+
),
|
|
3183
|
+
isNativeIn: agentOptionalBooleanSchema().describe("Alias of isNative for supply/repay."),
|
|
3184
|
+
useBulker: agentOptionalBooleanSchema().describe(
|
|
3185
|
+
"If true, prefer ctm_compound_v3_build_bulker_multisign for combined actions. ETH wrap still works when false."
|
|
3186
|
+
)
|
|
3187
|
+
};
|
|
3188
|
+
var mcpCompoundV3SupplyInputSchema = mcpMultisignInput(compoundV3WriteFields);
|
|
3189
|
+
var mcpCompoundV3WithdrawInputSchema = mcpMultisignInput(compoundV3WriteFields);
|
|
3190
|
+
var mcpCompoundV3RepayInputSchema = mcpMultisignInput(compoundV3WriteFields);
|
|
3191
|
+
var mcpCompoundV3ClaimRewardsInputSchema = mcpMultisignInput({
|
|
3192
|
+
comet: evmAddressSchema.describe("Comet proxy from ctm_compound_v3_fetch_markets")
|
|
3193
|
+
});
|
|
3194
|
+
var mcpCompoundV3BulkerInputSchema = mcpMultisignInput({
|
|
3195
|
+
comet: evmAddressSchema.describe("Comet proxy from ctm_compound_v3_fetch_markets"),
|
|
3196
|
+
steps: zod.z.array(
|
|
3197
|
+
zod.z.object({
|
|
3198
|
+
action: zod.z.enum(["supply", "withdraw", "claim"]),
|
|
3199
|
+
asset: evmAddressSchema.optional(),
|
|
3200
|
+
amountHuman: zod.z.string().optional(),
|
|
3201
|
+
isNative: agentOptionalBooleanSchema()
|
|
3202
|
+
})
|
|
3203
|
+
).min(1).describe("Combined Bulker actions. Native supply/withdraw uses Bulker native token actions.")
|
|
3204
|
+
});
|
|
2797
3205
|
function mcpGmxMultisignInput(fields, preprocess) {
|
|
2798
3206
|
const inner = evmMultisignCommonInputSchema.extend(fields);
|
|
2799
3207
|
const shaped = preprocess ? zod.z.preprocess(preprocess, inner) : inner;
|
|
@@ -4078,6 +4486,26 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
4078
4486
|
handler: { importPath: "protocols/evm/morpho", exportName: "buildEvmMultisignBodyMorphoMidnightLendBatch" },
|
|
4079
4487
|
inputZod: mcpMorphoMidnightLendInputSchema
|
|
4080
4488
|
}),
|
|
4489
|
+
defineProtocolMcpTool({
|
|
4490
|
+
name: "ctm_morpho_build_midnight_lend_offer_multisign",
|
|
4491
|
+
actionId: "morpho.midnight-lend-offer",
|
|
4492
|
+
protocolId: "morpho",
|
|
4493
|
+
chainCategory: "evm",
|
|
4494
|
+
description: "Build a Morpho Midnight lend limit offer. Parks the loan token in Morpho Blue (variable yield) until a borrower takes the offer via BlueBuyCallback.",
|
|
4495
|
+
prerequisites: ["keyGenId", "chainId", "marketId from ctm_morpho_fetch_midnight_books", "amountHuman"],
|
|
4496
|
+
handler: { importPath: "protocols/evm/morpho", exportName: "buildEvmMultisignBodyMorphoMidnightLendOfferBatch" },
|
|
4497
|
+
inputZod: mcpMorphoMidnightLendOfferInputSchema
|
|
4498
|
+
}),
|
|
4499
|
+
defineProtocolMcpTool({
|
|
4500
|
+
name: "ctm_morpho_build_midnight_cancel_lend_offer_multisign",
|
|
4501
|
+
actionId: "morpho.midnight-cancel-lend-offer",
|
|
4502
|
+
protocolId: "morpho",
|
|
4503
|
+
chainCategory: "evm",
|
|
4504
|
+
description: "Cancel a Morpho Midnight lend offer (exhaust the offer group) and withdraw unused Blue-parked funds.",
|
|
4505
|
+
prerequisites: ["keyGenId", "chainId", "group from ctm_morpho_fetch_midnight_offers"],
|
|
4506
|
+
handler: { importPath: "protocols/evm/morpho", exportName: "buildEvmMultisignBodyMorphoMidnightCancelLendOfferBatch" },
|
|
4507
|
+
inputZod: mcpMorphoMidnightCancelLendOfferInputSchema
|
|
4508
|
+
}),
|
|
4081
4509
|
defineProtocolMcpTool({
|
|
4082
4510
|
name: "ctm_morpho_build_midnight_borrow_multisign",
|
|
4083
4511
|
actionId: "morpho.midnight-borrow",
|
|
@@ -4650,6 +5078,56 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
4650
5078
|
followUp: [...MCP_MULTISIGN_SUBMIT_FOLLOW_UP, "ctm_continuum_dao_forum_me"],
|
|
4651
5079
|
handler: { importPath: "protocols/evm/continuum-dao", exportName: "buildEvmMultisignBodyContinuumDaoForumSignIn" },
|
|
4652
5080
|
inputZod: mcpContinuumDaoForumSignInInputSchema
|
|
5081
|
+
}),
|
|
5082
|
+
defineProtocolMcpTool({
|
|
5083
|
+
name: "ctm_compound_v3_build_supply_multisign",
|
|
5084
|
+
actionId: "compound-v3.supply",
|
|
5085
|
+
protocolId: "compound-v3",
|
|
5086
|
+
chainCategory: "evm",
|
|
5087
|
+
description: "Supply base (earn or repay) or collateral to a Comet proxy. Native ETH always wraps via WETH.deposit even when useBulker is false.",
|
|
5088
|
+
prerequisites: ["keyGenId", "chainId", "comet from ctm_compound_v3_fetch_markets", "asset", "amountHuman"],
|
|
5089
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "buildEvmMultisignBodyCompoundV3Supply" },
|
|
5090
|
+
inputZod: mcpCompoundV3SupplyInputSchema
|
|
5091
|
+
}),
|
|
5092
|
+
defineProtocolMcpTool({
|
|
5093
|
+
name: "ctm_compound_v3_build_withdraw_multisign",
|
|
5094
|
+
actionId: "compound-v3.withdraw",
|
|
5095
|
+
protocolId: "compound-v3",
|
|
5096
|
+
chainCategory: "evm",
|
|
5097
|
+
description: "Withdraw collateral or base from a Comet. Withdraw of base while undercollateralized borrows. Native ETH always unwraps via WETH.withdraw.",
|
|
5098
|
+
prerequisites: ["keyGenId", "chainId", "comet", "asset", "amountHuman", "ctm_compound_v3_fetch_account"],
|
|
5099
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "buildEvmMultisignBodyCompoundV3Withdraw" },
|
|
5100
|
+
inputZod: mcpCompoundV3WithdrawInputSchema
|
|
5101
|
+
}),
|
|
5102
|
+
defineProtocolMcpTool({
|
|
5103
|
+
name: "ctm_compound_v3_build_repay_multisign",
|
|
5104
|
+
actionId: "compound-v3.repay",
|
|
5105
|
+
protocolId: "compound-v3",
|
|
5106
|
+
chainCategory: "evm",
|
|
5107
|
+
description: "Repay Comet base debt by supplying the base asset (same as supply of base while borrowed).",
|
|
5108
|
+
prerequisites: ["keyGenId", "chainId", "comet", "asset (base token)", "amountHuman"],
|
|
5109
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "buildEvmMultisignBodyCompoundV3Repay" },
|
|
5110
|
+
inputZod: mcpCompoundV3RepayInputSchema
|
|
5111
|
+
}),
|
|
5112
|
+
defineProtocolMcpTool({
|
|
5113
|
+
name: "ctm_compound_v3_build_claim_rewards_multisign",
|
|
5114
|
+
actionId: "compound-v3.claim-rewards",
|
|
5115
|
+
protocolId: "compound-v3",
|
|
5116
|
+
chainCategory: "evm",
|
|
5117
|
+
description: "Claim COMP / reward token from the market Rewards contract.",
|
|
5118
|
+
prerequisites: ["keyGenId", "chainId", "comet", "ctm_compound_v3_fetch_account for claimable"],
|
|
5119
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "buildEvmMultisignBodyCompoundV3ClaimRewards" },
|
|
5120
|
+
inputZod: mcpCompoundV3ClaimRewardsInputSchema
|
|
5121
|
+
}),
|
|
5122
|
+
defineProtocolMcpTool({
|
|
5123
|
+
name: "ctm_compound_v3_build_bulker_multisign",
|
|
5124
|
+
actionId: "compound-v3.bulker",
|
|
5125
|
+
protocolId: "compound-v3",
|
|
5126
|
+
chainCategory: "evm",
|
|
5127
|
+
description: "Optional combined Bulker.invoke (supply + borrow, claim + withdraw, native via Bulker). ETH wrap still works without this tool.",
|
|
5128
|
+
prerequisites: ["keyGenId", "chainId", "comet", "steps"],
|
|
5129
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "buildEvmMultisignBodyCompoundV3Bulker" },
|
|
5130
|
+
inputZod: mcpCompoundV3BulkerInputSchema
|
|
4653
5131
|
})
|
|
4654
5132
|
];
|
|
4655
5133
|
|
|
@@ -5027,6 +5505,210 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
5027
5505
|
handler: { importPath: "protocols/evm/curve-dao", exportName: "buildEvmMultisignBodyCurveDaoBatch" },
|
|
5028
5506
|
inputZod: mcpCurveDaoBuildSwapMultisignInputSchema
|
|
5029
5507
|
}),
|
|
5508
|
+
defineMcpTool({
|
|
5509
|
+
name: "ctm_aerodrome_discover_pools",
|
|
5510
|
+
actionId: "aerodrome.discover-pools",
|
|
5511
|
+
protocolId: "aerodrome",
|
|
5512
|
+
chainCategory: "evm",
|
|
5513
|
+
description: "Find Aerodrome v2 + Slipstream pools for one token (optional tokenOut, default USDC) via factory getPool. Tickers OK (AAPLc, USDC, ETH). Use this instead of dumping listed tokens or LpSugar.all. For a price, skip this and call ctm_aerodrome_quote. rpcUrl is injected.",
|
|
5514
|
+
prerequisites: ["chainId 8453", "token (ticker or 0x)"],
|
|
5515
|
+
followUp: ["ctm_aerodrome_quote", "ctm_aerodrome_quote_add_liquidity"],
|
|
5516
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "aerodromeDiscoverPoolsSummary" },
|
|
5517
|
+
inputZod: mcpAerodromeDiscoverPoolsInputSchema,
|
|
5518
|
+
outputZod: mcpAerodromeDiscoverPoolsOutputSchema
|
|
5519
|
+
}),
|
|
5520
|
+
defineMcpTool({
|
|
5521
|
+
name: "ctm_aerodrome_fetch_pools",
|
|
5522
|
+
actionId: "aerodrome.fetch-pools",
|
|
5523
|
+
protocolId: "aerodrome",
|
|
5524
|
+
chainCategory: "evm",
|
|
5525
|
+
description: "Paginated LpSugar.all pool dump on Base. Heavy \u2014 can time out. Not required for swaps: ctm_aerodrome_quote discovers Slipstream 3 / v2 routes itself (including AAPLc/USDC). Use only when browsing LP inventory.",
|
|
5526
|
+
prerequisites: ["chainId 8453"],
|
|
5527
|
+
followUp: ["ctm_aerodrome_quote_add_liquidity", "ctm_aerodrome_fetch_positions"],
|
|
5528
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "aerodromeFetchPoolsSummary" },
|
|
5529
|
+
inputZod: mcpAerodromeFetchPoolsInputSchema,
|
|
5530
|
+
outputZod: mcpAerodromeFetchPoolsOutputSchema
|
|
5531
|
+
}),
|
|
5532
|
+
defineMcpTool({
|
|
5533
|
+
name: "ctm_aerodrome_fetch_positions",
|
|
5534
|
+
actionId: "aerodrome.fetch-positions",
|
|
5535
|
+
protocolId: "aerodrome",
|
|
5536
|
+
chainCategory: "evm",
|
|
5537
|
+
description: "KeyGen Aerodrome positions (same picker as the Multi-Sign Rewards tab). Each row has label, kind (vAMM/sAMM/CL), gauge, stakedInGauge, claimFees.pool, and claimEmissions (gauge + tokenId/cl, or null). Dust v2 rows omitted. Read-only.",
|
|
5538
|
+
prerequisites: ["chainId 8453", "account or keyGenId"],
|
|
5539
|
+
followUp: [
|
|
5540
|
+
"ctm_aerodrome_build_claim_fees_multisign",
|
|
5541
|
+
"ctm_aerodrome_build_claim_emissions_multisign",
|
|
5542
|
+
"ctm_aerodrome_build_cl_collect_fees_multisign"
|
|
5543
|
+
],
|
|
5544
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "aerodromeFetchPositionsSummary" },
|
|
5545
|
+
inputZod: mcpAerodromeFetchPositionsInputSchema,
|
|
5546
|
+
outputZod: mcpAerodromeFetchPositionsOutputSchema
|
|
5547
|
+
}),
|
|
5548
|
+
defineMcpTool({
|
|
5549
|
+
name: "ctm_aerodrome_quote",
|
|
5550
|
+
actionId: "aerodrome.quote",
|
|
5551
|
+
protocolId: "aerodrome",
|
|
5552
|
+
chainCategory: "evm",
|
|
5553
|
+
description: "Quote an Aerodrome swap on Base. tokenIn/tokenOut accept tickers (AAPLc, USDC, ETH, WETH, AERO) or 0x addresses. Coinbase B20 stocks are 8 decimals and route via Slipstream 3 (usually a USDC hop). Returns amountOutHuman and priceImpactPercent (0\u2013100 vs a tiny same-route probe). Call this directly \u2014 do not fetch_pools or ask the user for a stock address. Does NOT create a sign request.",
|
|
5554
|
+
prerequisites: ["chainId 8453", "tokenIn + tokenOut + amountHuman (tickers OK)"],
|
|
5555
|
+
followUp: ["ctm_aerodrome_build_swap_multisign"],
|
|
5556
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "aerodromeQuote" },
|
|
5557
|
+
inputZod: mcpAerodromeQuoteInputSchema,
|
|
5558
|
+
outputZod: mcpAerodromeQuoteOutputSchema
|
|
5559
|
+
}),
|
|
5560
|
+
defineMultisignSubmitMcpTool({
|
|
5561
|
+
name: "ctm_aerodrome_build_swap_multisign",
|
|
5562
|
+
actionId: "aerodrome.swap",
|
|
5563
|
+
protocolId: "aerodrome",
|
|
5564
|
+
chainCategory: "evm",
|
|
5565
|
+
description: "Create and submit mpc-auth multiSignRequest for an Aerodrome swap (optional ERC-20 approve + Router / Slipstream SwapRouter). Default deadline 30 minutes \u2014 ask the user to confirm that window and useCustomGas (via get_multi_sign_gas_options) before calling. Activate aerodrome:swap first.",
|
|
5566
|
+
prerequisites: [
|
|
5567
|
+
"ctm_aerodrome_quote",
|
|
5568
|
+
"get_multi_sign_gas_options + user confirms useCustomGas and 30-minute deadline",
|
|
5569
|
+
"keyGenId + chainId 8453 + purposeText + slippagePercent"
|
|
5570
|
+
],
|
|
5571
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeSwapBatch" },
|
|
5572
|
+
inputZod: mcpAerodromeBuildSwapMultisignInputSchema
|
|
5573
|
+
}),
|
|
5574
|
+
defineMcpTool({
|
|
5575
|
+
name: "ctm_aerodrome_quote_add_liquidity",
|
|
5576
|
+
actionId: "aerodrome.quote-add-liquidity",
|
|
5577
|
+
protocolId: "aerodrome",
|
|
5578
|
+
chainCategory: "evm",
|
|
5579
|
+
description: "Quote an Aerodrome deposit on Base (same as the Liquidity tab). One-sided: pass amountAHuman or amountBHuman; the other side comes from the current vAMM/sAMM reserves or Slipstream slot0. Tickers OK (AAPLc, USDC, ETH). B20 stocks are 8 decimals. ETH/stock has no pool \u2014 seedable:false and hint says pair vs USDC. Do not first-deposit an empty vAMM. Read-only.",
|
|
5580
|
+
prerequisites: ["chainId 8453", "tokenA + tokenB + amountAHuman or amountBHuman (tickers OK)"],
|
|
5581
|
+
followUp: ["ctm_aerodrome_build_add_liquidity_multisign"],
|
|
5582
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "aerodromeQuoteAddLiquidity" },
|
|
5583
|
+
inputZod: mcpAerodromeQuoteAddLiquidityInputSchema,
|
|
5584
|
+
outputZod: mcpAerodromeQuoteAddLiquidityOutputSchema
|
|
5585
|
+
}),
|
|
5586
|
+
defineMcpTool({
|
|
5587
|
+
name: "ctm_aerodrome_quote_cl_deposit",
|
|
5588
|
+
actionId: "aerodrome.quote-cl-deposit",
|
|
5589
|
+
protocolId: "aerodrome",
|
|
5590
|
+
chainCategory: "evm",
|
|
5591
|
+
description: "Quote a Slipstream CL deposit (SugarHelper estimate when one side is omitted). token0/token1 accept tickers (AAPLc, USDC, ETH). Use when quote_add_liquidity returns kind:cl. Read-only.",
|
|
5592
|
+
prerequisites: ["chainId 8453", "ticks + sqrtPriceX96"],
|
|
5593
|
+
followUp: ["ctm_aerodrome_build_cl_mint_multisign"],
|
|
5594
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "aerodromeQuoteClDeposit" },
|
|
5595
|
+
inputZod: mcpAerodromeQuoteClDepositInputSchema,
|
|
5596
|
+
outputZod: mcpAerodromeQuoteClDepositOutputSchema
|
|
5597
|
+
}),
|
|
5598
|
+
defineMultisignSubmitMcpTool({
|
|
5599
|
+
name: "ctm_aerodrome_build_add_liquidity_multisign",
|
|
5600
|
+
actionId: "aerodrome.add-liquidity",
|
|
5601
|
+
protocolId: "aerodrome",
|
|
5602
|
+
chainCategory: "evm",
|
|
5603
|
+
description: "Submit multiSignRequest to add basic vAMM/sAMM liquidity (approve + addLiquidity / addLiquidityETH). One-sided amounts OK. Refuses empty/unseedable pairs (ETH/AAPLc) and Slipstream-only quotes (use CL mint). Activate aerodrome:lp first.",
|
|
5604
|
+
prerequisites: [
|
|
5605
|
+
"ctm_aerodrome_quote_add_liquidity",
|
|
5606
|
+
"get_multi_sign_gas_options + user confirms useCustomGas and 30-minute deadline",
|
|
5607
|
+
"keyGenId + purposeText + slippagePercent"
|
|
5608
|
+
],
|
|
5609
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeAddLiquidityBatch" },
|
|
5610
|
+
inputZod: mcpAerodromeBuildAddLiquidityMultisignInputSchema
|
|
5611
|
+
}),
|
|
5612
|
+
defineMultisignSubmitMcpTool({
|
|
5613
|
+
name: "ctm_aerodrome_build_remove_liquidity_multisign",
|
|
5614
|
+
actionId: "aerodrome.remove-liquidity",
|
|
5615
|
+
protocolId: "aerodrome",
|
|
5616
|
+
chainCategory: "evm",
|
|
5617
|
+
description: "Submit multiSignRequest to remove basic-pool liquidity.",
|
|
5618
|
+
prerequisites: ["keyGenId", "lpToken + liquidityHuman"],
|
|
5619
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeRemoveLiquidityBatch" },
|
|
5620
|
+
inputZod: mcpAerodromeBuildRemoveLiquidityMultisignInputSchema
|
|
5621
|
+
}),
|
|
5622
|
+
defineMultisignSubmitMcpTool({
|
|
5623
|
+
name: "ctm_aerodrome_build_cl_mint_multisign",
|
|
5624
|
+
actionId: "aerodrome.cl-mint",
|
|
5625
|
+
protocolId: "aerodrome",
|
|
5626
|
+
chainCategory: "evm",
|
|
5627
|
+
description: "Submit multiSignRequest to mint a Slipstream concentrated liquidity NFT.",
|
|
5628
|
+
prerequisites: ["ctm_aerodrome_quote_cl_deposit", "keyGenId"],
|
|
5629
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeClMintBatch" },
|
|
5630
|
+
inputZod: mcpAerodromeBuildClMintMultisignInputSchema
|
|
5631
|
+
}),
|
|
5632
|
+
defineMultisignSubmitMcpTool({
|
|
5633
|
+
name: "ctm_aerodrome_build_cl_increase_multisign",
|
|
5634
|
+
actionId: "aerodrome.cl-increase",
|
|
5635
|
+
protocolId: "aerodrome",
|
|
5636
|
+
chainCategory: "evm",
|
|
5637
|
+
description: "Submit multiSignRequest to increase Slipstream liquidity.",
|
|
5638
|
+
prerequisites: ["keyGenId", "tokenId"],
|
|
5639
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeClIncreaseBatch" },
|
|
5640
|
+
inputZod: mcpAerodromeBuildClIncreaseMultisignInputSchema
|
|
5641
|
+
}),
|
|
5642
|
+
defineMultisignSubmitMcpTool({
|
|
5643
|
+
name: "ctm_aerodrome_build_cl_decrease_multisign",
|
|
5644
|
+
actionId: "aerodrome.cl-decrease",
|
|
5645
|
+
protocolId: "aerodrome",
|
|
5646
|
+
chainCategory: "evm",
|
|
5647
|
+
description: "Submit multiSignRequest to decrease Slipstream liquidity.",
|
|
5648
|
+
prerequisites: ["keyGenId", "tokenId + liquidity"],
|
|
5649
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeClDecreaseBatch" },
|
|
5650
|
+
inputZod: mcpAerodromeBuildClDecreaseMultisignInputSchema
|
|
5651
|
+
}),
|
|
5652
|
+
defineMultisignSubmitMcpTool({
|
|
5653
|
+
name: "ctm_aerodrome_build_cl_burn_multisign",
|
|
5654
|
+
actionId: "aerodrome.cl-burn",
|
|
5655
|
+
protocolId: "aerodrome",
|
|
5656
|
+
chainCategory: "evm",
|
|
5657
|
+
description: "Submit multiSignRequest to burn an empty Slipstream position NFT.",
|
|
5658
|
+
prerequisites: ["keyGenId", "tokenId (liquidity withdrawn, fees collected)"],
|
|
5659
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeClBurnBatch" },
|
|
5660
|
+
inputZod: mcpAerodromeBuildClBurnMultisignInputSchema
|
|
5661
|
+
}),
|
|
5662
|
+
defineMultisignSubmitMcpTool({
|
|
5663
|
+
name: "ctm_aerodrome_build_gauge_stake_multisign",
|
|
5664
|
+
actionId: "aerodrome.gauge-stake",
|
|
5665
|
+
protocolId: "aerodrome",
|
|
5666
|
+
chainCategory: "evm",
|
|
5667
|
+
description: "Submit multiSignRequest to stake basic LP tokens or a Slipstream NFT in a gauge.",
|
|
5668
|
+
prerequisites: ["keyGenId", "gauge + lpToken or tokenId"],
|
|
5669
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeGaugeStakeBatch" },
|
|
5670
|
+
inputZod: mcpAerodromeBuildGaugeStakeMultisignInputSchema
|
|
5671
|
+
}),
|
|
5672
|
+
defineMultisignSubmitMcpTool({
|
|
5673
|
+
name: "ctm_aerodrome_build_gauge_unstake_multisign",
|
|
5674
|
+
actionId: "aerodrome.gauge-unstake",
|
|
5675
|
+
protocolId: "aerodrome",
|
|
5676
|
+
chainCategory: "evm",
|
|
5677
|
+
description: "Submit multiSignRequest to unstake from an Aerodrome gauge.",
|
|
5678
|
+
prerequisites: ["keyGenId", "gauge"],
|
|
5679
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeGaugeUnstakeBatch" },
|
|
5680
|
+
inputZod: mcpAerodromeBuildGaugeUnstakeMultisignInputSchema
|
|
5681
|
+
}),
|
|
5682
|
+
defineMultisignSubmitMcpTool({
|
|
5683
|
+
name: "ctm_aerodrome_build_claim_fees_multisign",
|
|
5684
|
+
actionId: "aerodrome.claim-fees",
|
|
5685
|
+
protocolId: "aerodrome",
|
|
5686
|
+
chainCategory: "evm",
|
|
5687
|
+
description: "Claim unstaked fees from the pool (dialog: \u201CFees from the pool\u201D). Pass claimFees.pool from ctm_aerodrome_fetch_positions \u2014 not the gauge. Activate aerodrome:rewards first.",
|
|
5688
|
+
prerequisites: ["ctm_aerodrome_fetch_positions", "keyGenId + purposeText + pool=claimFees.pool"],
|
|
5689
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeClaimFeesBatch" },
|
|
5690
|
+
inputZod: mcpAerodromeBuildClaimFeesMultisignInputSchema
|
|
5691
|
+
}),
|
|
5692
|
+
defineMultisignSubmitMcpTool({
|
|
5693
|
+
name: "ctm_aerodrome_build_cl_collect_fees_multisign",
|
|
5694
|
+
actionId: "aerodrome.cl-collect-fees",
|
|
5695
|
+
protocolId: "aerodrome",
|
|
5696
|
+
chainCategory: "evm",
|
|
5697
|
+
description: "Collect Slipstream NFT fees via NFPM.collect. Pass the position id from fetch_positions (kind:cl). Activate aerodrome:rewards first.",
|
|
5698
|
+
prerequisites: ["ctm_aerodrome_fetch_positions", "keyGenId + tokenId"],
|
|
5699
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeClCollectBatch" },
|
|
5700
|
+
inputZod: mcpAerodromeBuildClCollectFeesMultisignInputSchema
|
|
5701
|
+
}),
|
|
5702
|
+
defineMultisignSubmitMcpTool({
|
|
5703
|
+
name: "ctm_aerodrome_build_claim_emissions_multisign",
|
|
5704
|
+
actionId: "aerodrome.claim-emissions",
|
|
5705
|
+
protocolId: "aerodrome",
|
|
5706
|
+
chainCategory: "evm",
|
|
5707
|
+
description: "Claim gauge emissions in AERO (dialog: \u201CEmissions from the gauge in AERO\u201D). Pass claimEmissions from ctm_aerodrome_fetch_positions (gauge; CL staked also needs tokenId + cl:true). Skip when claimEmissions is null. Activate aerodrome:rewards first.",
|
|
5708
|
+
prerequisites: ["ctm_aerodrome_fetch_positions", "keyGenId + purposeText + gauge=claimEmissions.gauge"],
|
|
5709
|
+
handler: { importPath: "protocols/evm/aerodrome", exportName: "buildEvmMultisignBodyAerodromeClaimEmissionsBatch" },
|
|
5710
|
+
inputZod: mcpAerodromeBuildClaimEmissionsMultisignInputSchema
|
|
5711
|
+
}),
|
|
5030
5712
|
defineMcpTool({
|
|
5031
5713
|
name: "ctm_gmx_fetch_markets",
|
|
5032
5714
|
actionId: "gmx.fetch-markets",
|
|
@@ -5445,6 +6127,7 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
5445
6127
|
followUp: [
|
|
5446
6128
|
"ctm_morpho_fetch_midnight_quote",
|
|
5447
6129
|
"ctm_morpho_build_midnight_lend_multisign",
|
|
6130
|
+
"ctm_morpho_build_midnight_lend_offer_multisign",
|
|
5448
6131
|
"ctm_morpho_build_midnight_borrow_multisign"
|
|
5449
6132
|
],
|
|
5450
6133
|
handler: { importPath: "protocols/evm/morpho", exportName: "morphoFetchMidnightBooksSummary" },
|
|
@@ -5458,7 +6141,11 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
5458
6141
|
chainCategory: "evm",
|
|
5459
6142
|
description: "Quote a Morpho Midnight book fill. side asks = lend, bids = borrow. assets is raw loan-token units.",
|
|
5460
6143
|
prerequisites: ["marketId from ctm_morpho_fetch_midnight_books", "assets raw amount"],
|
|
5461
|
-
followUp: [
|
|
6144
|
+
followUp: [
|
|
6145
|
+
"ctm_morpho_build_midnight_lend_multisign",
|
|
6146
|
+
"ctm_morpho_build_midnight_lend_offer_multisign",
|
|
6147
|
+
"ctm_morpho_build_midnight_borrow_multisign"
|
|
6148
|
+
],
|
|
5462
6149
|
handler: { importPath: "protocols/evm/morpho", exportName: "morphoFetchMidnightQuoteSummary" },
|
|
5463
6150
|
inputZod: mcpMorphoFetchMidnightQuoteInputSchema,
|
|
5464
6151
|
outputZod: mcpMorphoFetchMidnightQuoteOutputSchema
|
|
@@ -5475,6 +6162,18 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
5475
6162
|
inputZod: mcpMorphoFetchMidnightPositionsInputSchema,
|
|
5476
6163
|
outputZod: mcpMorphoFetchMidnightPositionsOutputSchema
|
|
5477
6164
|
}),
|
|
6165
|
+
defineMcpTool({
|
|
6166
|
+
name: "ctm_morpho_fetch_midnight_offers",
|
|
6167
|
+
actionId: "morpho.fetch-midnight-offers",
|
|
6168
|
+
protocolId: "morpho",
|
|
6169
|
+
chainCategory: "evm",
|
|
6170
|
+
description: "Open Morpho Midnight maker lend offers for a user. Use group/callback/callbackData to cancel and withdraw unused Blue park.",
|
|
6171
|
+
prerequisites: ["user address"],
|
|
6172
|
+
followUp: ["ctm_morpho_build_midnight_cancel_lend_offer_multisign"],
|
|
6173
|
+
handler: { importPath: "protocols/evm/morpho", exportName: "morphoFetchMidnightMakerOffersSummary" },
|
|
6174
|
+
inputZod: mcpMorphoFetchMidnightOffersInputSchema,
|
|
6175
|
+
outputZod: mcpMorphoFetchMidnightOffersOutputSchema
|
|
6176
|
+
}),
|
|
5478
6177
|
defineMcpTool({
|
|
5479
6178
|
name: "ctm_euler_v2_fetch_lend_vaults",
|
|
5480
6179
|
actionId: "euler-v2.fetch-lend-vaults",
|
|
@@ -5937,6 +6636,47 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
5937
6636
|
handler: { importPath: "protocols/evm/continuum-dao", exportName: "continuumDaoForumSections" },
|
|
5938
6637
|
inputZod: mcpContinuumDaoForumSectionsInputSchema,
|
|
5939
6638
|
outputZod: mcpContinuumDaoForumSectionsOutputSchema
|
|
6639
|
+
}),
|
|
6640
|
+
defineMcpTool({
|
|
6641
|
+
name: "ctm_compound_v3_fetch_markets",
|
|
6642
|
+
actionId: "compound-v3.fetch-markets",
|
|
6643
|
+
protocolId: "compound-v3",
|
|
6644
|
+
chainCategory: "evm",
|
|
6645
|
+
description: "List Compound III Comet markets on a chain. Each market has one borrowable base and a collateral list \u2014 use this (not web search) to answer what you can borrow against an asset or which collaterals a Comet accepts. Copy comet for fetch_market / fetch_account / build_*_multisign.",
|
|
6646
|
+
prerequisites: ["chainId", "get_defi_protocol_supported_chains"],
|
|
6647
|
+
followUp: ["ctm_compound_v3_fetch_market", "ctm_compound_v3_fetch_account"],
|
|
6648
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "compoundV3FetchMarketsSummary" },
|
|
6649
|
+
inputZod: mcpCompoundV3FetchMarketsInputSchema,
|
|
6650
|
+
outputZod: mcpCompoundV3FetchMarketsOutputSchema
|
|
6651
|
+
}),
|
|
6652
|
+
defineMcpTool({
|
|
6653
|
+
name: "ctm_compound_v3_fetch_market",
|
|
6654
|
+
actionId: "compound-v3.fetch-market",
|
|
6655
|
+
protocolId: "compound-v3",
|
|
6656
|
+
chainCategory: "evm",
|
|
6657
|
+
description: "One Comet: collateral list (what backs a borrow), collateral factors, prices, utilization, supply/borrow APR. Base is the only borrowable asset. Always uses the Comet proxy + CometInterface.",
|
|
6658
|
+
prerequisites: ["comet from ctm_compound_v3_fetch_markets", "rpcUrl from chain registry"],
|
|
6659
|
+
followUp: ["ctm_compound_v3_fetch_account", "ctm_compound_v3_build_supply_multisign"],
|
|
6660
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "compoundV3FetchMarketSummary" },
|
|
6661
|
+
inputZod: mcpCompoundV3FetchMarketInputSchema,
|
|
6662
|
+
outputZod: mcpCompoundV3FetchMarketOutputSchema
|
|
6663
|
+
}),
|
|
6664
|
+
defineMcpTool({
|
|
6665
|
+
name: "ctm_compound_v3_fetch_account",
|
|
6666
|
+
actionId: "compound-v3.fetch-account",
|
|
6667
|
+
protocolId: "compound-v3",
|
|
6668
|
+
chainCategory: "evm",
|
|
6669
|
+
description: "User position on a Comet: base supplied, base borrowed, each collateral, isBorrowCollateralized, isLiquidatable, claimable rewards.",
|
|
6670
|
+
prerequisites: ["comet from ctm_compound_v3_fetch_markets", "account", "rpcUrl from chain registry"],
|
|
6671
|
+
followUp: [
|
|
6672
|
+
"ctm_compound_v3_build_supply_multisign",
|
|
6673
|
+
"ctm_compound_v3_build_withdraw_multisign",
|
|
6674
|
+
"ctm_compound_v3_build_repay_multisign",
|
|
6675
|
+
"ctm_compound_v3_build_claim_rewards_multisign"
|
|
6676
|
+
],
|
|
6677
|
+
handler: { importPath: "protocols/evm/compound-v3", exportName: "compoundV3FetchAccountSummary" },
|
|
6678
|
+
inputZod: mcpCompoundV3FetchAccountInputSchema,
|
|
6679
|
+
outputZod: mcpCompoundV3FetchAccountOutputSchema
|
|
5940
6680
|
})
|
|
5941
6681
|
];
|
|
5942
6682
|
var MCP_TOOL_DEFINITIONS = [
|
|
@@ -7085,6 +7825,8 @@ var morphoProtocolModule = {
|
|
|
7085
7825
|
{ id: "morpho.fetch-midnight-quote", protocolId: MORPHO_PROTOCOL_ID, chainCategory: "evm", description: "Quote Morpho Midnight lend/borrow fill", commonParams: [], params: {} },
|
|
7086
7826
|
{ id: "morpho.fetch-midnight-positions", protocolId: MORPHO_PROTOCOL_ID, chainCategory: "evm", description: "List Morpho Midnight user positions", commonParams: [], params: {} },
|
|
7087
7827
|
{ id: "morpho.midnight-lend", protocolId: MORPHO_PROTOCOL_ID, chainCategory: "evm", description: "Morpho Midnight fixed-rate lend (take asks)", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
7828
|
+
{ id: "morpho.midnight-lend-offer", protocolId: MORPHO_PROTOCOL_ID, chainCategory: "evm", description: "Morpho Midnight lend limit offer parked in Blue until filled", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
7829
|
+
{ id: "morpho.midnight-cancel-lend-offer", protocolId: MORPHO_PROTOCOL_ID, chainCategory: "evm", description: "Cancel a Morpho Midnight lend offer and withdraw unused Blue park", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
7088
7830
|
{ id: "morpho.midnight-borrow", protocolId: MORPHO_PROTOCOL_ID, chainCategory: "evm", description: "Morpho Midnight fixed-rate borrow (supply collateral + take bids)", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
7089
7831
|
{ id: "morpho.midnight-repay", protocolId: MORPHO_PROTOCOL_ID, chainCategory: "evm", description: "Morpho Midnight repay debt and withdraw collateral", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
|
|
7090
7832
|
]
|
|
@@ -7360,6 +8102,141 @@ var veniceProtocolModule = {
|
|
|
7360
8102
|
]
|
|
7361
8103
|
};
|
|
7362
8104
|
registerProtocolModule(veniceProtocolModule);
|
|
8105
|
+
var AERODROME_PROTOCOL_ID = "aerodrome";
|
|
8106
|
+
var AERODROME_CHAIN_ID = 8453;
|
|
8107
|
+
var AERODROME_WETH_BASE = "0x4200000000000000000000000000000000000006";
|
|
8108
|
+
var AERODROME_USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
8109
|
+
function isAerodromeChainSupported(chainId) {
|
|
8110
|
+
const n = typeof chainId === "number" ? chainId : Number.parseInt(String(chainId), 10);
|
|
8111
|
+
return n === AERODROME_CHAIN_ID;
|
|
8112
|
+
}
|
|
8113
|
+
var AERODROME_BASE_ADDRESSES_FALLBACK = {
|
|
8114
|
+
aero: "0x940181a94A35A4569E4529A3CDfB74e38FD98631"};
|
|
8115
|
+
var AERODROME_COINBASE_STOCK_TOKENS = [
|
|
8116
|
+
{ symbol: "AAPLc", name: "Apple Inc.", address: "0xb200000000000000000000C2e324d24d7eEcd1fb" },
|
|
8117
|
+
{ symbol: "NVDAc", name: "NVIDIA Corporation", address: "0xb20000000000000000000078ee7ce2fE4908108C" },
|
|
8118
|
+
{ symbol: "METAc", name: "Meta Platforms Inc.", address: "0xb2000000000000000000008bC8786B856E61707C" },
|
|
8119
|
+
{ symbol: "GOOGLc", name: "Alphabet Inc.", address: "0xb2000000000000000000002D0BA3164cc74f58B7" },
|
|
8120
|
+
{ symbol: "AMZNc", name: "Amazon.com Inc.", address: "0xb200000000000000000000d9192b6B456483C2E8" },
|
|
8121
|
+
{ symbol: "TSLAc", name: "Tesla Inc.", address: "0xb2000000000000000000001e800a7f5189430cD0" },
|
|
8122
|
+
{ symbol: "MSFTc", name: "Microsoft Corporation", address: "0xB200000000000000000000Ab99cFa739E253872B" },
|
|
8123
|
+
{ symbol: "COINc", name: "Coinbase Global Inc.", address: "0xb200000000000000000000c85a31389D71F3ecfb" },
|
|
8124
|
+
{ symbol: "MSTRc", name: "Strategy Inc.", address: "0xb2000000000000000000004884b426556b92883d" },
|
|
8125
|
+
{ symbol: "CRCLc", name: "Circle Internet Group Inc.", address: "0xB20000000000000000000019f6E7C675b73C2e4D" },
|
|
8126
|
+
{ symbol: "INTCc", name: "Intel Corporation", address: "0xB2000000000000000000004AFF16039bA04bdFBc" },
|
|
8127
|
+
{ symbol: "SNDKc", name: "Sandisk Corporation", address: "0xb200000000000000000000397293Cb8cda9a10c5" },
|
|
8128
|
+
{ symbol: "SPCXc", name: "Space Exploration Technologies Corp.", address: "0xb2000000000000000000007b9fcbd005511aCBd5" }
|
|
8129
|
+
];
|
|
8130
|
+
var AERODROME_COINBASE_STOCK_DECIMALS = 8;
|
|
8131
|
+
|
|
8132
|
+
// src/protocols/evm/aerodrome/index.ts
|
|
8133
|
+
var aerodromeProtocolModule = {
|
|
8134
|
+
id: AERODROME_PROTOCOL_ID,
|
|
8135
|
+
chainCategory: "evm",
|
|
8136
|
+
isChainSupported(ctx) {
|
|
8137
|
+
if (ctx.chainCategory !== "evm") return false;
|
|
8138
|
+
return isAerodromeChainSupported(ctx.chainId);
|
|
8139
|
+
},
|
|
8140
|
+
isTokenSupported(token) {
|
|
8141
|
+
if (token.category !== "evm") return false;
|
|
8142
|
+
return token.kind === "native" || token.kind === "erc20";
|
|
8143
|
+
},
|
|
8144
|
+
actions: [
|
|
8145
|
+
{
|
|
8146
|
+
id: "aerodrome.quote",
|
|
8147
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8148
|
+
chainCategory: "evm",
|
|
8149
|
+
description: "Quote an Aerodrome swap on Base via factory discovery + MixedRouteQuoterV3 / Router. Tickers (AAPLc, USDC, ETH) accepted.",
|
|
8150
|
+
commonParams: [],
|
|
8151
|
+
params: {
|
|
8152
|
+
chainId: { type: "number", required: true, description: `Must be ${AERODROME_CHAIN_ID}` },
|
|
8153
|
+
tokenIn: { type: "address", required: true, description: "Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x / 0x0 native" },
|
|
8154
|
+
tokenOut: { type: "address", required: true, description: "Ticker (AAPLc, USDC, ETH, WETH, AERO) or 0x / 0x0 native" },
|
|
8155
|
+
amountHuman: { type: "string", required: true, description: "Human-readable input amount (B20 stocks are 8 decimals)" }
|
|
8156
|
+
}
|
|
8157
|
+
},
|
|
8158
|
+
{
|
|
8159
|
+
id: "aerodrome.swap",
|
|
8160
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8161
|
+
chainCategory: "evm",
|
|
8162
|
+
description: "Swap via Aerodrome Router / Slipstream SwapRouter (optional ERC-20 approve batch)",
|
|
8163
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8164
|
+
params: {
|
|
8165
|
+
tokenIn: { type: "address", required: true, description: "Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native" },
|
|
8166
|
+
tokenOut: { type: "address", required: true, description: "Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native" },
|
|
8167
|
+
amountHuman: { type: "string", required: true, description: "Human-readable input amount" },
|
|
8168
|
+
slippagePercent: { type: "number", required: true, description: "Slippage percent (0\u2013100 exclusive)" }
|
|
8169
|
+
}
|
|
8170
|
+
},
|
|
8171
|
+
{
|
|
8172
|
+
id: "aerodrome.add-liquidity",
|
|
8173
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8174
|
+
chainCategory: "evm",
|
|
8175
|
+
description: "Deposit into a basic vAMM/sAMM pool (one-sided amounts; tickers OK)",
|
|
8176
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8177
|
+
params: {
|
|
8178
|
+
tokenA: { type: "address", required: true, description: "Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native" },
|
|
8179
|
+
tokenB: { type: "address", required: true, description: "Ticker (AAPLc, USDC, ETH) or 0x / 0x0 native" },
|
|
8180
|
+
stable: { type: "boolean", required: true, description: "true = sAMM, false = vAMM" },
|
|
8181
|
+
amountAHuman: { type: "string", required: false, description: "Amount A; omit to solve from B" },
|
|
8182
|
+
amountBHuman: { type: "string", required: false, description: "Amount B; omit to solve from A" },
|
|
8183
|
+
slippagePercent: { type: "number", required: true, description: "Slippage percent" }
|
|
8184
|
+
}
|
|
8185
|
+
},
|
|
8186
|
+
{
|
|
8187
|
+
id: "aerodrome.remove-liquidity",
|
|
8188
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8189
|
+
chainCategory: "evm",
|
|
8190
|
+
description: "Withdraw from a basic vAMM/sAMM pool",
|
|
8191
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8192
|
+
params: {
|
|
8193
|
+
lpToken: { type: "address", required: true, description: "LP token" },
|
|
8194
|
+
liquidityHuman: { type: "string", required: true, description: "LP amount" }
|
|
8195
|
+
}
|
|
8196
|
+
},
|
|
8197
|
+
{
|
|
8198
|
+
id: "aerodrome.cl-mint",
|
|
8199
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8200
|
+
chainCategory: "evm",
|
|
8201
|
+
description: "Mint a Slipstream concentrated liquidity NFT",
|
|
8202
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8203
|
+
params: {
|
|
8204
|
+
token0: { type: "address", required: true, description: "Token0" },
|
|
8205
|
+
token1: { type: "address", required: true, description: "Token1" },
|
|
8206
|
+
tickSpacing: { type: "number", required: true, description: "Pool tick spacing" },
|
|
8207
|
+
tickLower: { type: "number", required: true, description: "Lower tick" },
|
|
8208
|
+
tickUpper: { type: "number", required: true, description: "Upper tick" }
|
|
8209
|
+
}
|
|
8210
|
+
},
|
|
8211
|
+
{
|
|
8212
|
+
id: "aerodrome.gauge-stake",
|
|
8213
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8214
|
+
chainCategory: "evm",
|
|
8215
|
+
description: "Stake basic LP tokens or a Slipstream NFT in a gauge",
|
|
8216
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8217
|
+
params: {
|
|
8218
|
+
gauge: { type: "address", required: true, description: "Gauge address" }
|
|
8219
|
+
}
|
|
8220
|
+
},
|
|
8221
|
+
{
|
|
8222
|
+
id: "aerodrome.claim-fees",
|
|
8223
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8224
|
+
chainCategory: "evm",
|
|
8225
|
+
description: "Claim unstaked fees from the pool (not the gauge)",
|
|
8226
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8227
|
+
params: { pool: { type: "address", required: true, description: "Pool lp from fetch_positions claimFees.pool" } }
|
|
8228
|
+
},
|
|
8229
|
+
{
|
|
8230
|
+
id: "aerodrome.claim-emissions",
|
|
8231
|
+
protocolId: AERODROME_PROTOCOL_ID,
|
|
8232
|
+
chainCategory: "evm",
|
|
8233
|
+
description: "Claim gauge emissions in AERO (not the pool)",
|
|
8234
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8235
|
+
params: { gauge: { type: "address", required: true, description: "Gauge from fetch_positions claimEmissions" } }
|
|
8236
|
+
}
|
|
8237
|
+
]
|
|
8238
|
+
};
|
|
8239
|
+
registerProtocolModule(aerodromeProtocolModule);
|
|
7363
8240
|
var CONTINUUM_DAO_PROTOCOL_ID = "continuum-dao";
|
|
7364
8241
|
var CONTINUUM_DAO_ETHEREUM_CHAIN_ID = 1;
|
|
7365
8242
|
var CONTINUUM_DAO_LINEA_CHAIN_ID = 59144;
|
|
@@ -7492,6 +8369,617 @@ var continuumDaoProtocolModule = {
|
|
|
7492
8369
|
]
|
|
7493
8370
|
};
|
|
7494
8371
|
registerProtocolModule(continuumDaoProtocolModule);
|
|
8372
|
+
var COMPOUND_V3_PROTOCOL_ID = "compound-v3";
|
|
8373
|
+
var COMPOUND_V3_CHAIN_IDS = [1, 8453, 42161, 10, 137, 5e3, 130, 59144];
|
|
8374
|
+
var COMPOUND_V3_WRAPPED_NATIVE = {
|
|
8375
|
+
1: viem.getAddress("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
|
|
8376
|
+
8453: viem.getAddress("0x4200000000000000000000000000000000000006"),
|
|
8377
|
+
42161: viem.getAddress("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
|
|
8378
|
+
10: viem.getAddress("0x4200000000000000000000000000000000000006"),
|
|
8379
|
+
137: viem.getAddress("0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"),
|
|
8380
|
+
5e3: viem.getAddress("0x78c1b0C915c4CD0f08633e2ec3d4961Ab0237669"),
|
|
8381
|
+
130: viem.getAddress("0x4200000000000000000000000000000000000006"),
|
|
8382
|
+
59144: viem.getAddress("0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f")
|
|
8383
|
+
};
|
|
8384
|
+
function isCompoundV3ChainSupported(chainId) {
|
|
8385
|
+
return COMPOUND_V3_CHAIN_IDS.includes(chainId);
|
|
8386
|
+
}
|
|
8387
|
+
function compoundV3WrappedNative(chainId) {
|
|
8388
|
+
return COMPOUND_V3_WRAPPED_NATIVE[chainId] ?? null;
|
|
8389
|
+
}
|
|
8390
|
+
var COMPOUND_V3_MARKETS = [
|
|
8391
|
+
// Ethereum
|
|
8392
|
+
{
|
|
8393
|
+
chainId: 1,
|
|
8394
|
+
slug: "usdc",
|
|
8395
|
+
symbol: "cUSDCv3",
|
|
8396
|
+
comet: viem.getAddress("0xc3d688B66703497DAA19211EEdff47f25384cdc3"),
|
|
8397
|
+
rewards: viem.getAddress("0x1B0e765F6224C21223AeA2af16c1C46E38885a40"),
|
|
8398
|
+
bulker: viem.getAddress("0xa397a8C2086C554B531c02E29f3291c9704B00c7"),
|
|
8399
|
+
baseToken: viem.getAddress("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
|
|
8400
|
+
source: "comet-deployments"
|
|
8401
|
+
},
|
|
8402
|
+
{
|
|
8403
|
+
chainId: 1,
|
|
8404
|
+
slug: "usds",
|
|
8405
|
+
symbol: "cUSDSv3",
|
|
8406
|
+
comet: viem.getAddress("0x5D409e56D886231aDAf00c8775665AD0f9897b56"),
|
|
8407
|
+
rewards: viem.getAddress("0x1B0e765F6224C21223AeA2af16c1C46E38885a40"),
|
|
8408
|
+
bulker: viem.getAddress("0xa397a8C2086C554B531c02E29f3291c9704B00c7"),
|
|
8409
|
+
baseToken: viem.getAddress("0xdC035D45d973E3EC169d2276DDab16f1e407384F"),
|
|
8410
|
+
source: "comet-deployments"
|
|
8411
|
+
},
|
|
8412
|
+
{
|
|
8413
|
+
chainId: 1,
|
|
8414
|
+
slug: "usdt",
|
|
8415
|
+
symbol: "cUSDTv3",
|
|
8416
|
+
comet: viem.getAddress("0x3Afdc9BCA9213A35503b077a6072F3D0d5AB0840"),
|
|
8417
|
+
rewards: viem.getAddress("0x1B0e765F6224C21223AeA2af16c1C46E38885a40"),
|
|
8418
|
+
bulker: viem.getAddress("0xa397a8C2086C554B531c02E29f3291c9704B00c7"),
|
|
8419
|
+
baseToken: viem.getAddress("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
|
|
8420
|
+
source: "comet-deployments"
|
|
8421
|
+
},
|
|
8422
|
+
{
|
|
8423
|
+
chainId: 1,
|
|
8424
|
+
slug: "wbtc",
|
|
8425
|
+
symbol: "cWBTCv3",
|
|
8426
|
+
comet: viem.getAddress("0xe85Dc543813B8c2CFEaAc371517b925a166a9293"),
|
|
8427
|
+
rewards: viem.getAddress("0x1B0e765F6224C21223AeA2af16c1C46E38885a40"),
|
|
8428
|
+
bulker: viem.getAddress("0xa397a8C2086C554B531c02E29f3291c9704B00c7"),
|
|
8429
|
+
baseToken: viem.getAddress("0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"),
|
|
8430
|
+
source: "comet-deployments"
|
|
8431
|
+
},
|
|
8432
|
+
{
|
|
8433
|
+
chainId: 1,
|
|
8434
|
+
slug: "weth",
|
|
8435
|
+
symbol: "cWETHv3",
|
|
8436
|
+
comet: viem.getAddress("0xA17581A9E3356d9A858b789D68B4d866e593aE94"),
|
|
8437
|
+
rewards: viem.getAddress("0x1B0e765F6224C21223AeA2af16c1C46E38885a40"),
|
|
8438
|
+
bulker: viem.getAddress("0xa397a8C2086C554B531c02E29f3291c9704B00c7"),
|
|
8439
|
+
baseToken: viem.getAddress("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
|
|
8440
|
+
source: "comet-deployments"
|
|
8441
|
+
},
|
|
8442
|
+
{
|
|
8443
|
+
chainId: 1,
|
|
8444
|
+
slug: "wsteth",
|
|
8445
|
+
symbol: "cWstETHv3",
|
|
8446
|
+
comet: viem.getAddress("0x3D0bb1ccaB520A66e607822fC55BC921738fAFE3"),
|
|
8447
|
+
rewards: viem.getAddress("0x1B0e765F6224C21223AeA2af16c1C46E38885a40"),
|
|
8448
|
+
bulker: viem.getAddress("0x2c776041CCFe903071AF44aa147368a9c8EEA518"),
|
|
8449
|
+
baseToken: viem.getAddress("0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"),
|
|
8450
|
+
source: "comet-deployments"
|
|
8451
|
+
},
|
|
8452
|
+
// Base
|
|
8453
|
+
{
|
|
8454
|
+
chainId: 8453,
|
|
8455
|
+
slug: "usdc",
|
|
8456
|
+
symbol: "cUSDCv3",
|
|
8457
|
+
comet: viem.getAddress("0xb125E6687d4313864e53df431d5425969c15Eb2F"),
|
|
8458
|
+
rewards: viem.getAddress("0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1"),
|
|
8459
|
+
bulker: viem.getAddress("0x78D0677032A35c63D142a48A2037048871212a8C"),
|
|
8460
|
+
baseToken: viem.getAddress("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
8461
|
+
source: "comet-deployments"
|
|
8462
|
+
},
|
|
8463
|
+
{
|
|
8464
|
+
chainId: 8453,
|
|
8465
|
+
slug: "usdbc",
|
|
8466
|
+
symbol: "cUSDbCv3",
|
|
8467
|
+
comet: viem.getAddress("0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf"),
|
|
8468
|
+
rewards: viem.getAddress("0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1"),
|
|
8469
|
+
bulker: viem.getAddress("0x78D0677032A35c63D142a48A2037048871212a8C"),
|
|
8470
|
+
baseToken: viem.getAddress("0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"),
|
|
8471
|
+
source: "comet-deployments"
|
|
8472
|
+
},
|
|
8473
|
+
{
|
|
8474
|
+
chainId: 8453,
|
|
8475
|
+
slug: "usds",
|
|
8476
|
+
symbol: "cUSDSv3",
|
|
8477
|
+
comet: viem.getAddress("0x2c776041CCFe903071AF44aa147368a9c8EEA518"),
|
|
8478
|
+
rewards: viem.getAddress("0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1"),
|
|
8479
|
+
bulker: viem.getAddress("0x78D0677032A35c63D142a48A2037048871212a8C"),
|
|
8480
|
+
baseToken: viem.getAddress("0x820C137fa70C8691f0e44Dc420a5e53c168921Dc"),
|
|
8481
|
+
source: "comet-deployments"
|
|
8482
|
+
},
|
|
8483
|
+
{
|
|
8484
|
+
chainId: 8453,
|
|
8485
|
+
slug: "weth",
|
|
8486
|
+
symbol: "cWETHv3",
|
|
8487
|
+
comet: viem.getAddress("0x46e6b214b524310239732D51387075E0e70970bf"),
|
|
8488
|
+
rewards: viem.getAddress("0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1"),
|
|
8489
|
+
bulker: viem.getAddress("0x78D0677032A35c63D142a48A2037048871212a8C"),
|
|
8490
|
+
baseToken: viem.getAddress("0x4200000000000000000000000000000000000006"),
|
|
8491
|
+
source: "comet-deployments"
|
|
8492
|
+
},
|
|
8493
|
+
{
|
|
8494
|
+
chainId: 8453,
|
|
8495
|
+
slug: "aero",
|
|
8496
|
+
symbol: "cAEROv3",
|
|
8497
|
+
comet: viem.getAddress("0x784efeB622244d2348d4F2522f8860B96fbEcE89"),
|
|
8498
|
+
rewards: viem.getAddress("0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1"),
|
|
8499
|
+
bulker: viem.getAddress("0x78D0677032A35c63D142a48A2037048871212a8C"),
|
|
8500
|
+
baseToken: viem.getAddress("0x940181a94A35A4569E4529A3CDfB74e38FD98631"),
|
|
8501
|
+
source: "comet-deployments"
|
|
8502
|
+
},
|
|
8503
|
+
// Arbitrum
|
|
8504
|
+
{
|
|
8505
|
+
chainId: 42161,
|
|
8506
|
+
slug: "usdc",
|
|
8507
|
+
symbol: "cUSDCv3",
|
|
8508
|
+
comet: viem.getAddress("0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf"),
|
|
8509
|
+
rewards: viem.getAddress("0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae"),
|
|
8510
|
+
bulker: viem.getAddress("0xbdE8F31D2DdDA895264e27DD990faB3DC87b372d"),
|
|
8511
|
+
baseToken: viem.getAddress("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
8512
|
+
source: "comet-deployments"
|
|
8513
|
+
},
|
|
8514
|
+
{
|
|
8515
|
+
chainId: 42161,
|
|
8516
|
+
slug: "usdc.e",
|
|
8517
|
+
symbol: "cUSDC.ev3",
|
|
8518
|
+
comet: viem.getAddress("0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA"),
|
|
8519
|
+
rewards: viem.getAddress("0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae"),
|
|
8520
|
+
bulker: viem.getAddress("0xbdE8F31D2DdDA895264e27DD990faB3DC87b372d"),
|
|
8521
|
+
baseToken: viem.getAddress("0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8"),
|
|
8522
|
+
source: "comet-deployments"
|
|
8523
|
+
},
|
|
8524
|
+
{
|
|
8525
|
+
chainId: 42161,
|
|
8526
|
+
slug: "usdt",
|
|
8527
|
+
symbol: "cUSDTv3",
|
|
8528
|
+
comet: viem.getAddress("0xd98Be00b5D27fc98112BdE293e487f8D4cA57d07"),
|
|
8529
|
+
rewards: viem.getAddress("0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae"),
|
|
8530
|
+
bulker: viem.getAddress("0xbdE8F31D2DdDA895264e27DD990faB3DC87b372d"),
|
|
8531
|
+
baseToken: viem.getAddress("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
|
|
8532
|
+
source: "comet-deployments"
|
|
8533
|
+
},
|
|
8534
|
+
{
|
|
8535
|
+
chainId: 42161,
|
|
8536
|
+
slug: "weth",
|
|
8537
|
+
symbol: "cWETHv3",
|
|
8538
|
+
comet: viem.getAddress("0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486"),
|
|
8539
|
+
rewards: viem.getAddress("0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae"),
|
|
8540
|
+
bulker: viem.getAddress("0xbdE8F31D2DdDA895264e27DD990faB3DC87b372d"),
|
|
8541
|
+
baseToken: viem.getAddress("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
|
|
8542
|
+
source: "comet-deployments"
|
|
8543
|
+
},
|
|
8544
|
+
// Optimism
|
|
8545
|
+
{
|
|
8546
|
+
chainId: 10,
|
|
8547
|
+
slug: "usdc",
|
|
8548
|
+
symbol: "cUSDCv3",
|
|
8549
|
+
comet: viem.getAddress("0x2e44e174f7D53F0212823acC11C01A11d58c5bCB"),
|
|
8550
|
+
rewards: viem.getAddress("0x443EA0340cb75a160F31A440722dec7b5bc3C2E9"),
|
|
8551
|
+
bulker: viem.getAddress("0xcb3643CC8294B23171272845473dEc49739d4Ba3"),
|
|
8552
|
+
baseToken: viem.getAddress("0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"),
|
|
8553
|
+
source: "comet-deployments"
|
|
8554
|
+
},
|
|
8555
|
+
{
|
|
8556
|
+
chainId: 10,
|
|
8557
|
+
slug: "usdt",
|
|
8558
|
+
symbol: "cUSDTv3",
|
|
8559
|
+
comet: viem.getAddress("0x995E394b8B2437aC8Ce61Ee0bC610D617962B214"),
|
|
8560
|
+
rewards: viem.getAddress("0x443EA0340cb75a160F31A440722dec7b5bc3C2E9"),
|
|
8561
|
+
bulker: viem.getAddress("0xcb3643CC8294B23171272845473dEc49739d4Ba3"),
|
|
8562
|
+
baseToken: viem.getAddress("0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"),
|
|
8563
|
+
source: "comet-deployments"
|
|
8564
|
+
},
|
|
8565
|
+
{
|
|
8566
|
+
chainId: 10,
|
|
8567
|
+
slug: "weth",
|
|
8568
|
+
symbol: "cWETHv3",
|
|
8569
|
+
comet: viem.getAddress("0xE36A30D249f7761327fd973001A32010b521b6Fd"),
|
|
8570
|
+
rewards: viem.getAddress("0x443EA0340cb75a160F31A440722dec7b5bc3C2E9"),
|
|
8571
|
+
bulker: viem.getAddress("0xcb3643CC8294B23171272845473dEc49739d4Ba3"),
|
|
8572
|
+
baseToken: viem.getAddress("0x4200000000000000000000000000000000000006"),
|
|
8573
|
+
source: "comet-deployments"
|
|
8574
|
+
},
|
|
8575
|
+
// Polygon
|
|
8576
|
+
{
|
|
8577
|
+
chainId: 137,
|
|
8578
|
+
slug: "usdc",
|
|
8579
|
+
symbol: "cUSDCv3",
|
|
8580
|
+
comet: viem.getAddress("0xF25212E676D1F7F89Cd72fFEe66158f541246445"),
|
|
8581
|
+
rewards: viem.getAddress("0x45939657d1CA34A8FA39A924B71D28Fe8431e581"),
|
|
8582
|
+
bulker: viem.getAddress("0x59e242D352ae13166B4987aE5c990C232f7f7CD6"),
|
|
8583
|
+
baseToken: viem.getAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"),
|
|
8584
|
+
source: "comet-deployments"
|
|
8585
|
+
},
|
|
8586
|
+
{
|
|
8587
|
+
chainId: 137,
|
|
8588
|
+
slug: "usdt",
|
|
8589
|
+
symbol: "cUSDTv3",
|
|
8590
|
+
comet: viem.getAddress("0xaeB318360f27748Acb200CE616E389A6C9409a07"),
|
|
8591
|
+
rewards: viem.getAddress("0x45939657d1CA34A8FA39A924B71D28Fe8431e581"),
|
|
8592
|
+
bulker: viem.getAddress("0x59e242D352ae13166B4987aE5c990C232f7f7CD6"),
|
|
8593
|
+
baseToken: viem.getAddress("0xc2132D05D31c914a87C6611C10748AEb04B58e8F"),
|
|
8594
|
+
source: "comet-deployments"
|
|
8595
|
+
},
|
|
8596
|
+
// Mantle
|
|
8597
|
+
{
|
|
8598
|
+
chainId: 5e3,
|
|
8599
|
+
slug: "usde",
|
|
8600
|
+
symbol: "cUSDev3",
|
|
8601
|
+
comet: viem.getAddress("0x606174f62cd968d8e684c645080fa694c1D7786E"),
|
|
8602
|
+
rewards: viem.getAddress("0xCd83CbBFCE149d141A5171C3D6a0F0fCCeE225Ab"),
|
|
8603
|
+
bulker: viem.getAddress("0x67DFCa85CcEEFA2C5B1dB4DEe3BEa716A28B9baa"),
|
|
8604
|
+
source: "comet-deployments"
|
|
8605
|
+
},
|
|
8606
|
+
// Unichain
|
|
8607
|
+
{
|
|
8608
|
+
chainId: 130,
|
|
8609
|
+
slug: "usdc",
|
|
8610
|
+
symbol: "cUSDCv3",
|
|
8611
|
+
comet: viem.getAddress("0x2c7118c4C88B9841FCF839074c26Ae8f035f2921"),
|
|
8612
|
+
rewards: viem.getAddress("0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486"),
|
|
8613
|
+
bulker: viem.getAddress("0x58EbB8Db8b4FdF2dCbbB16E04c2F5b952963B514"),
|
|
8614
|
+
baseToken: viem.getAddress("0x078D782b760474a361dDA0AF3839290b0EF57AD6"),
|
|
8615
|
+
source: "comet-deployments"
|
|
8616
|
+
},
|
|
8617
|
+
{
|
|
8618
|
+
chainId: 130,
|
|
8619
|
+
slug: "weth",
|
|
8620
|
+
symbol: "cWETHv3",
|
|
8621
|
+
comet: viem.getAddress("0x6C987dDE50dB1dcDd32Cd4175778C2a291978E2a"),
|
|
8622
|
+
rewards: viem.getAddress("0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486"),
|
|
8623
|
+
bulker: viem.getAddress("0x58EbB8Db8b4FdF2dCbbB16E04c2F5b952963B514"),
|
|
8624
|
+
baseToken: viem.getAddress("0x4200000000000000000000000000000000000006"),
|
|
8625
|
+
source: "comet-deployments"
|
|
8626
|
+
},
|
|
8627
|
+
// Linea
|
|
8628
|
+
{
|
|
8629
|
+
chainId: 59144,
|
|
8630
|
+
slug: "usdc",
|
|
8631
|
+
symbol: "cUSDCv3",
|
|
8632
|
+
comet: viem.getAddress("0x8D38A3d6B3c3B7d96D6536DA7Eef94A9d7dbC991"),
|
|
8633
|
+
rewards: viem.getAddress("0x2c7118c4C88B9841FCF839074c26Ae8f035f2921"),
|
|
8634
|
+
bulker: viem.getAddress("0x023ee795361B28cDbB94e302983578486A0A5f1B"),
|
|
8635
|
+
baseToken: viem.getAddress("0x176211869cA2b568f2A7D4EE941E073a821EE1ff"),
|
|
8636
|
+
source: "comet-deployments"
|
|
8637
|
+
},
|
|
8638
|
+
{
|
|
8639
|
+
chainId: 59144,
|
|
8640
|
+
slug: "weth",
|
|
8641
|
+
symbol: "cWETHv3",
|
|
8642
|
+
comet: viem.getAddress("0x60F2058379716A64a7A5d29219397e79bC552194"),
|
|
8643
|
+
rewards: viem.getAddress("0x2c7118c4C88B9841FCF839074c26Ae8f035f2921"),
|
|
8644
|
+
bulker: viem.getAddress("0x023ee795361B28cDbB94e302983578486A0A5f1B"),
|
|
8645
|
+
baseToken: viem.getAddress("0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f"),
|
|
8646
|
+
source: "comet-deployments"
|
|
8647
|
+
}
|
|
8648
|
+
];
|
|
8649
|
+
function listCompoundV3SupportedChainIds() {
|
|
8650
|
+
return [...COMPOUND_V3_CHAIN_IDS];
|
|
8651
|
+
}
|
|
8652
|
+
function listCompoundV3MarketsForChain(chainId) {
|
|
8653
|
+
if (!isCompoundV3ChainSupported(chainId)) return [];
|
|
8654
|
+
return COMPOUND_V3_MARKETS.filter((m) => m.chainId === chainId);
|
|
8655
|
+
}
|
|
8656
|
+
var cometInterfaceAbi = viem.parseAbi([
|
|
8657
|
+
"function supply(address asset, uint256 amount)",
|
|
8658
|
+
"function supplyTo(address dst, address asset, uint256 amount)",
|
|
8659
|
+
"function withdraw(address asset, uint256 amount)",
|
|
8660
|
+
"function withdrawTo(address to, address asset, uint256 amount)",
|
|
8661
|
+
"function allow(address manager, bool isAllowed)",
|
|
8662
|
+
"function hasPermission(address owner, address manager) view returns (bool)",
|
|
8663
|
+
"function balanceOf(address account) view returns (uint256)",
|
|
8664
|
+
"function borrowBalanceOf(address account) view returns (uint256)",
|
|
8665
|
+
"function collateralBalanceOf(address account, address asset) view returns (uint128)",
|
|
8666
|
+
"function baseToken() view returns (address)",
|
|
8667
|
+
"function baseTokenPriceFeed() view returns (address)",
|
|
8668
|
+
"function decimals() view returns (uint8)",
|
|
8669
|
+
"function numAssets() view returns (uint8)",
|
|
8670
|
+
"function getUtilization() view returns (uint256)",
|
|
8671
|
+
"function getSupplyRate(uint256 utilization) view returns (uint64)",
|
|
8672
|
+
"function getBorrowRate(uint256 utilization) view returns (uint64)",
|
|
8673
|
+
"function getPrice(address priceFeed) view returns (uint256)",
|
|
8674
|
+
"function isBorrowCollateralized(address account) view returns (bool)",
|
|
8675
|
+
"function isLiquidatable(address account) view returns (bool)",
|
|
8676
|
+
"function getAssetInfo(uint8 i) view returns ((uint8 offset, address asset, address priceFeed, uint64 scale, uint64 borrowCollateralFactor, uint64 liquidateCollateralFactor, uint64 liquidationFactor, uint128 supplyCap))",
|
|
8677
|
+
"function getAssetInfoByAddress(address asset) view returns ((uint8 offset, address asset, address priceFeed, uint64 scale, uint64 borrowCollateralFactor, uint64 liquidateCollateralFactor, uint64 liquidationFactor, uint128 supplyCap))"
|
|
8678
|
+
]);
|
|
8679
|
+
viem.parseAbi([
|
|
8680
|
+
"function getRewardOwed(address comet, address account) view returns ((address token, uint256 owed))",
|
|
8681
|
+
"function claim(address comet, address src, bool shouldAccrue)"
|
|
8682
|
+
]);
|
|
8683
|
+
viem.parseAbi([
|
|
8684
|
+
"function invoke(bytes32[] actions, bytes[] data) payable"
|
|
8685
|
+
]);
|
|
8686
|
+
var erc20ReadAbi = viem.parseAbi([
|
|
8687
|
+
"function allowance(address owner, address spender) view returns (uint256)",
|
|
8688
|
+
"function decimals() view returns (uint8)",
|
|
8689
|
+
"function symbol() view returns (string)",
|
|
8690
|
+
"function name() view returns (string)"
|
|
8691
|
+
]);
|
|
8692
|
+
viem.parseAbi(["function approve(address spender, uint256 amount) returns (bool)"]);
|
|
8693
|
+
viem.parseAbi(["function deposit() payable", "function withdraw(uint256 wad)"]);
|
|
8694
|
+
function bulkerActionId(name) {
|
|
8695
|
+
return viem.stringToHex(name, { size: 32 });
|
|
8696
|
+
}
|
|
8697
|
+
bulkerActionId("ACTION_SUPPLY_ASSET");
|
|
8698
|
+
bulkerActionId("ACTION_SUPPLY_NATIVE_TOKEN");
|
|
8699
|
+
bulkerActionId("ACTION_WITHDRAW_ASSET");
|
|
8700
|
+
bulkerActionId("ACTION_WITHDRAW_NATIVE_TOKEN");
|
|
8701
|
+
bulkerActionId("ACTION_CLAIM_REWARD");
|
|
8702
|
+
bulkerActionId("ACTION_TRANSFER_ASSET");
|
|
8703
|
+
|
|
8704
|
+
// src/protocols/evm/compound-v3/apr.ts
|
|
8705
|
+
var COMPOUND_V3_SECONDS_PER_YEAR = 365 * 24 * 60 * 60;
|
|
8706
|
+
function compoundV3RatePerSecondToAprDecimal(ratePerSecond) {
|
|
8707
|
+
if (ratePerSecond <= 0n) return 0;
|
|
8708
|
+
return Number(ratePerSecond) / 1e18 * COMPOUND_V3_SECONDS_PER_YEAR;
|
|
8709
|
+
}
|
|
8710
|
+
function compoundV3AprToPercentLabel(aprDecimal) {
|
|
8711
|
+
if (!Number.isFinite(aprDecimal)) return "\u2014";
|
|
8712
|
+
const pct = aprDecimal * 100;
|
|
8713
|
+
if (Math.abs(pct) < 1e-3) return "0.00%";
|
|
8714
|
+
return `${pct.toFixed(2)}%`;
|
|
8715
|
+
}
|
|
8716
|
+
function compoundV3UtilizationToDecimal(utilization) {
|
|
8717
|
+
if (utilization <= 0n) return 0;
|
|
8718
|
+
return Number(utilization) / 1e18;
|
|
8719
|
+
}
|
|
8720
|
+
function compoundV3FactorToPercent(factor) {
|
|
8721
|
+
return Number(factor) / 1e16;
|
|
8722
|
+
}
|
|
8723
|
+
|
|
8724
|
+
// src/protocols/evm/compound-v3/subgraph.ts
|
|
8725
|
+
var COMPOUND_V3_SUBGRAPH_BY_CHAIN = {
|
|
8726
|
+
1: "5nwMCSHaTqG3Kd2gHznbTXEnZ9QNWsssQfbHhDqQSQFp",
|
|
8727
|
+
137: "AaFtUWKfFdj2x8nnE3RxTSJkHwGHvawH3VWFBykCGzLs",
|
|
8728
|
+
42161: "Ff7ha9ELmpmg81D6nYxy4t8aGP26dPztqD1LDJNPqjLS",
|
|
8729
|
+
8453: "2hcXhs36pTBDVUmk5K2Zkr6N4UYGwaHuco2a6jyTsijo",
|
|
8730
|
+
10: "FhHNkfh5z6Z2WCEBxB6V3s8RPxnJfWZ9zAfM5bVvbvbb"
|
|
8731
|
+
};
|
|
8732
|
+
function compoundV3SubgraphIdForChain(chainId) {
|
|
8733
|
+
return COMPOUND_V3_SUBGRAPH_BY_CHAIN[chainId] ?? null;
|
|
8734
|
+
}
|
|
8735
|
+
async function fetchCompoundV3SubgraphMarkets(args) {
|
|
8736
|
+
const id = compoundV3SubgraphIdForChain(args.chainId);
|
|
8737
|
+
const apiKey = (args.apiKey ?? process.env.THE_GRAPH_API_KEY ?? "").trim();
|
|
8738
|
+
if (!id || !apiKey) return null;
|
|
8739
|
+
const url = `https://gateway.thegraph.com/api/${apiKey}/subgraphs/id/${id}`;
|
|
8740
|
+
try {
|
|
8741
|
+
const res = await fetch(url, {
|
|
8742
|
+
method: "POST",
|
|
8743
|
+
headers: { "content-type": "application/json" },
|
|
8744
|
+
body: JSON.stringify({
|
|
8745
|
+
query: `query CompoundV3Markets { markets(first: 50) { id } }`
|
|
8746
|
+
})
|
|
8747
|
+
});
|
|
8748
|
+
if (!res.ok) return null;
|
|
8749
|
+
const json = await res.json();
|
|
8750
|
+
const markets = json.data?.markets;
|
|
8751
|
+
if (!markets) return null;
|
|
8752
|
+
return markets.map((m) => ({ id: m.id, comet: m.id }));
|
|
8753
|
+
} catch {
|
|
8754
|
+
return null;
|
|
8755
|
+
}
|
|
8756
|
+
}
|
|
8757
|
+
function publicClient(rpcUrl, chainId) {
|
|
8758
|
+
const chain = viem.defineChain({
|
|
8759
|
+
id: chainId,
|
|
8760
|
+
name: "Destination",
|
|
8761
|
+
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
8762
|
+
rpcUrls: { default: { http: [rpcUrl] } }
|
|
8763
|
+
});
|
|
8764
|
+
return viem.createPublicClient({ chain, transport: viem.http(rpcUrl) });
|
|
8765
|
+
}
|
|
8766
|
+
async function readTokenMeta(client, asset) {
|
|
8767
|
+
const [symbol, decimals] = await Promise.all([
|
|
8768
|
+
client.readContract({ address: asset, abi: erc20ReadAbi, functionName: "symbol" }).catch(() => "TOKEN"),
|
|
8769
|
+
client.readContract({ address: asset, abi: erc20ReadAbi, functionName: "decimals" }).catch(() => 18)
|
|
8770
|
+
]);
|
|
8771
|
+
return { symbol: String(symbol), decimals: Number(decimals) };
|
|
8772
|
+
}
|
|
8773
|
+
async function enrichMarketOnChain(client, market) {
|
|
8774
|
+
const comet = market.comet;
|
|
8775
|
+
const [baseToken, utilization, numAssets, decimals] = await Promise.all([
|
|
8776
|
+
client.readContract({ address: comet, abi: cometInterfaceAbi, functionName: "baseToken" }),
|
|
8777
|
+
client.readContract({ address: comet, abi: cometInterfaceAbi, functionName: "getUtilization" }),
|
|
8778
|
+
client.readContract({ address: comet, abi: cometInterfaceAbi, functionName: "numAssets" }),
|
|
8779
|
+
client.readContract({ address: comet, abi: cometInterfaceAbi, functionName: "decimals" })
|
|
8780
|
+
]);
|
|
8781
|
+
const [supplyRate, borrowRate, baseMeta, baseFeed] = await Promise.all([
|
|
8782
|
+
client.readContract({
|
|
8783
|
+
address: comet,
|
|
8784
|
+
abi: cometInterfaceAbi,
|
|
8785
|
+
functionName: "getSupplyRate",
|
|
8786
|
+
args: [utilization]
|
|
8787
|
+
}),
|
|
8788
|
+
client.readContract({
|
|
8789
|
+
address: comet,
|
|
8790
|
+
abi: cometInterfaceAbi,
|
|
8791
|
+
functionName: "getBorrowRate",
|
|
8792
|
+
args: [utilization]
|
|
8793
|
+
}),
|
|
8794
|
+
readTokenMeta(client, viem.getAddress(baseToken)),
|
|
8795
|
+
client.readContract({ address: comet, abi: cometInterfaceAbi, functionName: "baseTokenPriceFeed" })
|
|
8796
|
+
]);
|
|
8797
|
+
const basePrice = await client.readContract({ address: comet, abi: cometInterfaceAbi, functionName: "getPrice", args: [baseFeed] }).catch(() => 0n);
|
|
8798
|
+
const assets = [
|
|
8799
|
+
{
|
|
8800
|
+
asset: viem.getAddress(baseToken),
|
|
8801
|
+
symbol: baseMeta.symbol,
|
|
8802
|
+
decimals: Number(decimals) || baseMeta.decimals,
|
|
8803
|
+
borrowCollateralFactorPercent: 0,
|
|
8804
|
+
liquidateCollateralFactorPercent: 0,
|
|
8805
|
+
priceRaw: basePrice.toString(),
|
|
8806
|
+
role: "base"
|
|
8807
|
+
}
|
|
8808
|
+
];
|
|
8809
|
+
const n = Number(numAssets);
|
|
8810
|
+
for (let i = 0; i < n; i++) {
|
|
8811
|
+
const info = await client.readContract({
|
|
8812
|
+
address: comet,
|
|
8813
|
+
abi: cometInterfaceAbi,
|
|
8814
|
+
functionName: "getAssetInfo",
|
|
8815
|
+
args: [i]
|
|
8816
|
+
});
|
|
8817
|
+
const token = viem.getAddress(info.asset);
|
|
8818
|
+
const meta = await readTokenMeta(client, token);
|
|
8819
|
+
const price = await client.readContract({ address: comet, abi: cometInterfaceAbi, functionName: "getPrice", args: [info.priceFeed] }).catch(() => 0n);
|
|
8820
|
+
assets.push({
|
|
8821
|
+
asset: token,
|
|
8822
|
+
symbol: meta.symbol,
|
|
8823
|
+
decimals: meta.decimals,
|
|
8824
|
+
borrowCollateralFactorPercent: compoundV3FactorToPercent(info.borrowCollateralFactor),
|
|
8825
|
+
liquidateCollateralFactorPercent: compoundV3FactorToPercent(info.liquidateCollateralFactor),
|
|
8826
|
+
priceRaw: price.toString(),
|
|
8827
|
+
role: "collateral"
|
|
8828
|
+
});
|
|
8829
|
+
}
|
|
8830
|
+
return {
|
|
8831
|
+
chainId: market.chainId,
|
|
8832
|
+
slug: market.slug,
|
|
8833
|
+
symbol: market.symbol,
|
|
8834
|
+
comet: market.comet,
|
|
8835
|
+
rewards: market.rewards,
|
|
8836
|
+
bulker: market.bulker,
|
|
8837
|
+
baseToken: viem.getAddress(baseToken),
|
|
8838
|
+
utilization: compoundV3UtilizationToDecimal(utilization),
|
|
8839
|
+
supplyAprPercent: compoundV3AprToPercentLabel(compoundV3RatePerSecondToAprDecimal(supplyRate)),
|
|
8840
|
+
borrowAprPercent: compoundV3AprToPercentLabel(compoundV3RatePerSecondToAprDecimal(borrowRate)),
|
|
8841
|
+
assets
|
|
8842
|
+
};
|
|
8843
|
+
}
|
|
8844
|
+
function registryMarketRow(market) {
|
|
8845
|
+
return {
|
|
8846
|
+
chainId: market.chainId,
|
|
8847
|
+
slug: market.slug,
|
|
8848
|
+
symbol: market.symbol,
|
|
8849
|
+
comet: market.comet,
|
|
8850
|
+
rewards: market.rewards,
|
|
8851
|
+
bulker: market.bulker,
|
|
8852
|
+
baseToken: market.baseToken ?? null,
|
|
8853
|
+
utilization: null,
|
|
8854
|
+
supplyAprPercent: null,
|
|
8855
|
+
borrowAprPercent: null,
|
|
8856
|
+
assets: market.baseToken ? [
|
|
8857
|
+
{
|
|
8858
|
+
asset: market.baseToken,
|
|
8859
|
+
symbol: market.slug.toUpperCase(),
|
|
8860
|
+
decimals: 18,
|
|
8861
|
+
borrowCollateralFactorPercent: 0,
|
|
8862
|
+
liquidateCollateralFactorPercent: 0,
|
|
8863
|
+
priceRaw: "0",
|
|
8864
|
+
role: "base"
|
|
8865
|
+
}
|
|
8866
|
+
] : []
|
|
8867
|
+
};
|
|
8868
|
+
}
|
|
8869
|
+
async function compoundV3FetchMarketsSummary(args) {
|
|
8870
|
+
if (!isCompoundV3ChainSupported(args.chainId)) {
|
|
8871
|
+
return { markets: [], notes: `Compound III is not deployed on chain ${args.chainId}.` };
|
|
8872
|
+
}
|
|
8873
|
+
const registry = listCompoundV3MarketsForChain(args.chainId);
|
|
8874
|
+
let subgraphNote = "";
|
|
8875
|
+
const subgraph = await fetchCompoundV3SubgraphMarkets({ chainId: args.chainId });
|
|
8876
|
+
if (subgraph) {
|
|
8877
|
+
subgraphNote = ` Subgraph listed ${subgraph.length} market id(s); official comet deployments are the address source.`;
|
|
8878
|
+
}
|
|
8879
|
+
if (!args.rpcUrl?.trim()) {
|
|
8880
|
+
return {
|
|
8881
|
+
markets: registry.map(registryMarketRow),
|
|
8882
|
+
notes: "Registry from official comet deployments. Pass rpcUrl (MCP server injects it) to enrich APRs and collaterals." + subgraphNote
|
|
8883
|
+
};
|
|
8884
|
+
}
|
|
8885
|
+
const client = publicClient(args.rpcUrl, args.chainId);
|
|
8886
|
+
const markets = [];
|
|
8887
|
+
for (const row of registry) {
|
|
8888
|
+
try {
|
|
8889
|
+
markets.push(await enrichMarketOnChain(client, row));
|
|
8890
|
+
} catch {
|
|
8891
|
+
markets.push(registryMarketRow(row));
|
|
8892
|
+
}
|
|
8893
|
+
}
|
|
8894
|
+
return {
|
|
8895
|
+
markets,
|
|
8896
|
+
notes: "Comet proxy addresses from official deployments; rates and collaterals from on-chain CometInterface." + subgraphNote
|
|
8897
|
+
};
|
|
8898
|
+
}
|
|
8899
|
+
var chainAssetCache2 = /* @__PURE__ */ new Map();
|
|
8900
|
+
async function ensureCompoundV3ChainAssetCache(args) {
|
|
8901
|
+
const existing = chainAssetCache2.get(args.chainId);
|
|
8902
|
+
if (existing && existing.size > 0 && !args.rpcUrl) return existing;
|
|
8903
|
+
const map = /* @__PURE__ */ new Map();
|
|
8904
|
+
const add = (address, role) => {
|
|
8905
|
+
const key = viem.getAddress(address).toLowerCase();
|
|
8906
|
+
const cur = map.get(key) ?? { base: false, collateral: false };
|
|
8907
|
+
cur[role] = true;
|
|
8908
|
+
map.set(key, cur);
|
|
8909
|
+
};
|
|
8910
|
+
if (args.rpcUrl?.trim()) {
|
|
8911
|
+
try {
|
|
8912
|
+
const { markets } = await compoundV3FetchMarketsSummary({ chainId: args.chainId, rpcUrl: args.rpcUrl });
|
|
8913
|
+
for (const m of markets) {
|
|
8914
|
+
for (const a of m.assets) add(a.asset, a.role === "base" ? "base" : "collateral");
|
|
8915
|
+
}
|
|
8916
|
+
chainAssetCache2.set(args.chainId, map);
|
|
8917
|
+
return map;
|
|
8918
|
+
} catch {
|
|
8919
|
+
}
|
|
8920
|
+
}
|
|
8921
|
+
for (const m of listCompoundV3MarketsForChain(args.chainId)) {
|
|
8922
|
+
if (m.baseToken) add(m.baseToken, "base");
|
|
8923
|
+
}
|
|
8924
|
+
chainAssetCache2.set(args.chainId, map);
|
|
8925
|
+
return map;
|
|
8926
|
+
}
|
|
8927
|
+
|
|
8928
|
+
// src/protocols/evm/compound-v3/index.ts
|
|
8929
|
+
var compoundV3ProtocolModule = {
|
|
8930
|
+
id: COMPOUND_V3_PROTOCOL_ID,
|
|
8931
|
+
chainCategory: "evm",
|
|
8932
|
+
isChainSupported(ctx) {
|
|
8933
|
+
const id = typeof ctx.chainId === "string" ? Number(ctx.chainId) : ctx.chainId;
|
|
8934
|
+
return ctx.chainCategory === "evm" && isCompoundV3ChainSupported(id);
|
|
8935
|
+
},
|
|
8936
|
+
isTokenSupported(token) {
|
|
8937
|
+
return token.category === "evm" && (token.kind === "native" || token.kind === "erc20");
|
|
8938
|
+
},
|
|
8939
|
+
actions: [
|
|
8940
|
+
{
|
|
8941
|
+
id: "compound-v3.supply",
|
|
8942
|
+
protocolId: COMPOUND_V3_PROTOCOL_ID,
|
|
8943
|
+
chainCategory: "evm",
|
|
8944
|
+
description: "Supply base (earn/repay) or collateral to a Comet proxy",
|
|
8945
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8946
|
+
params: {}
|
|
8947
|
+
},
|
|
8948
|
+
{
|
|
8949
|
+
id: "compound-v3.withdraw",
|
|
8950
|
+
protocolId: COMPOUND_V3_PROTOCOL_ID,
|
|
8951
|
+
chainCategory: "evm",
|
|
8952
|
+
description: "Withdraw collateral or base (withdraw of base while undercollateralized = borrow)",
|
|
8953
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8954
|
+
params: {}
|
|
8955
|
+
},
|
|
8956
|
+
{
|
|
8957
|
+
id: "compound-v3.repay",
|
|
8958
|
+
protocolId: COMPOUND_V3_PROTOCOL_ID,
|
|
8959
|
+
chainCategory: "evm",
|
|
8960
|
+
description: "Repay base debt by supplying base",
|
|
8961
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8962
|
+
params: {}
|
|
8963
|
+
},
|
|
8964
|
+
{
|
|
8965
|
+
id: "compound-v3.claim-rewards",
|
|
8966
|
+
protocolId: COMPOUND_V3_PROTOCOL_ID,
|
|
8967
|
+
chainCategory: "evm",
|
|
8968
|
+
description: "Claim COMP / reward token from CometRewards",
|
|
8969
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8970
|
+
params: {}
|
|
8971
|
+
},
|
|
8972
|
+
{
|
|
8973
|
+
id: "compound-v3.bulker",
|
|
8974
|
+
protocolId: COMPOUND_V3_PROTOCOL_ID,
|
|
8975
|
+
chainCategory: "evm",
|
|
8976
|
+
description: "Combined Bulker.invoke (optional)",
|
|
8977
|
+
commonParams: ["keyGen", "purposeText", "useCustomGas"],
|
|
8978
|
+
params: {}
|
|
8979
|
+
}
|
|
8980
|
+
]
|
|
8981
|
+
};
|
|
8982
|
+
registerProtocolModule(compoundV3ProtocolModule);
|
|
7495
8983
|
var skillsDir = path.join(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('catalog.cjs', document.baseURI).href)))), "skills");
|
|
7496
8984
|
var SKILL_PROTOCOL_IDS = [
|
|
7497
8985
|
"aave-v4",
|
|
@@ -7507,7 +8995,9 @@ var SKILL_PROTOCOL_IDS = [
|
|
|
7507
8995
|
"arcus",
|
|
7508
8996
|
"morpho",
|
|
7509
8997
|
"circle-cctp",
|
|
7510
|
-
"
|
|
8998
|
+
"aerodrome",
|
|
8999
|
+
"continuum-dao",
|
|
9000
|
+
"compound-v3"
|
|
7511
9001
|
];
|
|
7512
9002
|
function getToolsForProtocol(protocolId) {
|
|
7513
9003
|
return MCP_TOOL_DEFINITIONS.filter((t) => t.protocolId === protocolId);
|
|
@@ -7573,6 +9063,41 @@ var EULER_V2_SUBGRAPH_CHAIN_IDS = [
|
|
|
7573
9063
|
function advisor(protocolId, tokenFilter, impl) {
|
|
7574
9064
|
return { protocolId, tokenFilter, ...impl };
|
|
7575
9065
|
}
|
|
9066
|
+
function aerodromeAdvisorPriorityTokens() {
|
|
9067
|
+
return [
|
|
9068
|
+
{
|
|
9069
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
9070
|
+
symbol: "ETH",
|
|
9071
|
+
decimals: 18,
|
|
9072
|
+
roles: ["native"]
|
|
9073
|
+
},
|
|
9074
|
+
{
|
|
9075
|
+
address: AERODROME_WETH_BASE,
|
|
9076
|
+
symbol: "WETH",
|
|
9077
|
+
decimals: 18,
|
|
9078
|
+
roles: ["native_wrapped"]
|
|
9079
|
+
},
|
|
9080
|
+
{
|
|
9081
|
+
address: AERODROME_USDC_BASE,
|
|
9082
|
+
symbol: "USDC",
|
|
9083
|
+
decimals: 6,
|
|
9084
|
+
roles: ["swappable", "listed"]
|
|
9085
|
+
},
|
|
9086
|
+
{
|
|
9087
|
+
address: AERODROME_BASE_ADDRESSES_FALLBACK.aero,
|
|
9088
|
+
symbol: "AERO",
|
|
9089
|
+
decimals: 18,
|
|
9090
|
+
roles: ["swappable"]
|
|
9091
|
+
},
|
|
9092
|
+
...AERODROME_COINBASE_STOCK_TOKENS.map((t) => ({
|
|
9093
|
+
address: t.address,
|
|
9094
|
+
symbol: t.symbol,
|
|
9095
|
+
name: t.name,
|
|
9096
|
+
decimals: AERODROME_COINBASE_STOCK_DECIMALS,
|
|
9097
|
+
roles: ["swappable", "listed", "coinbase_b20"]
|
|
9098
|
+
}))
|
|
9099
|
+
];
|
|
9100
|
+
}
|
|
7576
9101
|
var PROTOCOL_SUPPORT_ADVISORS = {
|
|
7577
9102
|
"aave-v4": advisor("aave-v4", "api_underlyings", {
|
|
7578
9103
|
async supportedChainIds() {
|
|
@@ -7839,6 +9364,21 @@ var PROTOCOL_SUPPORT_ADVISORS = {
|
|
|
7839
9364
|
};
|
|
7840
9365
|
}
|
|
7841
9366
|
}),
|
|
9367
|
+
[AERODROME_PROTOCOL_ID]: advisor(AERODROME_PROTOCOL_ID, "pool_graph", {
|
|
9368
|
+
async supportedChainIds() {
|
|
9369
|
+
return [AERODROME_CHAIN_ID];
|
|
9370
|
+
},
|
|
9371
|
+
async supportedTokens(chainId) {
|
|
9372
|
+
if (chainId !== AERODROME_CHAIN_ID) {
|
|
9373
|
+
return { tokens: [], notes: "Aerodrome is Base-only (chainId 8453)." };
|
|
9374
|
+
}
|
|
9375
|
+
return {
|
|
9376
|
+
tokens: aerodromeAdvisorPriorityTokens(),
|
|
9377
|
+
nativeWrapped: AERODROME_WETH_BASE,
|
|
9378
|
+
notes: "Slim directory: ETH, WETH, USDC, AERO, and Coinbase B20 stocks (AAPLc, \u2026). For a price call ctm_aerodrome_quote with tickers. To see pools for one token call ctm_aerodrome_discover_pools. Do not dump LpSugar."
|
|
9379
|
+
};
|
|
9380
|
+
}
|
|
9381
|
+
}),
|
|
7842
9382
|
[VENICE_PROTOCOL_ID]: advisor(VENICE_PROTOCOL_ID, "fixed_addresses", {
|
|
7843
9383
|
async supportedChainIds() {
|
|
7844
9384
|
return [VENICE_BASE_CHAIN_ID];
|
|
@@ -7877,6 +9417,54 @@ var PROTOCOL_SUPPORT_ADVISORS = {
|
|
|
7877
9417
|
};
|
|
7878
9418
|
}
|
|
7879
9419
|
}),
|
|
9420
|
+
[COMPOUND_V3_PROTOCOL_ID]: advisor(COMPOUND_V3_PROTOCOL_ID, "api_underlyings", {
|
|
9421
|
+
async supportedChainIds() {
|
|
9422
|
+
return listCompoundV3SupportedChainIds();
|
|
9423
|
+
},
|
|
9424
|
+
async supportedTokens(chainId, ctx) {
|
|
9425
|
+
const cache = await ensureCompoundV3ChainAssetCache({ chainId, rpcUrl: ctx?.rpcUrl });
|
|
9426
|
+
const nativeWrapped = compoundV3WrappedNative(chainId);
|
|
9427
|
+
const tokens = [];
|
|
9428
|
+
if (nativeWrapped) {
|
|
9429
|
+
tokens.push({
|
|
9430
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
9431
|
+
symbol: "ETH",
|
|
9432
|
+
decimals: 18,
|
|
9433
|
+
roles: ["native"]
|
|
9434
|
+
});
|
|
9435
|
+
tokens.push({
|
|
9436
|
+
address: nativeWrapped,
|
|
9437
|
+
symbol: "WETH",
|
|
9438
|
+
roles: ["native_wrapped"]
|
|
9439
|
+
});
|
|
9440
|
+
}
|
|
9441
|
+
for (const [address, modes] of cache) {
|
|
9442
|
+
if (nativeWrapped && address === nativeWrapped.toLowerCase()) continue;
|
|
9443
|
+
tokens.push({
|
|
9444
|
+
address,
|
|
9445
|
+
roles: [...modes.base ? ["base"] : [], ...modes.collateral ? ["collateral"] : []]
|
|
9446
|
+
});
|
|
9447
|
+
}
|
|
9448
|
+
return {
|
|
9449
|
+
tokens,
|
|
9450
|
+
nativeWrapped: nativeWrapped ?? void 0,
|
|
9451
|
+
notes: "Compound III Comet base and collateral tokens. Native ETH uses wrapped native (automatic wrap/unwrap). Pass comet from ctm_compound_v3_fetch_markets."
|
|
9452
|
+
};
|
|
9453
|
+
},
|
|
9454
|
+
async isTokenSupported(chainId, address, ctx) {
|
|
9455
|
+
const cache = await ensureCompoundV3ChainAssetCache({ chainId, rpcUrl: ctx?.rpcUrl });
|
|
9456
|
+
let normalized;
|
|
9457
|
+
try {
|
|
9458
|
+
normalized = viem.getAddress(address).toLowerCase();
|
|
9459
|
+
} catch {
|
|
9460
|
+
return false;
|
|
9461
|
+
}
|
|
9462
|
+
if (normalized === "0x0000000000000000000000000000000000000000") return true;
|
|
9463
|
+
const wrapped = compoundV3WrappedNative(chainId);
|
|
9464
|
+
if (wrapped && wrapped.toLowerCase() === normalized) return true;
|
|
9465
|
+
return cache.has(normalized);
|
|
9466
|
+
}
|
|
9467
|
+
}),
|
|
7880
9468
|
arcus: advisor("arcus", "api_underlyings", {
|
|
7881
9469
|
async supportedChainIds() {
|
|
7882
9470
|
return [...ARCUS_SUPPORTED_CHAIN_IDS];
|
|
@@ -7911,7 +9499,9 @@ registerProtocolModule(arcusProtocolModule);
|
|
|
7911
9499
|
registerProtocolModule(morphoProtocolModule);
|
|
7912
9500
|
registerProtocolModule(circleCctpProtocolModule);
|
|
7913
9501
|
registerProtocolModule(veniceProtocolModule);
|
|
9502
|
+
registerProtocolModule(aerodromeProtocolModule);
|
|
7914
9503
|
registerProtocolModule(continuumDaoProtocolModule);
|
|
9504
|
+
registerProtocolModule(compoundV3ProtocolModule);
|
|
7915
9505
|
function getAgentCatalog() {
|
|
7916
9506
|
return {
|
|
7917
9507
|
protocols: getProtocolModules(),
|
|
@@ -7934,7 +9524,9 @@ function getAgentCatalog() {
|
|
|
7934
9524
|
morpho: morphoProtocolModule,
|
|
7935
9525
|
circleCctp: circleCctpProtocolModule,
|
|
7936
9526
|
venice: veniceProtocolModule,
|
|
9527
|
+
aerodrome: aerodromeProtocolModule,
|
|
7937
9528
|
continuumDao: continuumDaoProtocolModule,
|
|
9529
|
+
compoundV3: compoundV3ProtocolModule,
|
|
7938
9530
|
/** Prefer getAgentCatalogForMcp() or getMcpToolDefinitions() for MCP servers. */
|
|
7939
9531
|
mcp: getAgentCatalogForMcp()
|
|
7940
9532
|
};
|
|
@@ -7972,6 +9564,30 @@ exports.mcpAaveV4BorrowInputSchema = mcpAaveV4BorrowInputSchema;
|
|
|
7972
9564
|
exports.mcpAaveV4DepositInputSchema = mcpAaveV4DepositInputSchema;
|
|
7973
9565
|
exports.mcpAaveV4RepayInputSchema = mcpAaveV4RepayInputSchema;
|
|
7974
9566
|
exports.mcpAaveV4WithdrawInputSchema = mcpAaveV4WithdrawInputSchema;
|
|
9567
|
+
exports.mcpAerodromeBuildAddLiquidityMultisignInputSchema = mcpAerodromeBuildAddLiquidityMultisignInputSchema;
|
|
9568
|
+
exports.mcpAerodromeBuildClBurnMultisignInputSchema = mcpAerodromeBuildClBurnMultisignInputSchema;
|
|
9569
|
+
exports.mcpAerodromeBuildClCollectFeesMultisignInputSchema = mcpAerodromeBuildClCollectFeesMultisignInputSchema;
|
|
9570
|
+
exports.mcpAerodromeBuildClDecreaseMultisignInputSchema = mcpAerodromeBuildClDecreaseMultisignInputSchema;
|
|
9571
|
+
exports.mcpAerodromeBuildClIncreaseMultisignInputSchema = mcpAerodromeBuildClIncreaseMultisignInputSchema;
|
|
9572
|
+
exports.mcpAerodromeBuildClMintMultisignInputSchema = mcpAerodromeBuildClMintMultisignInputSchema;
|
|
9573
|
+
exports.mcpAerodromeBuildClaimEmissionsMultisignInputSchema = mcpAerodromeBuildClaimEmissionsMultisignInputSchema;
|
|
9574
|
+
exports.mcpAerodromeBuildClaimFeesMultisignInputSchema = mcpAerodromeBuildClaimFeesMultisignInputSchema;
|
|
9575
|
+
exports.mcpAerodromeBuildGaugeStakeMultisignInputSchema = mcpAerodromeBuildGaugeStakeMultisignInputSchema;
|
|
9576
|
+
exports.mcpAerodromeBuildGaugeUnstakeMultisignInputSchema = mcpAerodromeBuildGaugeUnstakeMultisignInputSchema;
|
|
9577
|
+
exports.mcpAerodromeBuildRemoveLiquidityMultisignInputSchema = mcpAerodromeBuildRemoveLiquidityMultisignInputSchema;
|
|
9578
|
+
exports.mcpAerodromeBuildSwapMultisignInputSchema = mcpAerodromeBuildSwapMultisignInputSchema;
|
|
9579
|
+
exports.mcpAerodromeDiscoverPoolsInputSchema = mcpAerodromeDiscoverPoolsInputSchema;
|
|
9580
|
+
exports.mcpAerodromeDiscoverPoolsOutputSchema = mcpAerodromeDiscoverPoolsOutputSchema;
|
|
9581
|
+
exports.mcpAerodromeFetchPoolsInputSchema = mcpAerodromeFetchPoolsInputSchema;
|
|
9582
|
+
exports.mcpAerodromeFetchPoolsOutputSchema = mcpAerodromeFetchPoolsOutputSchema;
|
|
9583
|
+
exports.mcpAerodromeFetchPositionsInputSchema = mcpAerodromeFetchPositionsInputSchema;
|
|
9584
|
+
exports.mcpAerodromeFetchPositionsOutputSchema = mcpAerodromeFetchPositionsOutputSchema;
|
|
9585
|
+
exports.mcpAerodromeQuoteAddLiquidityInputSchema = mcpAerodromeQuoteAddLiquidityInputSchema;
|
|
9586
|
+
exports.mcpAerodromeQuoteAddLiquidityOutputSchema = mcpAerodromeQuoteAddLiquidityOutputSchema;
|
|
9587
|
+
exports.mcpAerodromeQuoteClDepositInputSchema = mcpAerodromeQuoteClDepositInputSchema;
|
|
9588
|
+
exports.mcpAerodromeQuoteClDepositOutputSchema = mcpAerodromeQuoteClDepositOutputSchema;
|
|
9589
|
+
exports.mcpAerodromeQuoteInputSchema = mcpAerodromeQuoteInputSchema;
|
|
9590
|
+
exports.mcpAerodromeQuoteOutputSchema = mcpAerodromeQuoteOutputSchema;
|
|
7975
9591
|
exports.mcpArcusBuildCancelOrderMultisignInputSchema = mcpArcusBuildCancelOrderMultisignInputSchema;
|
|
7976
9592
|
exports.mcpArcusBuildCloseMultisignInputSchema = mcpArcusBuildCloseMultisignInputSchema;
|
|
7977
9593
|
exports.mcpArcusBuildCreateApiKeyMultisignInputSchema = mcpArcusBuildCreateApiKeyMultisignInputSchema;
|
|
@@ -8002,6 +9618,17 @@ exports.mcpArcusSpotFetchMarketsInputSchema = mcpArcusSpotFetchMarketsInputSchem
|
|
|
8002
9618
|
exports.mcpArcusSpotFetchMarketsOutputSchema = mcpArcusSpotFetchMarketsOutputSchema;
|
|
8003
9619
|
exports.mcpArcusSpotFetchOhlcvInputSchema = mcpArcusSpotFetchOhlcvInputSchema;
|
|
8004
9620
|
exports.mcpArcusSpotFetchOhlcvOutputSchema = mcpArcusSpotFetchOhlcvOutputSchema;
|
|
9621
|
+
exports.mcpCompoundV3BulkerInputSchema = mcpCompoundV3BulkerInputSchema;
|
|
9622
|
+
exports.mcpCompoundV3ClaimRewardsInputSchema = mcpCompoundV3ClaimRewardsInputSchema;
|
|
9623
|
+
exports.mcpCompoundV3FetchAccountInputSchema = mcpCompoundV3FetchAccountInputSchema;
|
|
9624
|
+
exports.mcpCompoundV3FetchAccountOutputSchema = mcpCompoundV3FetchAccountOutputSchema;
|
|
9625
|
+
exports.mcpCompoundV3FetchMarketInputSchema = mcpCompoundV3FetchMarketInputSchema;
|
|
9626
|
+
exports.mcpCompoundV3FetchMarketOutputSchema = mcpCompoundV3FetchMarketOutputSchema;
|
|
9627
|
+
exports.mcpCompoundV3FetchMarketsInputSchema = mcpCompoundV3FetchMarketsInputSchema;
|
|
9628
|
+
exports.mcpCompoundV3FetchMarketsOutputSchema = mcpCompoundV3FetchMarketsOutputSchema;
|
|
9629
|
+
exports.mcpCompoundV3RepayInputSchema = mcpCompoundV3RepayInputSchema;
|
|
9630
|
+
exports.mcpCompoundV3SupplyInputSchema = mcpCompoundV3SupplyInputSchema;
|
|
9631
|
+
exports.mcpCompoundV3WithdrawInputSchema = mcpCompoundV3WithdrawInputSchema;
|
|
8005
9632
|
exports.mcpContinuumDaoAttachInputSchema = mcpContinuumDaoAttachInputSchema;
|
|
8006
9633
|
exports.mcpContinuumDaoCastVoteBravoInputSchema = mcpContinuumDaoCastVoteBravoInputSchema;
|
|
8007
9634
|
exports.mcpContinuumDaoCastVoteDeltaInputSchema = mcpContinuumDaoCastVoteDeltaInputSchema;
|
|
@@ -8166,13 +9793,17 @@ exports.mcpMorphoFetchEarnVaultsInputSchema = mcpMorphoFetchEarnVaultsInputSchem
|
|
|
8166
9793
|
exports.mcpMorphoFetchEarnVaultsOutputSchema = mcpMorphoFetchEarnVaultsOutputSchema;
|
|
8167
9794
|
exports.mcpMorphoFetchMidnightBooksInputSchema = mcpMorphoFetchMidnightBooksInputSchema;
|
|
8168
9795
|
exports.mcpMorphoFetchMidnightBooksOutputSchema = mcpMorphoFetchMidnightBooksOutputSchema;
|
|
9796
|
+
exports.mcpMorphoFetchMidnightOffersInputSchema = mcpMorphoFetchMidnightOffersInputSchema;
|
|
9797
|
+
exports.mcpMorphoFetchMidnightOffersOutputSchema = mcpMorphoFetchMidnightOffersOutputSchema;
|
|
8169
9798
|
exports.mcpMorphoFetchMidnightPositionsInputSchema = mcpMorphoFetchMidnightPositionsInputSchema;
|
|
8170
9799
|
exports.mcpMorphoFetchMidnightPositionsOutputSchema = mcpMorphoFetchMidnightPositionsOutputSchema;
|
|
8171
9800
|
exports.mcpMorphoFetchMidnightQuoteInputSchema = mcpMorphoFetchMidnightQuoteInputSchema;
|
|
8172
9801
|
exports.mcpMorphoFetchMidnightQuoteOutputSchema = mcpMorphoFetchMidnightQuoteOutputSchema;
|
|
8173
9802
|
exports.mcpMorphoMerklClaimInputSchema = mcpMorphoMerklClaimInputSchema;
|
|
8174
9803
|
exports.mcpMorphoMidnightBorrowInputSchema = mcpMorphoMidnightBorrowInputSchema;
|
|
9804
|
+
exports.mcpMorphoMidnightCancelLendOfferInputSchema = mcpMorphoMidnightCancelLendOfferInputSchema;
|
|
8175
9805
|
exports.mcpMorphoMidnightLendInputSchema = mcpMorphoMidnightLendInputSchema;
|
|
9806
|
+
exports.mcpMorphoMidnightLendOfferInputSchema = mcpMorphoMidnightLendOfferInputSchema;
|
|
8176
9807
|
exports.mcpMorphoMidnightRepayInputSchema = mcpMorphoMidnightRepayInputSchema;
|
|
8177
9808
|
exports.mcpMorphoVaultDepositInputSchema = mcpMorphoVaultDepositInputSchema;
|
|
8178
9809
|
exports.mcpMorphoVaultWithdrawInputSchema = mcpMorphoVaultWithdrawInputSchema;
|