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

- 主池深度 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

+17 -15
View File
@@ -309,9 +309,9 @@ namespace Decentralized
private static bool ParseAmount(out double v) =>
double.TryParse((_amount ?? "").Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out v) && v > 0;
private static void AmountRow(CustomUIBuilder b, bool label = true)
private static void AmountRow(CustomUIBuilder b, bool label = true, string unit = null)
{
if (label) b.AddLabel(L.T("trade.amount"));
if (label) b.AddLabel(unit == null ? L.T("trade.amount") : L.T("trade.amount.unit", unit));
b.BeginPanel(RightW - 30f, -1f, TextAnchor.MiddleCenter, 0f, 0f);
_clear.Add(b.Last.image);
b.AddInput("0", _amount, s => { _amount = s; RefreshLive(); }, "amount", s => { _amount = s; RefreshLive(); });
@@ -427,7 +427,7 @@ namespace Decentralized
foreach (var pool in Session.Data.Market.Pools.Where(x => x.Venue == venue))
{
var p = pool;
b.AddLabel(L.T("trade.pair", p.Base, p.Quote, L.T("venue." + p.Venue)) + " " + L.T("trade.price", Fmt.Num(p.Price)));
b.AddLabel(L.T("trade.pair", p.Base, p.Quote, L.T("venue." + p.Venue)) + " " + L.T("trade.price", Fmt.Num(p.Price)) + " " + L.T("trade.fee", (p.Fee * 100).ToString("0.0#", CultureInfo.InvariantCulture)));
LiveLabel(b, () => SpotPreview(p, true), "trade_preview_dim");
LiveLabel(b, () => SpotPreview(p, false), "trade_preview_dim");
b.BeginRow(4f);
@@ -437,15 +437,15 @@ namespace Decentralized
}
}
/// <summary>现货模拟:按输入数量算买入或卖出能得到多少、平均成交价、相对现价的滑点(不改池子)。买入数量是计价币,卖出数量是标的币。</summary>
/// <summary>现货模拟(不改池子):输入的数量是标的币;买入算要付多少计价币,卖出算能得到多少。均价含手续费,滑点不含手续费。</summary>
private static string SpotPreview(Pool p, bool buy)
{
if (!ParseAmount(out double v)) return "";
double got = buy ? p.BaseOut(v) : p.QuoteOut(v);
if (got <= 0) return "";
double avg = buy ? v / got : got / v;
double slip = buy ? avg / p.Price - 1 : 1 - avg / p.Price;
return L.T(buy ? "trade.sim.buy" : "trade.sim.sell", Fmt.Num(got), buy ? p.Base : p.Quote, Fmt.Num(avg), (Math.Max(0, slip) * 100).ToString("0.0", CultureInfo.InvariantCulture));
double quote = buy ? p.QuoteIn(v) : p.QuoteOut(v);
if (quote <= 0 || double.IsInfinity(quote)) return buy ? L.T("trade.sim.thin") : "";
double avg = quote / v, net = buy ? avg * (1 - p.Fee) : avg / (1 - p.Fee);
double slip = buy ? net / p.Price - 1 : 1 - net / p.Price;
return L.T(buy ? "trade.sim.buy" : "trade.sim.sell", Fmt.Num(quote), p.Quote, Fmt.Num(avg), (Math.Max(0, slip) * 100).ToString("0.00", CultureInfo.InvariantCulture));
}
private static readonly float[] HoldWBase = new[] { 80f, 100f, 110f, 110f };
@@ -499,7 +499,7 @@ namespace Decentralized
}, r =>
{
r.AddHeader(L.T("trade.h"));
AmountRow(r);
AmountRow(r, unit: d.Market.Main.Base);
TradeRows(r, venue);
});
}
@@ -1143,7 +1143,7 @@ namespace Decentralized
for (int t = 0; t < 3; t++)
{
int tier = t;
r.AddButton(L.T("intel.tip.buy", (int)Math.Round(Tuning.IntelTipAcc[t] * 100), Fmt.Num(Tuning.IntelTipPrice[t] * m.MaxLoss)), () => IntelBuyTip(mk, tier));
r.AddButton(L.T("intel.tip.buy", (int)Math.Round(Tuning.IntelTipAcc[t] * 100), Fmt.Num(Tuning.IntelTipPrice[t] * m.Loss)), () => IntelBuyTip(mk, tier));
r.Last?.SetPreferredSize(RightW - 30f, 28f * F);
if (t < 2) r.AddSpace(2f);
}
@@ -1179,7 +1179,7 @@ namespace Decentralized
private static void IntelBuyTip(PredictMarket m, int tier)
{
var d = Session.Data;
double price = Tuning.IntelTipPrice[tier] * m.MaxLoss;
double price = Tuning.IntelTipPrice[tier] * m.Loss;
if (d.Hot.Avail(Assets.CRT) + 1e-9 < price) { _message = L.T("intel.err.funds"); Open(); return; }
_message = L.T("hw.wait");
Open();
@@ -1961,7 +1961,8 @@ namespace Decentralized
double mult = MultFor(g.Key);
foreach (var it in g.Items.Take(n))
{
var s = d.Black.List(g.Id, g.Model, g.FakeOf, g.Health, g.Ref, mult, pw, asset, day, Session.Price);
int heat = it.IsTag("STOLEN_VALUE_INT") ? it.GetTagReadonly("STOLEN_VALUE_INT").GetInt() : 0;
var s = d.Black.List(g.Id, g.Model, g.FakeOf, g.Health, g.Ref, mult, pw, asset, day, Session.Price, heat);
if (s == null) { fail++; continue; }
it.Destroy();
ok++;
@@ -2706,13 +2707,14 @@ namespace Decentralized
Open();
}
/// <summary>交易:Poinbase 是托管账户,直接成交。</summary>
/// <summary>交易:Poinbase 是托管账户,直接成交。输入的数量是标的币:买入按池子反算要付的计价币。</summary>
private static void Trade(Pool p, bool buy)
{
if (!ReadAmount(out double v)) return;
var w = Session.Data.Poinbase;
if (buy) v = p.QuoteIn(v);
string pay = buy ? p.Quote : p.Base;
if (w.Avail(pay) + 1e-9 < v) { _message = L.T(frozenPay(w, pay) ? "msg.frozen" : "msg.balance"); Open(); return; }
if (double.IsInfinity(v) || w.Avail(pay) + 1e-9 < v) { _message = L.T(frozenPay(w, pay) ? "msg.frozen" : "msg.balance"); Open(); return; }
DoTrade(p, buy, v, w);
}