Commit Graph

1971 Commits

Author SHA1 Message Date
hailin f7cfb4ef8c refactor(frontend): 优化参与记录和贡献值页面的文案显示
参与记录页面(planting_records_page.dart):
- 将状态 "已开始挖矿" 改为 "已开始"
- 将 "xx棵" 改为 "xx个"
- 将 "单棵算力" 改为 "单个算力"

贡献值页面(contribution_page.dart):
- 将贡献值明细中的 "本人种植" 改为 "本人"
- 移除 "已解锁上级" 和 "已解锁下级" 后的 "级" 字后缀

实体类(planting_record.dart):
- 同步更新状态显示文案 "已开始挖矿" → "已开始"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:17:19 -08:00
hailin d957e5a841 feat(admin): 系统账户添加已挖积分股显示和分类账功能
## 后端改动

### mining-service
- 新增 GET /admin/system-accounts/:accountType/records - 获取系统账户挖矿记录(分钟级)
- 新增 GET /admin/system-accounts/:accountType/transactions - 获取系统账户交易记录

### mining-admin-service
- 添加 @nestjs/axios 依赖用于 HTTP 调用
- 修改 SystemAccountsService,通过 HTTP 调用 mining-service 获取挖矿数据(totalMined, availableBalance)
- 新增挖矿记录和交易记录的代理 API

## 前端改动

### 类型定义
- SystemAccount 新增 totalMined, availableBalance, miningContribution, miningLastSyncedAt 字段

### API 层
- 新增 getMiningRecords 和 getTransactions API 方法
- 新增 SystemMiningRecord, SystemTransaction 等类型定义

### Hooks
- 新增 useSystemAccountMiningRecords 和 useSystemAccountTransactions

### 组件
- AccountsTable 新增"已挖积分股"列,显示每个系统账户累计挖到的积分股
- AccountsTable 新增"分类账"按钮,可跳转到账户详情页

### 新页面
- 新建 /system-accounts/[accountType] 详情页面
  - 账户概览卡片:当前算力、已挖积分股、可用余额、挖矿记录数
  - 挖矿记录 Tab:分钟级挖矿明细(时间、算力占比、全网算力、每秒分配量、挖得数量)
  - 交易记录 Tab:所有交易流水(时间、类型、金额、交易前后余额、备注)
  - 支持分页浏览

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 05:53:03 -08:00
hailin 07498271d3 feat(blockchain): 部署 eUSDT 和 fUSDT 代币合约
新增两个 ERC-20 代币合约,部署在 KAVA 主网:

## eUSDT (Energy USDT)
- 合约地址: 0x7C3275D808eFbAE90C06C7E3A9AfDdcAa8563931
- 总供应量: 100.02亿 (10,002,000,000)
- 交易哈希: 0x5bebaa4a35378438ba5c891972024a1766935d2e01397a33502aa99e956a6b19

## fUSDT (Future USDT)
- 合约地址: 0x14dc4f7d3E4197438d058C3D156dd9826A161134
- 总供应量: 1万亿 (1,000,000,000,000)
- 交易哈希: 0x071f535971bc3a134dd26c182b6f05c53f0c3783e91fe6ef471d6c914e4cdb06

## 共同特性
- 固定供应量,不可增发
- 6位小数精度(与USDT一致)
- 标准ERC-20接口
- 部署者: 0x4F7E78d6B7C5FC502Ec7039848690f08c8970F1E

## 文件结构
- eUSDT/: 合约源码、编译脚本、部署脚本、README
- fUSDT/: 合约源码、编译脚本、部署脚本、README
- contracts/README.md: 补充dUSDT说明文档

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 05:30:25 -08:00
hailin 8619b0bf26 feat(frontend): add dark mode support and fix mining records overflow
- Add darkTheme configuration in main.dart with themeModeProvider
- Refactor profile_page.dart to use Theme.of(context).colorScheme for dynamic theming
- Fix mining_records_page.dart layout overflow by using Expanded/Flexible widgets

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 05:06:28 -08:00
hailin 75e74b07c3 refactor(frontend): hide multiplier-related UI elements in asset page
- Comment out '积分股(含倍数)' display
- Comment out '含倍数资产' tag

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:56:07 -08:00
hailin e098cd44f6 refactor(frontend): replace '手机号' with '账号' in send shares page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:54:24 -08:00
hailin 71a9961f94 refactor(frontend): update UI text labels
- Change contribution page subtitle to '股行用户引荐'
- Change receive shares page text from '手机号' to '账号'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:52:38 -08:00
hailin 5ea8d8fea5 docs(frontend): update about page description
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:47:05 -08:00
hailin 1c9bb1aa60 refactor(frontend): rename '团队上级/下级' to '团队上/下贡献值'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:45:15 -08:00
hailin 747e8bfee1 refactor(frontend): replace all '直推' with '引荐'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:43:31 -08:00
hailin 1efe39c6bd refactor(frontend): replace all '认种' with '参与'
- Update terminology across all pages and entities
- Change '认种' to '参与' in user-facing text
- Update comments and documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:39:15 -08:00
hailin e48bf3e81f refactor(frontend): replace all '榴莲' references with '股行'
- Update app name and branding across all pages
- Remove references to '榴莲树' in contribution and adoption contexts
- Update user-facing text in login, register, splash pages
- Update FAQ content in help center and about pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:33:47 -08:00
hailin d9d46065e0 fix(asset): 总资产估值包含积分值余额
总资产估值 = 积分股价值 + 积分值余额
- 积分股价值 = 积分股 × (1 + burnMultiplier) × 价格
- 积分值余额 = 可用积分值 + 冻结积分值

之前只计算了积分股价值,现在加上了积分值(现金)余额。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:26:21 -08:00
hailin d4f7cd834a fix(android): 添加 strings.xml 解决部分手机 app 名称显示问题
某些 Android 手机会从 strings.xml 读取 app 名称而非 AndroidManifest.xml,
导致显示旧名称。通过添加 strings.xml 并引用它来解决兼容性问题。

- 添加 values/strings.xml 定义 app_name
- 添加 values-zh/strings.xml 支持中文系统
- AndroidManifest.xml 改为引用 @string/app_name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:15:18 -08:00
hailin 7df57b9de5 fix(trading): 修复卖出预估计算,加入销毁倍数
卖出预估计算现在使用与后端一致的公式:
- 有效积分股 = 卖出量 × (1 + burnMultiplier)
- 卖出交易额 = 有效积分股 × 价格 × 0.9

修复的位置:
1. _calculateEstimate() 方法 - 预计获得显示
2. _handleTrade() 确认弹窗 - 显示销毁倍数和有效积分股明细

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:10:32 -08:00
hailin 6109bf4584 fix(kong): remove ws/wss protocols from WebSocket route
Kong 会自动处理 HTTP -> WebSocket 升级,route protocols 只需要 http/https

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:36:30 -08:00
hailin 94153058d8 chore(mining-app): remove WebSocket debug logs
移除前端 WebSocket 相关的调试日志

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:34:07 -08:00
hailin c05bcc9a76 feat(trading): 实现10%交易手续费进入积分股池
- 在成交时从卖方收益中扣除10%手续费
- 手续费流入积分股池(greenPoints/200万账户)
- 添加详细分类账记录,包含买卖双方账户和来源标注
- Trade表新增fee字段记录每笔交易的手续费

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:33:40 -08:00
hailin 192e2551bf feat(trading): 资产页面实时价格 WebSocket 推送
## 后端变更
- 添加 @nestjs/websockets, @nestjs/platform-socket.io, socket.io 依赖
- 新增 PriceGateway (price.gateway.ts): WebSocket 网关,namespace /price
- 新增 PriceBroadcastScheduler: 每秒广播价格更新到所有连接的客户端
- 更新 ApiModule 和 ApplicationModule 注册新模块

## Kong API Gateway
- 添加 WebSocket 路由: /ws/price -> trading-service:3022/price
- 支持 ws/wss 协议

## 前端变更
- 添加 socket_io_client 依赖
- 新增 PriceWebSocketService: 带自动断线重连机制的 WebSocket 服务
  - 指数退避重连策略 (1s -> 30s)
  - 最大重连次数 10 次
  - 连接状态流监听
- 资产页面集成 WebSocket:
  - initState 时连接,dispose 时断开
  - 实时更新价格和销毁倍数
  - 保持原有的每秒积分股增长计算

## 调试日志
- 前后端都添加了详细的调试日志方便排查问题
- 日志前缀: [PriceWS], [AssetPage], [PriceGateway], [PriceBroadcastScheduler]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:18:34 -08:00
hailin f6458dd12e fix(trading): 做市商吃单间隔从1-4秒改为固定1秒
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:00:21 -08:00
hailin 533ad3ba82 feat(mining-app): 兑换页面价格改为只读,使用实时价格
- 价格输入框改为只读模式,用户不能修改
- 始终使用后端返回的实时价格
- 价格会随实时刷新自动更新

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 20:56:59 -08:00
hailin cfa3979a97 revert: 恢复资产页面的倍数显示和计算
- 资产显示值恢复为 积分股余额 × (1 + burnMultiplier) × price
- 显示有效积分股(含倍数)而非实际积分股数量
- 实时计算也考虑倍数因子

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 20:46:57 -08:00
hailin 07247fe05f fix: 将划转最小限制从5改为0.01积分股
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 19:29:05 -08:00
hailin dcf413fb72 fix(mining): perSecondEarning只在挖矿激活时返回非零值
- GetMiningAccountQuery 检查 config.isActive 状态
- 挖矿未激活时 perSecondEarning 返回 0
- 前端资产页面定时器会因此停止增长

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 08:32:54 -08:00
hailin b7c8cdd249 fix(trading): 销毁和快照只在交易系统激活时执行
- BurnScheduler 检查 trading_configs.isActive 状态
- 交易系统未激活时跳过每分钟销毁和价格快照
- 交易系统未激活时跳过每小时状态日志

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 08:28:48 -08:00
hailin 096d87e2a8 fix(trading): 区分买方支付和卖方收款金额
问题:executeBuy使用含销毁倍数的tradeAmount,但买方冻结的是原始金额
原因:买方支付=原始数量×价格,卖方收款=有效数量×价格(含销毁)
修复:
- buyerPayAmount = tradeQuantity × price(买方实际支付)
- sellerReceiveAmount = effectiveQuantity × price(卖方实际收款)
- executeBuy 使用 buyerPayAmount
- executeSell 使用 sellerReceiveAmount

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 08:08:58 -08:00
hailin 64b9dcb6c7 fix(trading): 修复订单撮合时buyOrderId为null的问题
问题:在createOrder中调用tryMatch时,传入的order对象没有id
原因:orderRepository.save()返回orderId但没有更新到order对象
解决:保存后重新从数据库获取订单,确保有id再进行撮合

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 07:44:44 -08:00
hailin 2154d5752f fix: 修复K线图NaN错误并添加mining-service划转端点
- 修复K线图当价格范围为0时导致的NaN Offset错误
- 在mining-service添加transfer-out和transfer-in端点
- 划转操作会在mining_transactions表中记录明细

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 07:12:32 -08:00
hailin 4e181354f4 feat(frontend): 添加积分股划转功能
- 交易页面添加划转入口链接
- 实现双向划转弹窗(划入交易账户/划出到挖矿账户)
- 新增划转历史记录页面
- 添加划转相关 API 调用

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 06:57:23 -08:00
hailin 1760f9b82c fix(trading): 为所有 DTO 添加 class-validator 装饰器
修复 trading.controller、admin.controller、transfer.controller
的 DTO 验证问题,解决 App 下单时 400 错误。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 06:14:06 -08:00
hailin dd011c13d4 fix(mining-admin-web): 修复 Kong 网关响应数据解包
在 axios 拦截器中统一处理 Kong 网关的数据包装层,
解决做市商配置页面初始化后界面不刷新的问题。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 05:55:06 -08:00
hailin edd6ced2a3 fix(trading): 为做市商 DTO 添加 class-validator 装饰器
修复做市商初始化失败问题。由于 ValidationPipe 配置了
forbidNonWhitelisted: true,没有装饰器的属性会被拒绝。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 05:47:03 -08:00
hailin 4bb5a2b09d refactor(frontend): 资产页面显示实际积分股和价格,移除倍数
- 资产显示值改为 积分股余额 × price(不含倍数)
- 显示实际积分股数量而非含倍数的有效积分股
- 简化实时计算逻辑

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:28:30 -08:00
hailin 8319fe5e9a fix(mining-admin): 修复 MiningConfigUpdated 事件缺少 minuteDistribution 字段
mining-service 发布的事件中只有 secondDistribution,CDC 同步时需要
计算 minuteDistribution = secondDistribution * 60

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:08:04 -08:00
hailin 7bc911d4d7 feat(mining): 实现手工补发挖矿功能
为从1.0系统同步的用户提供手工补发历史挖矿收益功能:

- mining-service: 添加 ManualMiningRecord 表和计算/执行补发逻辑
- mining-wallet-service: 添加 MANUAL_MINING_REWARD 交易类型和 Kafka 消费者
- mining-admin-service: 添加补发 API 控制器和代理服务
- mining-admin-web: 添加手工补发页面和侧边栏菜单项

功能特点:
- 根据用户算力和当前挖矿配置计算补发金额
- 每个用户只能执行一次补发操作
- 通过 Kafka 事件确保跨服务数据一致性
- 完整的操作记录和钱包同步状态追踪

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 03:50:03 -08:00
hailin 4a4393f995 fix(frontend): 修复资产页面实时增长计算漏乘burnMultiplier
资产每秒增长公式应为: 每秒积分股增长 × (1 + burnMultiplier) × price
之前漏掉了 (1 + burnMultiplier) 因子,导致增长被低估约5000倍

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 03:42:21 -08:00
hailin 5a719eef61 fix(trading): 合并销毁和快照任务确保K线价格正确
将 executeMinuteBurn 和 createPriceSnapshot 合并为单个 cron 任务,
确保快照在销毁完成后创建,避免K线出现价格不变的间隔

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 23:26:04 -08:00
hailin b826511f3c chore(frontend): 移除资产页面调试日志
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 23:16:15 -08:00
hailin 4eb466230e fix(mining): 修复 ShareAmount 类型调用方式
使用 .value.toNumber() 而非 .toNumber()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:59:44 -08:00
hailin 4f1f1f9eaf feat(mining): 添加 perSecondEarning 到挖矿账户 API
- 后端:计算每秒收益 = (用户贡献 / 全网贡献) × 每秒分配量
- 前端:修正字段映射以匹配后端返回格式

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:56:19 -08:00
hailin 33233901a9 debug(frontend): 添加资产页面定时器调试日志
添加 debugPrint 日志帮助定位1秒刷新不生效的问题

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:49:46 -08:00
hailin d8dd38e91b fix(frontend): 修复资产页面1秒实时刷新问题
- 使用 mining-service 的 perSecondEarning 替代 assetGrowthPerSecond
- 添加 _timerStarted 标志防止定时器重复启动
- 修复页面进入时定时器可能未启动的问题
- 下拉刷新时同步刷新 shareAccountProvider
- 正确显示每秒增长值

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:42:23 -08:00
hailin 5c633b9979 perf(frontend): 优化交易页面数据刷新策略
- 价格刷新: 5分钟 → 15秒
- 订单刷新: 2分钟 → 10秒
- 市场概览: 5分钟 → 30秒
- 交易账户: 2分钟 → 15秒
- 交易成功后立即刷新 + 2秒后再刷新 + 5秒后最终刷新
- 确保用户能快速看到做市商吃单后的成交状态

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:14:52 -08:00
hailin b1fedd417f fix(trading): 修复 migration 执行顺序问题
将 0003_add_market_maker_depth 重命名为 0006_add_market_maker_depth,
确保在 0005_add_market_maker_and_order_source 创建 market_maker_configs 表
之后再执行添加深度字段的 migration。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:59:06 -08:00
hailin 3265ee2506 feat(trading): 将初始绿积分从5760调整为57.6亿
## 变更说明

将积分股池的初始绿积分从 5760 调整为 5,760,000,000 (57.6亿)

### 价格影响

- 初始价格:5760 / 100.02亿 ≈ 5.76×10⁻⁷ → 57.6亿 / 100.02亿 ≈ 0.576
- 价格从极小数值变为正常交易数值
- 更符合实际交易习惯

### 技术评估

- 数据库精度 Decimal(30,8) 完全足够
- 价格公式线性放大,逻辑不变
- 销毁倍数公式不涉及 greenPoints,不受影响
- "越卖越涨"机制保持不变

### 修改文件

- prisma/seed.ts: 初始化种子数据
- burn.service.ts: 运行时初始化逻辑

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:50:43 -08:00
hailin 8c78f26e6d feat(trading): 实现做市商吃单/挂单模式互斥机制
## 后端 - trading-service

### MarketMakerService
- 新增 MarketMakerMode 类型:'idle' | 'taker' | 'maker'
- 新增 getCurrentMode() 和 getRunningStatus() 方法获取当前运行状态
- start() (吃单模式): 启动前自动停止挂单模式
- startMaker() (挂单模式): 启动前自动停止吃单模式
- 两种模式互斥,同一时间只能运行一种

### MarketMakerController
- getConfig 接口返回 runningStatus 运行状态
- 新增 GET /status 接口获取做市商运行状态

## 前端 - mining-admin-web

### 做市商管理页面
- 新增运行模式状态卡片,显示当前模式(空闲/吃单/挂单)
- 吃单模式和挂单模式使用 runningStatus 判断状态
- 添加互斥提示:启动一个模式会自动停止另一个
- 挂单模式添加警告提示:卖单被吃会触发销毁导致价格上涨

### API 更新
- 新增 RunningStatus 接口类型
- getConfig 返回类型增加 runningStatus
- 新增 getRunningStatus API

## 设计说明
- 吃单模式(推荐):做市商只作为买方,不触发额外销毁
- 挂单模式(谨慎使用):做市商挂卖单会触发销毁机制

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:41:39 -08:00
hailin 3b6bd29283 feat(trading): 实现完整的CEX做市商双边深度系统
## 后端 - trading-service

### 数据库模型扩展 (Prisma Schema)
- TradingConfig: 新增 depthEnabled 字段控制深度显示开关
- MarketMakerConfig: 新增双边挂单配置
  - makerEnabled: 做市商挂单模式开关
  - bidEnabled/askEnabled: 买/卖方向独立开关
  - bidLevels/askLevels: 买/卖档位数量
  - bidSpread/askSpread: 买/卖价差比例
  - bidLevelSpacing/askLevelSpacing: 档位间距
  - bidQuantityPerLevel/askQuantityPerLevel: 每档数量
  - refreshIntervalMs: 刷新间隔
- MarketMakerOrder: 新增做市商订单追踪模型
- MarketMakerLedger: 新增做市商账户流水模型

### 做市商服务 (MarketMakerService)
- depositShares/withdrawShares: 积分股充值/提现
- startMaker/stopMaker: 做市商挂单模式启停
- refreshMakerOrders: 核心双边挂单逻辑
  - 根据当前价格计算买卖各档位价格和数量
  - 自动撤销旧订单并创建新订单
  - 记录做市商订单关联
- cancelAllMakerOrders: 撤销所有做市商订单
- getDepth: 获取订单簿深度数据
- updateMakerConfig/getMakerOrders: 配置和订单查询

### API 端点
- MarketMakerController:
  - POST /deposit-shares: 积分股充值
  - POST /withdraw-shares: 积分股提现
  - POST /start-maker: 启动挂单模式
  - POST /stop-maker: 停止挂单模式
  - POST /refresh-orders: 手动刷新订单
  - POST /cancel-all-orders: 撤销所有订单
  - PUT /maker-config: 更新挂单配置
  - GET /maker-orders: 查询做市商订单
  - GET /depth: 获取深度数据
- AdminController:
  - GET/POST /trading/depth-enabled: 深度显示开关
- PriceController:
  - GET /depth: 公开深度接口 (受 depthEnabled 控制)

### 领域层扩展
- TradingAccountAggregate: 新增 depositShares/withdrawShares 方法
- OrderAggregate: 支持 source 字段标识订单来源

## 前端 - mining-admin-web

### 做市商管理页面 (/market-maker)
- 账户余额展示: 积分值和积分股余额
- 资金管理: 积分值/积分股的充值和提现对话框
- 吃单模式: 启动/停止/手动吃单控制
- 挂单模式: 启动/停止/刷新订单/撤销所有
- 深度开关: 控制公开 API 是否返回深度数据
- 深度展示: 实时显示买卖盘深度数据表格

### 前端架构
- market-maker.api.ts: 完整的 API 客户端
- use-market-maker.ts: React Query hooks 封装
- sidebar.tsx: 新增"做市商管理"导航菜单

## 数据库迁移
- 0003_add_market_maker_depth: 双边深度相关字段
- 0005_add_market_maker_and_order_source: 订单来源追踪

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:11:23 -08:00
hailin 416495a398 fix(mining): correctly parse network-progress API response
The API returns {success: true, data: {...}} but code was accessing
progressResult.currentContributionPerTree directly instead of
progressResult.data.currentContributionPerTree.

This caused:
- totalTreeCount to be 0 (undefined → 0)
- networkTotalContribution to be 0
- No mining distributions happening

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 09:46:25 -08:00
hailin 11ff3cc9bd fix: correct totalShares and distributionPool values
- totalShares: 100020000000 → 10002000000 (100.02亿 = 100亿 + 200万)
- distributionPool: 200000000 → 2000000 (200万)

Fixed in:
- trading-service/prisma/schema.prisma
- trading-service/prisma/migrations/0002_add_trading_burn_system/migration.sql
- mining-service/.env.example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 09:01:17 -08:00
hailin 481a355d72 feat(trading): add buy function control switch with admin management
- Add buyEnabled field to TradingConfig in trading-service with migration
- Add API endpoints for get/set buy enabled status in admin controller
- Add buy function switch card in mining-admin-web trading page
- Implement buyEnabledProvider in mining-app with 2-minute cache
- Show "待开启" when buy function is disabled in trading page
- Add real-time asset value refresh in asset page (1-second updates)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 08:56:35 -08:00