@continuumdao/ctm-mpc-defi
v0.2.9
Published
Continuum MPC DeFi protocol library — multiSignRequest builders for EVM and future chain categories
Readme
@continuumdao/ctm-mpc-defi
Continuum MPC DeFi protocol library — builds multiSignRequest payloads for EVM (and future chain categories). Bundled into the continuum-mcp-server Docker image; linked locally via file:../ctm-mpc-defi.
License: Business Source License 1.1 (ContinuumDAO). Converts to GPL-3.0-or-later on 2030-01-01.
Architecture
| Layer | Path | Role |
|-------|------|------|
| Core | src/core/ | Purpose text, mpc-auth envelope, protocol registry |
| Chain categories | src/chains/<category>/ | EVM batch builder; Solana/NEAR stubs |
| Protocols | src/protocols/<category>/<name>/ | DeFi actions (Uniswap V4, Curve DAO, …) |
| Agent | src/agent/ | MCP tool catalog, SKILL.md, support advisors |
Management reads, fee helpers, and client-sign utilities live in @continuumdao/continuum-node-sdk — import those from the SDK, not from this package.
Install
This package is published to npm for production deploys (e.g. Railway). For local development against unreleased changes, use a file: link:
"@continuumdao/ctm-mpc-defi": "file:../ctm-mpc-defi"Run npm run build in this repo after changes so dist/ is up to date before linking.
Package exports
@continuumdao/ctm-mpc-defi— registry + protocol modules@continuumdao/ctm-mpc-defi/core— envelope, registry,KeyGenSubset,firstClientIdFromKeyGen@continuumdao/ctm-mpc-defi/chains/evm—buildEvmMultisignBatch, chain helpers@continuumdao/ctm-mpc-defi/protocols/evm/<protocol>— per-protocol builders@continuumdao/ctm-mpc-defi/agent— MCP tool catalog and SKILL.md paths
Protocol example (Uniswap V4)
import { uniswapV4 } from '@continuumdao/ctm-mpc-defi/protocols/evm/uniswap-v4'
const quote = await uniswapV4.quote({ /* … */ })
const { bodyForSign, messageToSign } = await uniswapV4.buildSwapMultisignBody({ /* … */ })
// Sign messageToSign, POST { ...bodyForSign, clientSig, signedMessage }MCP servers
Use the agent export for tool registration and discovery:
import { getMcpToolDefinitions, getAgentCatalogForMcp } from '@continuumdao/ctm-mpc-defi/agent'
for (const tool of getMcpToolDefinitions()) {
// Register tool.name, tool.description, tool.inputSchema, tool.outputSchema
// Invoke via tool.handler.importPath + exportName
}Each MCP tool includes descriptions, Zod-derived JSON schemas, prerequisites/followUp hints, and a handler pointing at the library export. The continuum-node-sdk MCP server enriches slim inputs (keyGenId, chainId) before calling builders.
Development
npm install
npm run build
npm test
npm run typecheck