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>
This commit is contained in:
parent
8c78f26e6d
commit
3265ee2506
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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亿)`);
|
||||
}
|
||||
|
||||
// 初始化流通池
|
||||
|
|
|
|||
Loading…
Reference in New Issue