feat: 实现跟单筛选条件记录和展示功能

- 新增 FilteredOrder 实体和数据库表,记录被过滤的订单信息
- 在筛选失败时自动记录到数据库并发送 Telegram 通知
- 创建 FilteredOrderService 和 API 接口,支持查询被过滤订单列表
- 前端新增被过滤订单列表页面,支持按过滤类型筛选
- 修复价差计算逻辑,使用数组最大值和最小值而非第一个元素
- 优化编辑页面 UI,钱包和 Leader 显示与创建页面一致(只读)
- 添加多语言支持(中文、繁体中文、英文)
This commit is contained in:
WrBug
2025-12-05 05:18:20 +08:00
parent e68309ada0
commit 9b8150cf92
33 changed files with 3801 additions and 549 deletions
+288 -7
View File
@@ -16,7 +16,17 @@
"reset": "Reset",
"close": "Close",
"yes": "Yes",
"no": "No"
"no": "No",
"actions": "Actions",
"all": "All",
"createdAt": "Created At",
"updatedAt": "Updated At",
"status": "Status",
"enabled": "Enabled",
"disabled": "Disabled",
"noData": "No Data",
"saveConfig": "Save Config",
"refreshConfig": "Refresh Config"
},
"account": {
"title": "Account Management",
@@ -54,6 +64,10 @@
"accountIdRequired": "Account ID cannot be empty"
},
"message": {
"success": "Operation successful",
"error": "Operation failed",
"loading": "Loading...",
"noData": "No Data",
"loginSuccess": "Login successful",
"loginFailed": "Login failed",
"createUserSuccess": "User created successfully",
@@ -65,11 +79,13 @@
"title": "Login",
"username": "Username",
"password": "Password",
"usernamePlaceholder": "Username",
"passwordPlaceholder": "Password",
"usernameRequired": "Please enter username",
"passwordRequired": "Please enter password",
"forgotPassword": "Forgot password? Reset password"
"usernamePlaceholder": "Please enter username",
"passwordPlaceholder": "Please enter password",
"forgotPassword": "Forgot password?",
"loginFailed": "Login failed",
"loginSuccess": "Login successful"
},
"order": {
"create": "Order Created",
@@ -85,6 +101,8 @@
},
"accountList": {
"title": "Account Management",
"addAccount": "Add Account",
"actions": "Actions",
"importAccount": "Import Account",
"accountName": "Account Name",
"walletAddress": "Wallet Address",
@@ -138,7 +156,8 @@
"updateSuccess": "Account updated successfully",
"updateFailed": "Failed to update account",
"getDetailFailedForEdit": "Failed to get account detail",
"loading": "Loading..."
"loading": "Loading...",
"fetchFailed": "Failed to get account list"
},
"accountImport": {
"title": "Import Account",
@@ -163,7 +182,13 @@
"mnemonicInvalid": "Invalid mnemonic format (should be 12 or 24 words, space-separated)",
"walletAddressMismatchMnemonic": "Wallet address does not match mnemonic",
"accountName": "Account Name",
"accountNameRequired": "Please enter account name",
"accountNamePlaceholder": "Optional, for identifying account",
"accountNameHelp": "Used to identify account for management",
"privateKeyHelp": "Private key will be encrypted and stored, only used for signing transactions",
"submit": "Import",
"invalidPrivateKey": "Invalid private key",
"duplicateAccount": "Account already exists",
"importAccount": "Import Account",
"importSuccess": "Account imported successfully",
"importFailed": "Failed to import account",
@@ -174,6 +199,7 @@
"leader": {
"title": "Leader Management",
"leaderName": "Leader Name",
"leaderAddress": "Wallet Address",
"walletAddress": "Wallet Address",
"category": "Category",
"all": "All",
@@ -181,8 +207,11 @@
"createdAt": "Created At",
"action": "Actions",
"add": "Add",
"addLeader": "Add Leader",
"edit": "Edit",
"editLeader": "Edit Leader",
"delete": "Delete",
"deleteLeader": "Delete Leader",
"listFailed": "Failed to get Leader list",
"deleteSuccess": "Leader deleted successfully",
"deleteFailed": "Failed to delete Leader",
@@ -220,10 +249,16 @@
},
"apiHealthStatus": {
"title": "API Health Status",
"checkFailed": "Check Failed",
"status": "Status",
"responseTime": "Response Time",
"lastCheck": "Last Check",
"healthy": "Healthy",
"unhealthy": "Unhealthy",
"unknown": "Unknown",
"normal": "Normal",
"notConfigured": "Not Configured",
"abnormal": "Abnormal",
"responseTime": "Response Time"
"abnormal": "Abnormal"
},
"proxySettings": {
"title": "Proxy Settings",
@@ -403,6 +438,248 @@
"invalidNumber": "Please enter a valid number",
"fixedAmountError": "Fixed amount must be >= 1, please re-enter"
},
"templateAdd": {
"title": "Create Copy Trading Template",
"back": "Back",
"templateName": "Template Name",
"templateNamePlaceholder": "Please enter template name",
"templateNameRequired": "Please enter template name",
"templateNameTooltip": "Unique identifier name for the template, used to distinguish different copy trading configuration templates. Template name must be unique and cannot duplicate other templates.",
"copyMode": "Copy Amount Mode",
"copyModeTooltip": "Select the calculation method for copy amount. Ratio mode: copy amount changes proportionally with Leader order size; Fixed amount mode: copy amount remains fixed regardless of Leader order size.",
"ratioMode": "Ratio Mode",
"fixedAmountMode": "Fixed Amount Mode",
"copyRatio": "Copy Ratio",
"copyRatioTooltip": "Copy ratio represents the percentage of copy amount relative to Leader order amount. For example: 100% means 1:1 copy, 50% means half position copy, 200% means double copy",
"copyRatioPlaceholder": "For example: 100 means 100% (1:1 copy), default 100%",
"fixedAmount": "Fixed Copy Amount (USDC)",
"fixedAmountPlaceholder": "Fixed amount, does not change with Leader order size, must be >= 1",
"fixedAmountRequired": "Please enter fixed copy amount",
"fixedAmountError": "Fixed amount must be >= 1, please re-enter",
"maxOrderSize": "Max Order Size (USDC)",
"maxOrderSizeTooltip": "In ratio mode, limits the maximum amount cap for single copy order, used to prevent excessive copy amount and control risk. For example: set to 1000, even if calculated copy amount exceeds 1000, it will be limited to 1000 USDC.",
"maxOrderSizePlaceholder": "Only effective in ratio mode (optional)",
"minOrderSize": "Min Order Size (USDC)",
"minOrderSizeTooltip": "In ratio mode, limits the minimum amount floor for single copy order, used to filter out orders with too small amounts, avoiding frequent small trades. If filled, must be >= 1 USDC. For example: set to 10, if calculated copy amount is less than 10, skip this order.",
"minOrderSizePlaceholder": "Only effective in ratio mode, must be >= 1 (optional)",
"minOrderSizeError": "Minimum amount must be >= 1",
"maxDailyOrders": "Max Daily Copy Orders",
"maxDailyOrdersTooltip": "Limits the maximum number of copy orders per day, used for risk control and preventing overtrading. For example: set to 50, when daily copy orders reach 50, stop copying, reset next day.",
"maxDailyOrdersPlaceholder": "Default 100 (optional)",
"priceTolerance": "Price Tolerance (%)",
"priceToleranceTooltip": "Allowed adjustment range for copy price based on Leader price, used to adjust price within Leader price ± tolerance range to improve fill rate. For example: set to 5%, Leader price is 0.5, then copy price can be in 0.475-0.525 range.",
"priceTolerancePlaceholder": "Default 5% (optional)",
"minOrderDepth": "Min Order Depth (USDC)",
"minOrderDepthTooltip": "Minimum order depth (USDC amount), NULL means this filter is not enabled. Ensures market has sufficient liquidity",
"minOrderDepthPlaceholder": "For example: 100 (optional, leave empty to disable)",
"maxSpread": "Max Spread (Absolute Price)",
"maxSpreadTooltip": "Maximum spread (absolute price), NULL means this filter is not enabled. Avoid copying in markets with excessive spreads",
"maxSpreadPlaceholder": "For example: 0.05 (5 cents, optional, leave empty to disable)",
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled. Check depth of first N levels",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders. Enabled: copy both Leader's buy and sell orders; Disabled: only copy Leader's buy orders, ignore sell orders.",
"create": "Create Template",
"createSuccess": "Template created successfully",
"createFailed": "Failed to create template",
"invalidNumber": "Please enter a valid number"
},
"templateEdit": {
"title": "Edit Copy Trading Template",
"back": "Back",
"save": "Save Changes",
"saveSuccess": "Template updated successfully",
"saveFailed": "Failed to update template",
"fetchFailed": "Failed to get template details",
"templateName": "Template Name",
"templateNamePlaceholder": "Please enter template name",
"templateNameRequired": "Please enter template name",
"templateNameTooltip": "Unique identifier name for the template, used to distinguish different copy trading configuration templates. Template name must be unique and cannot duplicate other templates.",
"copyMode": "Copy Amount Mode",
"copyModeTooltip": "Select the calculation method for copy amount. Ratio mode: copy amount changes proportionally with Leader order size; Fixed amount mode: copy amount remains fixed regardless of Leader order size.",
"ratioMode": "Ratio Mode",
"fixedAmountMode": "Fixed Amount Mode",
"copyRatio": "Copy Ratio",
"copyRatioTooltip": "Copy ratio represents the percentage of copy amount relative to Leader order amount. For example: 100% means 1:1 copy, 50% means half position copy, 200% means double copy",
"copyRatioPlaceholder": "For example: 100 means 100% (1:1 copy), default 100%",
"fixedAmount": "Fixed Copy Amount (USDC)",
"fixedAmountPlaceholder": "Fixed amount, does not change with Leader order size, must be >= 1",
"fixedAmountRequired": "Please enter fixed copy amount",
"fixedAmountError": "Fixed amount must be >= 1, please re-enter",
"fixedAmountTooltip": "In fixed amount mode, the fixed amount for each copy, does not change with Leader order size. Must be >= 1 USDC. For example: set to 10, then regardless of how much Leader buys, copy amount is always 10 USDC.",
"maxOrderSize": "Max Order Size (USDC)",
"maxOrderSizeTooltip": "In ratio mode, limits the maximum amount cap for single copy order, used to prevent excessive copy amount and control risk. For example: set to 1000, even if calculated copy amount exceeds 1000, it will be limited to 1000 USDC.",
"maxOrderSizePlaceholder": "Only effective in ratio mode (optional)",
"minOrderSize": "Min Order Size (USDC)",
"minOrderSizeTooltip": "In ratio mode, limits the minimum amount floor for single copy order, used to filter out orders with too small amounts, avoiding frequent small trades. If filled, must be >= 1 USDC. For example: set to 10, if calculated copy amount is less than 10, skip this order.",
"minOrderSizePlaceholder": "Only effective in ratio mode, must be >= 1 (optional)",
"minOrderSizeError": "Minimum amount must be >= 1",
"maxDailyOrders": "Max Daily Copy Orders",
"maxDailyOrdersTooltip": "Limits the maximum number of copy orders per day, used for risk control and preventing overtrading. For example: set to 50, when daily copy orders reach 50, stop copying, reset next day.",
"maxDailyOrdersPlaceholder": "Default 100 (optional)",
"priceTolerance": "Price Tolerance (%)",
"priceToleranceTooltip": "Allowed adjustment range for copy price based on Leader price, used to adjust price within Leader price ± tolerance range to improve fill rate. For example: set to 5%, Leader price is 0.5, then copy price can be in 0.475-0.525 range.",
"priceTolerancePlaceholder": "Default 5% (optional)",
"minOrderDepth": "Min Order Depth (USDC)",
"minOrderDepthTooltip": "Minimum order depth (USDC amount), NULL means this filter is not enabled. Ensures market has sufficient liquidity",
"minOrderDepthPlaceholder": "For example: 100 (optional, leave empty to disable)",
"maxSpread": "Max Spread (Absolute Price)",
"maxSpreadTooltip": "Maximum spread (absolute price), NULL means this filter is not enabled. Avoid copying in markets with excessive spreads",
"maxSpreadPlaceholder": "For example: 0.05 (5 cents, optional, leave empty to disable)",
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled. Check depth of first N levels",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders. Enabled: copy both Leader's buy and sell orders; Disabled: only copy Leader's buy orders, ignore sell orders.",
"invalidNumber": "Please enter a valid number"
},
"copyTradingAdd": {
"title": "Add Copy Trading Config",
"back": "Back",
"selectWallet": "Select Wallet",
"selectWalletPlaceholder": "Please select wallet",
"walletRequired": "Please select wallet",
"selectLeader": "Select Leader",
"selectLeaderPlaceholder": "Please select Leader",
"leaderRequired": "Please select Leader",
"enabled": "Enabled Status",
"selectTemplate": "Select Template",
"selectTemplateFromModal": "Fill Config from Template",
"templateFilled": "Template content filled, you can modify",
"basicConfig": "Basic Config",
"copyMode": "Copy Amount Mode",
"copyModeTooltip": "Select the calculation method for copy amount. Ratio mode: copy amount changes proportionally with Leader order size; Fixed amount mode: copy amount remains fixed regardless of Leader order size.",
"ratioMode": "Ratio Mode",
"fixedAmountMode": "Fixed Amount Mode",
"ratio": "Ratio",
"fixed": "Fixed",
"copyRatio": "Copy Ratio",
"copyRatioTooltip": "Copy ratio represents the percentage of copy amount relative to Leader order amount. For example: 100% means 1:1 copy, 50% means half position copy, 200% means double copy",
"copyRatioPlaceholder": "For example: 100 means 100% (1:1 copy), default 100%",
"fixedAmount": "Fixed Copy Amount (USDC)",
"fixedAmountPlaceholder": "Fixed amount, does not change with Leader order size, must be >= 1",
"fixedAmountRequired": "Please enter fixed copy amount",
"fixedAmountMin": "Fixed amount must be >= 1",
"maxOrderSize": "Max Order Size (USDC)",
"maxOrderSizeTooltip": "In ratio mode, limits the maximum amount cap for single copy order",
"maxOrderSizePlaceholder": "Only effective in ratio mode (optional)",
"minOrderSize": "Min Order Size (USDC)",
"minOrderSizeTooltip": "In ratio mode, limits the minimum amount floor for single copy order, must be >= 1",
"minOrderSizePlaceholder": "Only effective in ratio mode, must be >= 1 (optional)",
"minOrderSizeMin": "Minimum amount must be >= 1",
"maxDailyLoss": "Max Daily Loss Limit (USDC)",
"maxDailyLossTooltip": "Limits the maximum daily loss amount, used for risk control",
"maxDailyLossPlaceholder": "Default 10000 USDC (optional)",
"maxDailyOrders": "Max Daily Copy Orders",
"maxDailyOrdersTooltip": "Limits the maximum number of copy orders per day",
"maxDailyOrdersPlaceholder": "Default 100 (optional)",
"priceTolerance": "Price Tolerance (%)",
"priceToleranceTooltip": "Allowed adjustment range for copy price based on Leader price",
"priceTolerancePlaceholder": "Default 5% (optional)",
"delaySeconds": "Copy Delay (seconds)",
"delaySecondsTooltip": "Copy delay time, 0 means copy immediately",
"delaySecondsPlaceholder": "Default 0 (copy immediately)",
"filterConditions": "Filter Conditions (Optional)",
"minOrderDepth": "Min Order Depth (USDC)",
"minOrderDepthTooltip": "Minimum order depth (USDC amount), NULL means this filter is not enabled. Ensures market has sufficient liquidity",
"minOrderDepthPlaceholder": "For example: 100 (optional, leave empty to disable)",
"maxSpread": "Max Spread (Absolute Price)",
"maxSpreadTooltip": "Maximum spread (absolute price), NULL means this filter is not enabled. Avoid copying in markets with excessive spreads",
"maxSpreadPlaceholder": "For example: 0.05 (5 cents, optional, leave empty to disable)",
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled. Check depth of first N levels",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders",
"create": "Create Copy Trading Config",
"createSuccess": "Copy trading config created successfully",
"createFailed": "Failed to create copy trading config",
"invalidNumber": "Please enter a valid number",
"fetchLeaderFailed": "Failed to get Leader list",
"fetchTemplateFailed": "Failed to get template list",
"templateName": "Template Name"
},
"copyTradingEdit": {
"title": "Edit Copy Trading Config",
"back": "Back",
"wallet": "Wallet",
"leader": "Leader",
"selectWallet": "Wallet",
"selectLeader": "Leader",
"basicConfig": "Basic Config",
"copyMode": "Copy Amount Mode",
"copyModeTooltip": "Select the calculation method for copy amount",
"ratioMode": "Ratio Mode",
"fixedAmountMode": "Fixed Amount Mode",
"copyRatio": "Copy Ratio",
"copyRatioTooltip": "Copy ratio represents the percentage of copy amount relative to Leader order amount",
"copyRatioPlaceholder": "For example: 100 means 100% (1:1 copy)",
"fixedAmount": "Fixed Copy Amount (USDC)",
"fixedAmountPlaceholder": "Fixed amount, does not change with Leader order size, must be >= 1",
"fixedAmountRequired": "Please enter fixed copy amount",
"fixedAmountMin": "Fixed amount must be >= 1",
"maxOrderSize": "Max Order Size (USDC)",
"maxOrderSizeTooltip": "In ratio mode, limits the maximum amount cap for single copy order",
"maxOrderSizePlaceholder": "Only effective in ratio mode (optional)",
"minOrderSize": "Min Order Size (USDC)",
"minOrderSizeTooltip": "In ratio mode, limits the minimum amount floor for single copy order, must be >= 1",
"minOrderSizePlaceholder": "Only effective in ratio mode, must be >= 1 (optional)",
"minOrderSizeMin": "Minimum amount must be >= 1",
"maxDailyLoss": "Max Daily Loss Limit (USDC)",
"maxDailyLossTooltip": "Limits the maximum daily loss amount, used for risk control",
"maxDailyLossPlaceholder": "Default 10000 USDC (optional)",
"maxDailyOrders": "Max Daily Copy Orders",
"maxDailyOrdersTooltip": "Limits the maximum number of copy orders per day",
"maxDailyOrdersPlaceholder": "Default 100 (optional)",
"priceTolerance": "Price Tolerance (%)",
"priceToleranceTooltip": "Allowed adjustment range for copy price based on Leader price",
"priceTolerancePlaceholder": "Default 5% (optional)",
"delaySeconds": "Copy Delay (seconds)",
"delaySecondsTooltip": "Copy delay time, 0 means copy immediately",
"delaySecondsPlaceholder": "Default 0 (copy immediately)",
"filterConditions": "Filter Conditions (Optional)",
"minOrderDepth": "Min Order Depth (USDC)",
"minOrderDepthTooltip": "Minimum order depth (USDC amount), NULL means this filter is not enabled",
"minOrderDepthPlaceholder": "For example: 100 (optional, leave empty to disable)",
"maxSpread": "Max Spread (Absolute Price)",
"maxSpreadTooltip": "Maximum spread (absolute price), NULL means this filter is not enabled",
"maxSpreadPlaceholder": "For example: 0.05 (5 cents, optional, leave empty to disable)",
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders",
"save": "Save",
"saveSuccess": "Copy trading config updated successfully",
"saveFailed": "Failed to update copy trading config",
"fetchFailed": "Failed to get copy trading config",
"invalidNumber": "Please enter a valid number"
},
"filteredOrdersList": {
"title": "Filtered Orders List",
"fetchFailed": "Failed to fetch filtered orders list",
"market": "Market",
"outcome": "Outcome",
"price": "Price",
"size": "Size",
"side": "Order Side",
"calculatedQuantity": "Calculated Quantity",
"filterType": "Filter Type",
"filterReason": "Filter Reason",
"createdAt": "Time",
"filterByType": "Filter by Type",
"filterTypes": {
"orderDepth": "Insufficient Order Depth",
"spread": "Spread Too Large",
"orderbookDepth": "Insufficient Orderbook Depth",
"priceValidity": "Invalid Price",
"marketStatus": "Market Not Tradable",
"orderbookError": "Orderbook Fetch Failed",
"orderbookEmpty": "Orderbook Empty",
"unknown": "Unknown Reason"
}
},
"copyTradingList": {
"title": "Copy Trading Config Management",
"addCopyTrading": "Add Copy Trading",
@@ -410,6 +687,9 @@
"account": "Account",
"template": "Template",
"leader": "Leader",
"copyMode": "Copy Mode",
"ratioMode": "Ratio",
"fixedAmountMode": "Fixed",
"enabled": "Enabled",
"disabled": "Disabled",
"totalPnl": "Total P&L",
@@ -419,6 +699,7 @@
"buyOrders": "Buy Orders",
"sellOrders": "Sell Orders",
"matchedOrders": "Matched Orders",
"filteredOrders": "Filtered Orders",
"filterWallet": "Filter Wallet",
"filterTemplate": "Filter Template",
"filterLeader": "Filter Leader",