@bbigu0898/copy-trading-mcp-server
Version:
跟单交易 MCP Server - 支持创建和管理复杂的跟单任务,自动跟随其他用户的交易策略
128 lines • 6.95 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteCopyTradingRequestSchema = exports.SwitchCopyTradingRequestSchema = exports.EditCopyTradingRequestSchema = exports.CreateCopyTradingRequestSchema = exports.SellSettingsSchema = exports.BuySettingsSchema = exports.PnlGroupSchema = exports.SellSpeedTypeSchema = exports.SellAmountTypeSchema = exports.SellModeSchema = exports.BuyAmountTypeSchema = exports.ChainSchema = void 0;
const zod_1 = require("zod");
// 基础类型定义
exports.ChainSchema = zod_1.z.enum(['solana', 'ethereum', 'base', 'bsc', 'tron']);
exports.BuyAmountTypeSchema = zod_1.z.enum(['fixed_amount', 'fixed_ratio', 'follow_amount']);
exports.SellModeSchema = zod_1.z.enum(['mixed', 'only_copy', 'only_pnl']);
exports.SellAmountTypeSchema = zod_1.z.enum(['all', 'follow_ratio', 'x_target_ratio']);
exports.SellSpeedTypeSchema = zod_1.z.enum(['fast', 'accurate']);
// 止盈止损分组
exports.PnlGroupSchema = zod_1.z.object({
pricePercent: zod_1.z.number().min(0).max(1),
amountPercent: zod_1.z.number().min(0).max(1),
});
// 购买设置
exports.BuySettingsSchema = zod_1.z.object({
enabled: zod_1.z.boolean().default(true),
startHour: zod_1.z.number().int().min(0).max(23).default(0),
endHour: zod_1.z.number().int().min(0).max(23).default(23),
buyAmountType: exports.BuyAmountTypeSchema.default('follow_amount'),
maxBuyAmountUI: zod_1.z.string().min(1),
buyRatio: zod_1.z.number().min(0).max(10).default(1),
maxBalanceUI: zod_1.z.number().min(0).default(100),
reservedAmountUI: zod_1.z.number().min(0).default(0.01),
targetMinAmountUI: zod_1.z.number().min(0).default(0),
targetMaxAmountUI: zod_1.z.number().min(0).default(999999),
minTokenMCUSD: zod_1.z.number().min(0).default(0),
maxTokenMCUSD: zod_1.z.number().min(0).default(999999999),
maxBuyTax: zod_1.z.number().min(0).max(1).optional(),
maxSellTax: zod_1.z.number().min(0).max(1).optional(),
customFeeAndTip: zod_1.z.boolean().default(false),
priorityFee: zod_1.z.string().default(''),
gasFeeDelta: zod_1.z.number().int().min(0).default(5),
maxFeePerGas: zod_1.z.number().int().min(0).default(100),
jitoEnabled: zod_1.z.boolean().default(true),
jitoTip: zod_1.z.number().min(0).default(0.001),
maxSlippage: zod_1.z.number().min(0).max(1).default(0.1),
skipFreezableToken: zod_1.z.boolean().default(false),
skipMintableToken: zod_1.z.boolean().default(false),
skipDelegatedToken: zod_1.z.boolean().default(false),
skipNotOpensource: zod_1.z.boolean().default(false),
skipHoneyPot: zod_1.z.boolean().default(false),
skipTargetIncreasePosition: zod_1.z.boolean().default(false),
minBurnedLp: zod_1.z.number().min(0).max(1).default(0),
minLpUsd: zod_1.z.number().min(0).default(0),
minTokenAgeMs: zod_1.z.number().min(0).default(0),
maxTokenAgeMs: zod_1.z.number().min(0).default(999999999999),
maxTopHoldPercent: zod_1.z.number().min(0).max(1).default(1),
maxBuyTimesPerToken: zod_1.z.number().int().min(1).default(999),
maxBuyAmountPerToken: zod_1.z.number().min(0).default(999999),
buyExist: zod_1.z.boolean().default(false),
buyOncePerWallet: zod_1.z.boolean().default(false),
concurrentNodes: zod_1.z.number().int().min(1).max(3).default(2),
retries: zod_1.z.number().int().min(0).max(10).default(1),
});
// 卖出设置
exports.SellSettingsSchema = zod_1.z.object({
enabled: zod_1.z.boolean().default(true),
startHour: zod_1.z.number().int().min(0).max(23).default(0),
endHour: zod_1.z.number().int().min(0).max(23).default(23),
mode: exports.SellModeSchema.default('mixed'),
sellAmountType: exports.SellAmountTypeSchema.default('all'),
xTargetRatio: zod_1.z.number().min(0).max(100).default(1),
sellSpeedType: exports.SellSpeedTypeSchema.default('accurate'),
targetMinAmountUI: zod_1.z.number().min(0).default(0),
targetMaxAmountUI: zod_1.z.number().min(0).default(999999),
stopEarnPercent: zod_1.z.number().min(0).optional(),
stopLossPercent: zod_1.z.number().min(0).optional(),
stopEarnGroup: zod_1.z.array(exports.PnlGroupSchema).max(6).optional(),
stopLossGroup: zod_1.z.array(exports.PnlGroupSchema).max(6).optional(),
trailingStopGroup: zod_1.z.array(exports.PnlGroupSchema).max(1).optional(),
pnlOrderExpireDelta: zod_1.z.number().int().min(0).max(432000000).default(43200000),
pnlOrderExpireExecute: zod_1.z.boolean().default(false),
pnlOrderUseMidPrice: zod_1.z.boolean().default(false),
sellMode: zod_1.z.enum(['smart', 'normal']).default('smart'),
migrateSellPercent: zod_1.z.number().min(0).max(1).default(0),
minDevSellPercent: zod_1.z.number().min(0).max(1).default(0.5),
devSellPercent: zod_1.z.number().min(0).max(1).default(1),
customFeeAndTip: zod_1.z.boolean().default(false),
priorityFee: zod_1.z.string().default(''),
gasFeeDelta: zod_1.z.number().int().min(0).default(5),
maxFeePerGas: zod_1.z.number().int().min(0).default(100),
jitoEnabled: zod_1.z.boolean().default(true),
jitoTip: zod_1.z.number().min(0).default(0.001),
maxSlippage: zod_1.z.number().min(0).max(1).default(0.1),
concurrentNodes: zod_1.z.number().int().min(1).max(3).default(2),
retries: zod_1.z.number().int().min(0).max(10).default(1),
});
// 创建跟单任务请求
exports.CreateCopyTradingRequestSchema = zod_1.z.object({
enabled: zod_1.z.boolean().default(true),
name: zod_1.z.string().min(1),
chain: exports.ChainSchema.default('solana'),
dexFilter: zod_1.z.array(zod_1.z.string()).optional(),
targetIds: zod_1.z.array(zod_1.z.string()).min(1).max(10),
tokenBlacklist: zod_1.z.array(zod_1.z.string()).max(20).optional(),
walletId: zod_1.z.string().min(1).optional(),
groupId: zod_1.z.string().optional(),
buySettings: exports.BuySettingsSchema,
sellSettings: exports.SellSettingsSchema,
});
// 编辑跟单任务请求
exports.EditCopyTradingRequestSchema = zod_1.z.object({
id: zod_1.z.string().min(1),
enabled: zod_1.z.boolean(),
name: zod_1.z.string().min(1),
chain: exports.ChainSchema,
dexFilter: zod_1.z.array(zod_1.z.string()).optional(),
targetIds: zod_1.z.array(zod_1.z.string()).min(1).max(10),
tokenBlacklist: zod_1.z.array(zod_1.z.string()).max(20).optional(),
walletId: zod_1.z.string().min(1).optional(),
groupId: zod_1.z.string().optional(),
buySettings: exports.BuySettingsSchema,
sellSettings: exports.SellSettingsSchema,
});
// 开关跟单任务请求
exports.SwitchCopyTradingRequestSchema = zod_1.z.object({
id: zod_1.z.string().min(1),
enabled: zod_1.z.boolean(),
closePnlOrder: zod_1.z.boolean().default(false),
});
// 删除跟单任务请求
exports.DeleteCopyTradingRequestSchema = zod_1.z.object({
id: zod_1.z.string().min(1),
deletePnlOrder: zod_1.z.boolean().default(false),
});
//# sourceMappingURL=types.js.map