rwadurian/backend/services/trading-service
hailin 8980a169ed fix(trading): 修复做市商吃单扣款金额错误(使用交易总额而非原始数量×价格)
问题:
  做市商吃单时,buyerPayAmount = tradeQuantity × price(原始数量×价格),
  未计入销毁倍数。例如:卖出 697.81 积分股,销毁倍数 5000.88,
  交易总额 = 17,615.96 积分值,但做市商只被扣了 697.81 × 0.005 = 3.49。
  10% 手续费(1,761.60)反而大于做市商支出,导致做市商不减反增。

修复:
  - 做市商吃单时:actualBuyerCost = sellerGrossAmount(含销毁倍数的交易总额)
  - 普通用户买入时:actualBuyerCost = buyerPayAmount(原始数量×价格,不变)
  - frozenCash 仍释放下单时冻结的原始金额(buyerPayAmount)
  - 做市商交易流水记录 assetType=CASH + 实际支付金额

做市商吃单扣款计算(修复后):
  MM 支出 = sellerGrossAmount(交易总额)
  MM 手续费收入 = tradeFee(10%)
  MM 净支出 = sellerReceiveAmount = 交易总额 × 90%

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 05:56:12 -08:00
..
prisma fix(trading): 修复迁移表名 MarketMakerConfig → market_maker_configs 2026-02-03 03:50:52 -08:00
src fix(trading): 修复做市商吃单扣款金额错误(使用交易总额而非原始数量×价格) 2026-02-03 05:56:12 -08:00
.env.example feat(mining-ecosystem): 添加挖矿生态系统完整微服务与前端 2026-01-10 17:45:46 -08:00
DEVELOPMENT_GUIDE.md feat(mining-ecosystem): 添加挖矿生态系统完整微服务与前端 2026-01-10 17:45:46 -08:00
Dockerfile fix(c2c-bot): 安装中文字体解决水单图片乱码问题 2026-02-02 18:56:55 -08:00
nest-cli.json feat(mining-ecosystem): 添加挖矿生态系统完整微服务与前端 2026-01-10 17:45:46 -08:00
package-lock.json feat(c2c-bot): 顺序处理订单 + 自动生成付款水单图片 2026-02-02 18:32:52 -08:00
package.json feat(c2c-bot): 顺序处理订单 + 自动生成付款水单图片 2026-02-02 18:32:52 -08:00
tsconfig.json fix(trading-service): exclude prisma from tsconfig to fix build output path 2026-01-15 04:46:01 -08:00