Stage 7.2: manipulation detection (player price push, prediction/perp forfeits)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
002606056d
commit
786de325da
11 files changed
+99
-8
No files matched your search
@@ -21,6 +21,15 @@ namespace Decentralized.Domain
|
||||
public List<Pool> Pools = new List<Pool>();
|
||||
/// <summary>开门时的参考价,夜间用它和收盘价算当日均价(合约的标记价)。</summary>
|
||||
public double OpenPrice = Tuning.PscStartPrice;
|
||||
/// <summary>玩家自己的现货大单把价格推高(正)或压低(负)的对数幅度,每晚随价格回归一起衰减。操纵检出和预测盘用它估"没有玩家时的价格"。</summary>
|
||||
public double PlayerPush;
|
||||
public double NeutralPrice => Price * Math.Exp(-PlayerPush);
|
||||
/// <summary>被查概率:推价幅度(绝对值)超过 ManipFree 后随幅度升高。</summary>
|
||||
public static double ManipChance(double push)
|
||||
{
|
||||
push = Math.Abs(push);
|
||||
return push < Tuning.ManipFree ? 0 : Math.Min(Tuning.ManipMax, Tuning.ManipBase + Tuning.ManipSlope * (push - Tuning.ManipFree));
|
||||
}
|
||||
|
||||
public const double ArbRate = Tuning.SideArbRate; // 非主交易对每晚被拉回参考价的比例
|
||||
public const double SideDepthShare = Tuning.SideDepthShare; // 非主交易对的深度占主交易对的比例
|
||||
@@ -104,6 +113,7 @@ namespace Decentralized.Domain
|
||||
/// </summary>
|
||||
public void Night(ICollection<MarketEvent> active, Rng rng, int day, Func<string, double> stablePrice)
|
||||
{
|
||||
PlayerPush *= 1 - Tuning.Revert;
|
||||
Sentiment *= Math.Exp(Tuning.SentimentKappa * -Math.Log(Sentiment) + rng.Gauss() * Tuning.SentimentVol);
|
||||
double anchor = Anchor(active);
|
||||
double lp = Math.Log(Price);
|
||||
|
||||
Reference in new issue
Block a user