From 3265ee25069e9adaeac3d00b0b174910a65e42f6 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 17 Jan 2026 21:50:43 -0800 Subject: [PATCH] =?UTF-8?q?feat(trading):=20=E5=B0=86=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E7=BB=BF=E7=A7=AF=E5=88=86=E4=BB=8E5760=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=BA57.6=E4=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 变更说明 将积分股池的初始绿积分从 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 --- backend/services/trading-service/prisma/seed.ts | 8 +++++--- .../src/application/services/burn.service.ts | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/backend/services/trading-service/prisma/seed.ts b/backend/services/trading-service/prisma/seed.ts index e925a554..5a2d1127 100644 --- a/backend/services/trading-service/prisma/seed.ts +++ b/backend/services/trading-service/prisma/seed.ts @@ -94,16 +94,18 @@ async function main() { } // 4. 初始化积分股池(绿积分池) + // 初始绿积分为 57.6亿,使初始价格约为 0.576 (57.6亿 / 100.02亿 ≈ 0.576) + const INITIAL_GREEN_POINTS = '5760000000'; // 57.6亿 const existingSharePool = await prisma.sharePool.findFirst(); if (!existingSharePool) { await prisma.sharePool.create({ data: { - greenPoints: new Decimal(5760), // 初始绿积分为 5760 - totalInflow: new Decimal(5760), + greenPoints: new Decimal(INITIAL_GREEN_POINTS), + totalInflow: new Decimal(INITIAL_GREEN_POINTS), totalOutflow: new Decimal(0), }, }); - console.log('Created share pool with initial green points: 5760'); + console.log(`Created share pool with initial green points: ${INITIAL_GREEN_POINTS} (57.6亿)`); } else { console.log('Share pool already exists'); } diff --git a/backend/services/trading-service/src/application/services/burn.service.ts b/backend/services/trading-service/src/application/services/burn.service.ts index f9be7672..1eacd63d 100644 --- a/backend/services/trading-service/src/application/services/burn.service.ts +++ b/backend/services/trading-service/src/application/services/burn.service.ts @@ -263,11 +263,12 @@ export class BurnService { this.logger.log('Black hole initialized'); } - // 初始化积分股池(绿积分池),初始值 5760 + // 初始化积分股池(绿积分池),初始值 57.6亿 + // 使初始价格约为 0.576 (57.6亿 / 100.02亿 ≈ 0.576) if (!existingSharePool) { - const initialGreenPoints = new Money(5760); + const initialGreenPoints = new Money('5760000000'); // 57.6亿 await this.sharePoolRepository.initializePool(initialGreenPoints); - this.logger.log(`Share pool initialized with ${initialGreenPoints.toFixed(8)} green points`); + this.logger.log(`Share pool initialized with ${initialGreenPoints.toFixed(8)} green points (57.6亿)`); } // 初始化流通池