现货深度、保险基金、爆仓新闻、预测盘流动性、收黑币、赃物污点、升级降价

- 主池深度 50,000 → 600,000,现货与出金手续费 0.1%;永续成交深度单独计算,滑点不变
- Poinbase 现货买卖都按标的币数量输入,显示手续费,滑点不含手续费
- 保险基金初值 200,000,NPC 按概率爆仓(剩余保证金进基金)或穿仓(基金垫付)
- 单日涨跌 15% 以上上报纸:全网爆仓人数和金额(含玩家)
- 预测盘流动性与先验脱钩,份额上限按单盘额度,手续费 1%;查处概率、消息价相应上调
- 收黑币:事件期间上门折价出手 CRT / PSC,兑换处开放后有 Ponero;便衣
- 灰网出售赃物按热度带污点
- 混币器 300、黑市 600
- 存档数据版本 2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Opus 5.5 committed 2026-11-07 22:24:36 +08:00
1 parent 68eca64944
commit f0bbba2305
23 files changed
+603 -98

No files matched your search

+8
View File
@@ -36,6 +36,14 @@ namespace Decentralized.Domain
return BaseReserve - BaseReserve * QuoteReserve / y;
}
/// <summary>预估:买到 baseOut 个 Base 要付多少 Quote(含手续费,不改池子);超出池子储备返回 +∞。</summary>
public double QuoteIn(double baseOut)
{
if (baseOut <= 0) return 0;
if (baseOut >= BaseReserve) return double.PositiveInfinity;
return (BaseReserve * QuoteReserve / (BaseReserve - baseOut) - QuoteReserve) / (1 - Fee);
}
/// <summary>卖出 Base,返回得到的 Quote。手续费留在池里。</summary>
public double SellBase(double baseIn)
{
+7 -4
View File
@@ -24,6 +24,8 @@ namespace Decentralized.Domain
/// <summary>成交后扣掉抽成的货款(信用点)与其中带的污点。</summary>
public int Proceeds;
public double Taint;
/// <summary>上架那件货的赃物热度(0–100):赃物的货款按"货款 × 热度%"带污点,不走随机。</summary>
public double Heat;
/// <summary>成交那一轮的收款币(空 = CRT,旧存档):货款到期后以这个币付给钱包。</summary>
public string PayAsset;
/// <summary>终态原因:fake(买家看穿假卡退货)/ rug / delist。</summary>
@@ -102,8 +104,8 @@ namespace Decentralized.Domain
public static int ListPriceOf(long refValue, double m) => (int)Math.Max(1, Math.Round(refValue * m));
public static int ListFee(int listPrice) => (int)Math.Ceiling(listPrice * Tuning.BmListFee);
/// <summary>上架:交付一件货,收上架费(付给 feeAsset 币,污点与成本按比例带走)。倍率超出范围、平台关闭或余额不足返回 null。</summary>
public BmSale List(string item, string model, string fakeOf, double health, long refValue, double m, Wallet w, string feeAsset, int day, Func<string, double> price)
/// <summary>上架:交付一件货,收上架费(付给 feeAsset 币,污点与成本按比例带走)。heat 是这件货的赃物热度(0–100)。倍率超出范围、平台关闭或余额不足返回 null。</summary>
public BmSale List(string item, string model, string fakeOf, double health, long refValue, double m, Wallet w, string feeAsset, int day, Func<string, double> price, double heat = 0)
{
if (m < Tuning.BmSellMin - 1e-9 || m > Tuning.BmSellMax + 1e-9 || refValue <= 0 || Closed(day) || feeAsset == Assets.CRC || ListBlock(BmSale.KeyOf(item, model, fakeOf, health), m) != null) return null;
int listPrice = ListPriceOf(refValue, m);
@@ -115,7 +117,7 @@ namespace Decentralized.Domain
double share = total > 0 ? Math.Min(1, ListFee(listPrice) / total) : 0;
w.Taint -= w.Taint * share; w.Basis -= w.Basis * share;
w.Add(feeAsset, -qty);
var s = new BmSale { Item = item, Model = model, FakeOf = fakeOf, Health = health, Ref = refValue, Mult = m, ListPrice = listPrice, ListedDay = day, Wallet = w.Address };
var s = new BmSale { Item = item, Model = model, FakeOf = fakeOf, Health = health, Ref = refValue, Mult = m, ListPrice = listPrice, ListedDay = day, Wallet = w.Address, Heat = Math.Max(0, Math.Min(100, heat)) };
Sales.Add(s);
return s;
}
@@ -148,7 +150,8 @@ namespace Decentralized.Domain
s.State = SaleState.Sold;
s.Proceeds = (int)Math.Round(s.ListPrice * (1 - Tuning.BmCommission));
double vb = VolumeTaint(day);
s.Taint = rng.Chance(Math.Min(1, TaintChance(s.Mult) + vb)) ? s.Proceeds * Math.Min(1, TaintRatio(s.Mult) + vb) : 0;
s.Taint = s.Heat > 0 ? s.Proceeds * s.Heat / 100
: rng.Chance(Math.Min(1, TaintChance(s.Mult) + vb)) ? s.Proceeds * Math.Min(1, TaintRatio(s.Mult) + vb) : 0;
s.PayDay = day + Tuning.BmSaleHold;
Rating = Math.Min(100, Rating + 1);
if (Honeypot(day)) Traps.Add(new BmTrap { Day = day + Tuning.BmTrapDelay, Amount = s.Proceeds, Why = "honeypot", Item = s.Item, Group = HoneypotStart });
+55
View File
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
namespace Decentralized.Domain
{
/// <summary>一笔黑币报价:卖家手里的币、按现价的市值和他要的现金。Sting 是钓鱼执法(收下就记罪证,币不会到)。</summary>
public sealed class HotOffer
{
public string Asset;
public double Qty, Value;
public int Cash;
public bool Sting;
}
/// <summary>
/// 收黑币:游戏里出了事,手里有来路不明的币的人上门,折价换现金。
/// 帮派火并、镇压期间黑市的人出手 CRT;革命军袭击上层、下层动荡期间有人出手抢来的 PSC;黑市声望够了以后偶尔有人出手勒索得来的 Ponero。
/// PSC、CRT 链上可追,收下的币按市值全额带污点;Ponero 不可追、不带污点,折扣也小,出口只有 Ponero 兑换处。
/// </summary>
public static class HotCoins
{
/// <summary>今天哪种黑币可能有人上门(按游戏当前的事件),没有返回 null。poneroOpen:Ponero 兑换处已开放。</summary>
public static string Pick(ICollection<MarketEvent> active, bool poneroOpen, Rng rng)
{
var c = new List<string>();
if (active.Contains(MarketEvent.GangWar) || active.Contains(MarketEvent.Crackdown)) c.Add(Assets.CRT);
if (active.Contains(MarketEvent.RevRaidUpper) || active.Contains(MarketEvent.LowerUnrest)) c.Add(Assets.PSC);
if (c.Count > 0 && rng.Chance(Tuning.HotEventChance)) return c[rng.Range(0, c.Count - 1)];
if (poneroOpen && rng.Chance(Tuning.HotPoneroChance)) return Assets.Ponero;
return null;
}
/// <summary>开价:市值 = 房租 × 区间,现金要价 = 市值 × 折扣(Ponero 折扣小)。crackdown:镇压期间钓鱼执法更多。</summary>
public static HotOffer Make(string asset, double coinPrice, double rent, bool crackdown, Rng rng)
{
if (coinPrice <= 0 || rent <= 0) return null;
double value = rent * rng.Range(Tuning.HotValueMinRents, Tuning.HotValueMaxRents);
bool ponero = asset == Assets.Ponero;
double cut = ponero ? rng.Range(Tuning.HotPoneroCutMin, Tuning.HotPoneroCutMax) : rng.Range(Tuning.HotCutMin, Tuning.HotCutMax);
return new HotOffer
{
Asset = asset, Qty = value / coinPrice, Value = value, Cash = (int)Math.Round(value * cut),
Sting = rng.Chance(Tuning.HotSting + (crackdown ? Tuning.HotStingCrackdown : 0)),
};
}
/// <summary>收下:币进钱包,成本是付出的现金;PSC、CRT 按市值记污点,Ponero 不记。钓鱼执法不在这里处理。</summary>
public static void Receive(Wallet w, HotOffer o)
{
w.Add(o.Asset, o.Qty);
w.Basis += o.Cash;
if (o.Asset != Assets.Ponero) w.Taint += o.Value;
}
}
}
+2 -2
View File
@@ -156,11 +156,11 @@ namespace Decentralized.Domain
OpenPrice = p;
}
/// <summary>NPC 大户:每周约 2 笔、每笔 2,000–8,000 信用点,随机买或卖。返回成交额(正为买入),没有交易时为 0。</summary>
/// <summary>NPC 大户:每周约 2 笔、每笔 <see cref="Tuning.WhaleMin"/>–<see cref="Tuning.WhaleMax"/> 信用点,随机买或卖。返回成交额(正为买入),没有交易时为 0。</summary>
public double Whale(Rng rng)
{
if (!rng.Chance(2.0 / 7)) return 0;
double size = rng.Range(2000.0, 8000.0);
double size = rng.Range(Tuning.WhaleMin, Tuning.WhaleMax);
if (rng.Chance(0.5)) { Main.BuyBase(size); return size; }
Main.SellBase(size / Price);
return -size;
+33 -11
View File
@@ -27,16 +27,19 @@ namespace Decentralized.Domain
/// <summary>夜间发生的事:强平、自动减仓、催收没收、核销。</summary>
public sealed class PerpEvent
{
public string Kind; // liq / adl / seize / writeoff / interest
public string Kind; // liq / adl / seize / writeoff / interest / wipe
public string Product;
public bool Long;
public double Amount; // 损失、减记、或欠款(信用点)
public double Amount; // 损失、减记、或欠款(信用点);wipe 是全网爆仓的名义价值(含玩家)
public int Count; // wipe:爆仓人数(含玩家)
public double Move; // wipe:标记价的涨跌幅
}
/// <summary>
/// Poinbase 永续合约(PSC-PERP、SPARK-PERP):保证金用 Poinbase 账户里的 CRC,一个品种一个净仓位。
/// 标记价是当日均价,强平只在夜间检查(白天插针不触发)。强平后的剩余权益进保险基金,权益为负先由基金垫付,
/// 基金不够的缺口记成玩家的欠款;NPC 在大行情里穿仓会消耗基金,基金见底时盈利的仓位被自动减仓(盈利打折)。
/// 基金不够的缺口记成玩家的欠款。NPC 仓位随行情爆仓:大部分正常爆仓,剩余保证金进基金;行情越快穿仓越多,缺口由基金垫付。
/// 基金见底时盈利的仓位被自动减仓(盈利打折)。
/// 欠款每天计息,每晚先用账户里的 CRC 还;逾期没还清由接入层没收物品抵债,剩下的核销并拉黑永续账户一段时间。
/// </summary>
public sealed class PerpBook
@@ -49,13 +52,13 @@ namespace Decentralized.Domain
public Dictionary<string, double> Funding = new Dictionary<string, double>();
/// <summary>资金费系数(费率 = 系数 × 标记价偏离 7 日均价的比例)。默认取配置,模拟里用来校准。</summary>
public double FundCoef = Tuning.PerpFundCoef;
/// <summary>成交深度倍数(滑点 = 名义价值 / (倍数 × 池深)),模拟里用来校准。</summary>
/// <summary>成交深度倍数(滑点 = 名义价值 / (倍数 × 永续深度)),模拟里用来校准。</summary>
public double DepthMult = Tuning.PerpDepthMult;
/// <summary>成交价:买入(开多、平空)往上滑,卖出往下滑,滑点随名义价值占现货池深的比例增大,封顶 50%。</summary>
/// <summary>成交价:买入(开多、平空)往上滑,卖出往下滑,滑点随名义价值占永续深度的比例增大,封顶 50%。</summary>
public double Exec(double price, double notional, bool buy, int day)
{
double slip = Math.Min(0.5, notional / (DepthMult * Tuning.PoolDepth(day)));
double slip = Math.Min(0.5, notional / (DepthMult * Tuning.PerpDepth(day)));
return price * (1 + (buy ? slip : -slip));
}
@@ -151,12 +154,28 @@ namespace Decentralized.Domain
}
/// <summary>
/// 夜间结算。marks:各品种今天的标记价(日均价)。顺序:资金费 → NPC 穿仓消耗基金 → 强平 → 基金见底时自动减仓盈利仓位 →
/// 欠款计息并用账户 CRC 偿还 → 逾期的触发没收。
/// NPC 仓位在一晚涨跌幅 move 下对保险基金的净流入(可为负),以及爆仓的名义价值。oi 是亏损一侧的持仓。
/// 爆仓量 = oi × min(1, move / PerpNpcLiqScale);其中穿仓的比例随涨跌幅升高,正常爆仓交出剩余保证金,穿仓的缺口由基金垫付。
/// </summary>
public static double NpcFlow(double move, double oi, out double liquidated)
{
move = Math.Abs(move);
liquidated = oi * Math.Min(1, move / Tuning.PerpNpcLiqScale);
double bank = Math.Min(Tuning.PerpNpcBankMax, Tuning.PerpNpcBankBase + Tuning.PerpNpcBankSlope * Math.Max(0, move - Tuning.PerpNpcBankFree));
return liquidated * ((1 - bank) * Tuning.PerpNpcLeft - bank * move * Tuning.PerpNpcGap);
}
/// <summary>NPC 在某个品种上单边的持仓(信用点名义价值)。</summary>
public static double NpcOi(string product, int day) => Tuning.PerpNpcOi * Tuning.PoolDepth(day) * (product == "SPARK" ? Tuning.SparkDepthShare : 1);
/// <summary>
/// 夜间结算。marks:各品种今天的标记价(日均价)。顺序:资金费 → NPC 爆仓与穿仓进出基金 → 强平 → 基金见底时自动减仓盈利仓位 →
/// 欠款计息并用账户 CRC 偿还 → 逾期的触发没收。标记价涨跌达到 <see cref="Tuning.PerpNewsMove"/> 的品种另记一条 wipe(全网爆仓,含玩家)。
/// </summary>
public List<PerpEvent> Night(int day, IDictionary<string, double> marks, Wallet acct, Func<string, double> pr)
{
var evs = new List<PerpEvent>();
var wipes = new Dictionary<string, PerpEvent>();
bool adl = false;
foreach (var kv in marks)
{
@@ -169,9 +188,10 @@ namespace Decentralized.Domain
hist.Add(mark); if (hist.Count > 7) hist.RemoveAt(0);
var pos = Of(product);
if (pos != null) pos.Margin -= (pos.Long ? 1 : -1) * rate * pos.Notional(mark);
double ret = prev > 0 ? Math.Abs(mark / prev - 1) : 0;
double shock = Math.Max(0, (ret - Tuning.PerpShockFree) / Tuning.PerpShockFree);
InsuranceFund += Tuning.PerpFundDrift - Tuning.PerpFundShock * shock * shock;
double ret = prev > 0 ? mark / prev - 1 : 0;
InsuranceFund += NpcFlow(ret, NpcOi(product, day), out double liq);
if (Math.Abs(ret) >= Tuning.PerpNewsMove)
wipes[product] = new PerpEvent { Kind = "wipe", Product = product, Long = ret < 0, Amount = liq, Count = (int)Math.Round(liq / Tuning.PerpNpcAvgPos), Move = ret };
}
if (InsuranceFund < 0) { InsuranceFund = 0; adl = true; }
foreach (var pos in Positions.ToList())
@@ -183,7 +203,9 @@ namespace Decentralized.Domain
double rem = eq - Tuning.PerpLiqFee * notional;
if (rem >= 0) InsuranceFund += rem; else Cover(-rem, day);
evs.Add(new PerpEvent { Kind = "liq", Product = pos.Product, Long = pos.Long, Amount = pos.Margin });
if (wipes.TryGetValue(pos.Product, out var wp) && wp.Long == pos.Long) { wp.Amount += notional; wp.Count++; }
}
evs.AddRange(wipes.Values);
if (adl)
foreach (var pos in Positions.ToList())
{
+11 -8
View File
@@ -10,7 +10,8 @@ namespace Decentralized.Domain
/// <summary>
/// 一个盘口:问一个是非题,开盘当天可以买卖,窗口(FromDay..ToDay)里的结果由游戏或本 mod 的数值决定,ToDay 夜间结算。
/// 定价用 LMSR:初始价等于先验概率 P0,系统在单盘的最大亏损固定(<see cref="MaxLoss"/>),流动性参数 B 由它反推。
/// 定价用 LMSR:初始价等于先验概率 P0,流动性参数 B 按开盘日的单盘额度(<see cref="Budget"/>)定,与先验无关;
/// 额度决定份额上限(限制内幕单能赚多少)和内幕消息的价格。
/// </summary>
public sealed class PredictMarket
{
@@ -22,13 +23,15 @@ namespace Decentralized.Domain
public double Param;
public int OpenDay, FromDay, ToDay;
public double P0, B, QYes, QNo;
/// <summary>单盘额度(开盘日的 <see cref="LossFor"/>)。旧存档里的盘口没有这个字段,按当时"额度 = B × ln(1/先验)"回推。</summary>
public double Budget;
/// <summary>昨晚消息反应之前的价格(-1 = 还没反应过):列表里显示涨跌,让玩家看到消息怎样推动价格。</summary>
public double PrevP = -1;
/// <summary>-1 未结算,0 否,1 是,2 作废(缺观测数据,退还本金)。</summary>
public int Outcome = -1;
public double MaxLoss => B * Math.Log(1 / Math.Min(P0, 1 - P0));
public double ShareCap => Tuning.PredictCap * MaxLoss;
public double Loss => Budget > 0 ? Budget : B * Math.Log(1 / Math.Min(P0, 1 - P0));
public double ShareCap => Tuning.PredictCap * Loss;
public bool IsOpen(int day) => Outcome < 0 && day < FromDay;
public double PYes => 1 / (1 + Math.Exp((QNo - QYes) / B));
@@ -37,8 +40,8 @@ namespace Decentralized.Domain
public static PredictMarket Create(int id, PredictKind kind, string key, string title, double param, int openDay, int fromDay, int toDay, double p0)
{
p0 = Math.Max(Tuning.PredictPMin, Math.Min(Tuning.PredictPMax, p0));
double b = LossFor(openDay) / Math.Log(1 / Math.Min(p0, 1 - p0));
return new PredictMarket { Id = id, Kind = kind, Key = key, Title = title, Param = param, OpenDay = openDay, FromDay = fromDay, ToDay = toDay, P0 = p0, B = b, QYes = b * Math.Log(p0 / (1 - p0)) };
double budget = LossFor(openDay), b = Tuning.PredictDepth * budget / Math.Log(2);
return new PredictMarket { Id = id, Kind = kind, Key = key, Title = title, Param = param, OpenDay = openDay, FromDay = fromDay, ToDay = toDay, P0 = p0, B = b, Budget = budget, QYes = b * Math.Log(p0 / (1 - p0)) };
}
/// <summary>LMSR 成本函数(数值稳定写法)。</summary>
@@ -153,7 +156,7 @@ namespace Decentralized.Domain
}
/// <summary>
/// 买入:花 spend(含 2% 手续费)的 CRC。污点与成本按花掉的价值比例随资金进持仓。insider:这笔单下单时玩家已经知道答案(传闻纸条、派系特权)。
/// 买入:花 spend(含手续费)的 CRC。污点与成本按花掉的价值比例随资金进持仓。insider:这笔单下单时玩家已经知道答案(传闻纸条、派系特权)。
/// </summary>
public PredictResult Buy(Wallet acct, PredictMarket m, bool yes, double spend, int day, Func<string, double> pr, bool insider, out double shares)
{
@@ -177,7 +180,7 @@ namespace Decentralized.Domain
return PredictResult.Ok;
}
/// <summary>全部卖出这个钱包在盘口里的持仓(盘口关闭前):收回 LMSR 的卖价减 2% 手续费,污点按比例退回,赚的部分是干净的。返回收回的 CRC。</summary>
/// <summary>全部卖出这个钱包在盘口里的持仓(盘口关闭前):收回 LMSR 的卖价减手续费,污点按比例退回,赚的部分是干净的。返回收回的 CRC。</summary>
public PredictResult SellAll(Wallet acct, PredictMarket m, int day, out double got) => SellAll(acct, m, day, null, out got, out _);
/// <summary>
@@ -291,7 +294,7 @@ namespace Decentralized.Domain
bool claim;
if (rng.Chance(Tuning.IntelFake)) claim = !truth;
else claim = rng.Chance(Tuning.IntelTipAcc[tier]) ? truth : !truth;
return new PredictTip { Market = m.Id, Tier = tier, Claim = claim, Paid = Tuning.IntelTipPrice[tier] * m.MaxLoss };
return new PredictTip { Market = m.Id, Tier = tier, Claim = claim, Paid = Tuning.IntelTipPrice[tier] * m.Loss };
}
/// <summary>
+32 -10
View File
@@ -6,7 +6,7 @@ namespace Decentralized.Domain
public static class Tuning
{
/// <summary>人脉网络升级价格:Web3 治理社区(入口)、混币器。</summary>
public const int UnlockPrice = 400, MixerUnlockPrice = 700;
public const int UnlockPrice = 400, MixerUnlockPrice = 300;
// 挖矿
public const double PscStartPrice = 100;
@@ -33,8 +33,12 @@ namespace Decentralized.Domain
public const double RefurbishHealth = 30;
// 市场
public const double PoolDepth0 = 50000;
public const double DexFee = 0.003, ExchangeFee = 0.002;
/// <summary>主交易对(PSC/CRC)信用点一侧的深度。按全网日产出(约 {BlockReward} PSC)的比例对照头部交易所:买 2 PSC 的价格冲击约 0.02%,卖两天的产出约 2%。</summary>
public const double PoolDepth0 = 600000;
/// <summary>DEX 手续费;Poinbase 现货与出金的手续费(对照头部交易所 taker 约 0.1%)。</summary>
public const double DexFee = 0.003, ExchangeFee = 0.001;
/// <summary>NPC 大户每笔成交额(信用点)的范围。</summary>
public const double WhaleMin = 24000, WhaleMax = 96000;
public const double Revert = 0.15;
public const double PscVol = 0.04;
public const double SentimentKappa = 0.02, SentimentVol = 0.02;
@@ -168,7 +172,7 @@ namespace Decentralized.Domain
/// <summary>出售量越大货款越容易带污点:近 7 天成交额达到参考量时,污点概率与比例各加最多 BmVolumeTaintMax。</summary>
public const double BmVolumeRef = 14000, BmVolumeTaintMax = 0.30;
/// <summary>黑市人脉升级的价格。</summary>
public const int BmUnlockPrice = 1500;
public const int BmUnlockPrice = 600;
/// <summary>单个金融违规事件记入的罪证上限。</summary>
public const double CrimeEventCap = 400;
@@ -197,13 +201,22 @@ namespace Decentralized.Domain
public const double TxPoisonChance = 0.35, TxHijackChance = 0.3, TxPhishChance = 0.05;
public const int TxPoisonDelayMax = 2;
/// <summary>永续合约:开平仓手续费、强平费、维持保证金比例;保险基金初值、每晚手续费补充、NPC 大行情穿仓的冲击系数与免冲击涨跌幅、手续费进基金的比例;
/// <summary>永续合约:开平仓手续费、强平费、维持保证金比例;保险基金初值(约 20 天的全网产出)、手续费进基金的比例;
/// 基金见底时盈利仓位自动减仓的盈利折扣;资金费系数与上下限(每晚);欠款日息、没收宽限天数、核销后拉黑天数;两个品种的最高杠杆与单仓名义价值上限。</summary>
public const double PerpFee = 0.001, PerpLiqFee = 0.02, PerpMaint = 0.10;
public const double PerpFund0 = 10000, PerpFundDrift = 150, PerpFundShock = 2000, PerpShockFree = 0.06, PerpFeeToFund = 0.3, PerpAdlHaircut = 0.5;
public const double PerpFund0 = 200000, PerpFeeToFund = 0.3, PerpAdlHaircut = 0.5;
/// <summary>NPC 永续仓位(每晚按标记价的涨跌结算,进出保险基金):亏损一侧的持仓占现货池深的倍数(SPARK 再乘 SparkDepthShare);
/// 涨跌幅达到 PerpNpcLiqScale 时亏损一侧全部爆仓,之前按比例爆仓;爆仓里穿仓的比例 = 基础 + 斜率 × (涨跌幅 − 免穿仓幅度),封顶;
/// 正常爆仓交给基金的剩余保证金(占名义价值);穿仓的缺口(占名义价值)= 涨跌幅 × 系数。</summary>
public const double PerpNpcOi = 1.0, PerpNpcLiqScale = 0.25, PerpNpcBankBase = 0.05, PerpNpcBankSlope = 1.5, PerpNpcBankFree = 0.12, PerpNpcBankMax = 0.95;
public const double PerpNpcLeft = 0.005, PerpNpcGap = 0.3;
/// <summary>爆仓新闻:标记价单日涨跌达到多少上报纸;NPC 平均每个仓位的名义价值(折算人数)。</summary>
public const double PerpNewsMove = 0.15, PerpNpcAvgPos = 1500;
public const double PerpFundCoef = 0.10, PerpFundCap = 0.003;
/// <summary>永续的成交深度占现货主池的比例:开平仓的平均滑点 = 名义价值 / (深度倍数 × 池深),和现货一样大单更贵。</summary>
public const double PerpDepthMult = 5.0;
/// <summary>永续成交深度的基数(与现货池深分开:永续的滑点压住均值回归策略,校准见 research/perpsim)。</summary>
public const double PerpDepth0 = 50000;
/// <summary>开仓时按现价算权益至少要高出强平线多少(占名义价值的比例),否则拒绝(滑点太大,开了就被强平)。</summary>
public const double PerpOpenBuffer = 0.02;
public const double PerpDebtInterest = 0.02;
@@ -223,13 +236,15 @@ namespace Decentralized.Domain
public const int EraMin = 50, EraMax = 90, EraWarnMin = 4, EraWarnMax = 7;
public const double EraKjMult = 0.5;
/// <summary>预测市场:游戏第几天起开放;手续费;每盘系统最大亏损 = 基础 + 每天增量 × 天数;单人单盘份额上限(最大亏损的倍数);
/// <summary>预测市场:游戏第几天起开放;手续费;单盘额度 = 基础 + 每天增量 × 天数;所有钱包在单盘合计的份额上限(额度的倍数);
/// 同时开放的盘口数量范围、每天最多新开几个;内幕持仓达到上限份额的多少比例后结算被查的概率,查实后收益记罪证的比例与上限;
/// 派系行动的日均开始概率(先验);先验概率的夹紧范围;结算记录保留条数。</summary>
public const int PredictUnlockDay = 8;
public const double PredictFee = 0.02, PredictLoss0 = 800, PredictLossPerDay = 25, PredictCap = 3;
public const double PredictFee = 0.01, PredictLoss0 = 800, PredictLossPerDay = 25, PredictCap = 2;
/// <summary>预测盘的流动性:LMSR 的 b = 倍数 × 单盘额度 / ln 2,与先验无关(低先验盘不再更浅)。单盘额度只决定份额上限和消息价。</summary>
public const double PredictDepth = 10;
public const int PredictOpenMin = 3, PredictOpenMax = 6, PredictNewPerDay = 2;
public const double PredictInsiderShare = 0.4, PredictInsiderCatch = 0.5, PredictFraudShare = 0.5, PredictFraudCap = 400;
public const double PredictInsiderShare = 0.4, PredictInsiderCatch = 0.7, PredictFraudShare = 0.5, PredictFraudCap = 400;
public const double PredictFactionDaily = 0.06, PredictPMin = 0.03, PredictPMax = 0.97;
public const int PredictHistory = 8;
/// <summary>gas 盘的公开价里"不知道相位"的权重:越大,数清七天周期的玩家越赚。金融审查(agy_fin/subsim)发现 0.5 时 gas 盘胜率 96%、每周净赚约 1,400,调到 0.15。</summary>
@@ -240,7 +255,7 @@ namespace Decentralized.Domain
public const double PredictMoveLog = 0.15;
/// <summary>情报贩子:局势简报价格(CRT)、三档内幕消息的价格(占盘口最大亏损的比例)与准确率、假情报概率(claim 与真相相反)、需要的黑市声望。</summary>
public const double IntelBriefPrice = 120, IntelFake = 0.10;
public static readonly double[] IntelTipPrice = { 0.01, 0.025, 0.05 }, IntelTipAcc = { 0.60, 0.80, 0.95 };
public static readonly double[] IntelTipPrice = { 0.03, 0.08, 0.20 }, IntelTipAcc = { 0.60, 0.80, 0.95 };
public const int IntelRep = 20;
/// <summary>操纵检出:玩家自己的大单把价格推离"没有你时的水平"的对数幅度(取绝对值)低于 ManipFree 不查;
/// 超过后被查概率 = ManipBase + ManipSlope × (幅度 − ManipFree),封顶 ManipMax;被查后永续账户冻结几天。</summary>
@@ -268,6 +283,10 @@ namespace Decentralized.Domain
public const double YieldPoolChance = 0.25, YieldRugNightly = 0.18, YieldCap0 = 4000, YieldCapPerDay = 120, YieldReserveDays = 25;
public static readonly double[] YieldRates = { 0.01, 0.02, 0.03 }, YieldScamByRate = { 0.15, 0.40, 0.75 };
public const double YieldScamTimelock = 0.25, YieldScamAudit = 0.20;
/// <summary>收黑币:相关事件期间每天有人上门的概率(PSC、CRT),Ponero 兑换处开放后每天的概率;币的市值(房租的倍数);
/// 现金要价占市值的比例(PSC、CRT 与 Ponero 分开);钓鱼执法的概率与镇压期间的加成。</summary>
public const double HotEventChance = 0.35, HotPoneroChance = 0.05, HotValueMinRents = 4, HotValueMaxRents = 15;
public const double HotCutMin = 0.45, HotCutMax = 0.60, HotPoneroCutMin = 0.70, HotPoneroCutMax = 0.80, HotSting = 0.05, HotStingCrackdown = 0.10;
/// <summary>假客服:每天上门的概率;伪造转账:用币付款的顾客里是骗子的比例;两者都从第几天起。</summary>
public const double FakeSupportChance = 0.04, FakeTransferShare = 0.08;
public const int ScamMinDay = 10;
@@ -298,5 +317,8 @@ namespace Decentralized.Domain
/// <summary>主交易对(信用点一侧)的深度随天数增长。</summary>
public static double PoolDepth(int day) => PoolDepth0 * (1 + day / 60.0);
/// <summary>永续的成交深度,同样随天数增长。</summary>
public static double PerpDepth(int day) => PerpDepth0 * (1 + day / 60.0);
}
}
+24 -3
View File
@@ -247,6 +247,16 @@ namespace Decentralized.Domain
["HalvingPassMin"] = Tuning.HalvingPassMin,
["HalvingRamp"] = Tuning.HalvingRamp,
["HalvingRampDays"] = Tuning.HalvingRampDays,
["HotCutMax"] = Tuning.HotCutMax,
["HotCutMin"] = Tuning.HotCutMin,
["HotEventChance"] = Tuning.HotEventChance,
["HotPoneroChance"] = Tuning.HotPoneroChance,
["HotPoneroCutMax"] = Tuning.HotPoneroCutMax,
["HotPoneroCutMin"] = Tuning.HotPoneroCutMin,
["HotSting"] = Tuning.HotSting,
["HotStingCrackdown"] = Tuning.HotStingCrackdown,
["HotValueMaxRents"] = Tuning.HotValueMaxRents,
["HotValueMinRents"] = Tuning.HotValueMinRents,
["IntelBriefPrice"] = Tuning.IntelBriefPrice,
["IntelFake"] = Tuning.IntelFake,
["IntelRep"] = Tuning.IntelRep,
@@ -278,20 +288,28 @@ namespace Decentralized.Domain
["PerpBanDays"] = Tuning.PerpBanDays,
["PerpDebtDays"] = Tuning.PerpDebtDays,
["PerpDebtInterest"] = Tuning.PerpDebtInterest,
["PerpDepth0"] = Tuning.PerpDepth0,
["PerpDepthMult"] = Tuning.PerpDepthMult,
["PerpFee"] = Tuning.PerpFee,
["PerpFeeToFund"] = Tuning.PerpFeeToFund,
["PerpFund0"] = Tuning.PerpFund0,
["PerpFundCap"] = Tuning.PerpFundCap,
["PerpFundCoef"] = Tuning.PerpFundCoef,
["PerpFundDrift"] = Tuning.PerpFundDrift,
["PerpFundShock"] = Tuning.PerpFundShock,
["PerpLiqFee"] = Tuning.PerpLiqFee,
["PerpMaint"] = Tuning.PerpMaint,
["PerpNewsMove"] = Tuning.PerpNewsMove,
["PerpNpcAvgPos"] = Tuning.PerpNpcAvgPos,
["PerpNpcBankBase"] = Tuning.PerpNpcBankBase,
["PerpNpcBankFree"] = Tuning.PerpNpcBankFree,
["PerpNpcBankMax"] = Tuning.PerpNpcBankMax,
["PerpNpcBankSlope"] = Tuning.PerpNpcBankSlope,
["PerpNpcGap"] = Tuning.PerpNpcGap,
["PerpNpcLeft"] = Tuning.PerpNpcLeft,
["PerpNpcLiqScale"] = Tuning.PerpNpcLiqScale,
["PerpNpcOi"] = Tuning.PerpNpcOi,
["PerpOpenBuffer"] = Tuning.PerpOpenBuffer,
["PerpPscCap"] = Tuning.PerpPscCap,
["PerpPscLev"] = Tuning.PerpPscLev,
["PerpShockFree"] = Tuning.PerpShockFree,
["PerpSparkCap"] = Tuning.PerpSparkCap,
["PerpSparkLev"] = Tuning.PerpSparkLev,
["PoneroDailyCap"] = Tuning.PoneroDailyCap,
@@ -313,6 +331,7 @@ namespace Decentralized.Domain
["PoolDepth0"] = Tuning.PoolDepth0,
["PoolFee"] = Tuning.PoolFee,
["PredictCap"] = Tuning.PredictCap,
["PredictDepth"] = Tuning.PredictDepth,
["PredictDrift"] = Tuning.PredictDrift,
["PredictFactionDaily"] = Tuning.PredictFactionDaily,
["PredictFee"] = Tuning.PredictFee,
@@ -429,6 +448,8 @@ namespace Decentralized.Domain
["WalletMallQtyMax"] = Tuning.WalletMallQtyMax,
["WalletMax"] = Tuning.WalletMax,
["WalletPoisonShare"] = Tuning.WalletPoisonShare,
["WhaleMax"] = Tuning.WhaleMax,
["WhaleMin"] = Tuning.WhaleMin,
["WickChance"] = Tuning.WickChance,
["WickMax"] = Tuning.WickMax,
["WickMin"] = Tuning.WickMin,