实测修正:交易对行去掉交易所名、互换损耗两位小数、读档时 DEX 侧池按新深度重设

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Opus 5.5 committed 2026-11-07 23:28:41 +08:00
1 parent fe82395d32
commit 709339b00c
5 files changed
+13 -10

No files matched your search

+6 -4
View File
@@ -82,14 +82,16 @@ namespace Decentralized.Domain
public Pool Main => Pools[0];
/// <summary>旧存档的稳定币对是恒定乘积池:按当前价换成 StableSwap 池。</summary>
public void UpgradeStablePools(int day)
/// <summary>旧存档:稳定币对是恒定乘积池,按当前价换成 StableSwap 池;其他 DEX 池按新深度重设(不等到夜里)。</summary>
public void UpgradeDexPools(int day)
{
for (int i = 0; i < Pools.Count; i++)
{
var p = Pools[i];
if (p.Venue != Venue.Dex || p.Stable || (p.Base != Assets.CRT && p.Base != Assets.CRA)) continue;
Pools[i] = Pool.CreateStable(Venue.Dex, p.Base, p.Quote, p.Price, Tuning.PoolDepth(day) * SideDepthShare, Tuning.StableFee, Tuning.StableAmp);
if (p.Venue != Venue.Dex || p.Stable) continue;
if (p.Base == Assets.CRT || p.Base == Assets.CRA)
Pools[i] = Pool.CreateStable(Venue.Dex, p.Base, p.Quote, p.Price, Tuning.PoolDepth(day) * SideDepthShare, Tuning.StableFee, Tuning.StableAmp);
else p.SetPrice(p.Price, Tuning.PoolDepth(day) * DepthShare(p));
}
}