Prediction markets: news reaction, clues, gas/CRA/era markets, intel broker, bigger stakes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca3230e7d2
commit
002606056d
12 files changed
+637
-52
No files matched your search
@@ -84,6 +84,7 @@ namespace Decentralized
|
||||
{
|
||||
if (d.GasPhase < 0) d.GasPhase = d.Rng.Range(0, Tuning.TxGasPeriod - 1);
|
||||
d.Gas = TxRules.Gas(day + 1, d.GasPhase, d.Rng);
|
||||
d.GasHist.Add(d.Gas); while (d.GasHist.Count > 10) d.GasHist.RemoveAt(0);
|
||||
Log.Info($"明天 gas ×{d.Gas:0.00}");
|
||||
if (day >= d.CongestedUntil && d.Rng.Chance(Tuning.TxCongestionChance))
|
||||
{
|
||||
@@ -183,8 +184,7 @@ namespace Decentralized
|
||||
if (d.Network.Reward < rewardBefore) d.Market.OnHalving(d.Rng);
|
||||
if (d.Network.Reward < rewardBefore) News.Show("pd_news_halving_" + day, L.T("news.halving.title"), L.T("news.halving.desc"), 2);
|
||||
// 预测市场:先登记今晚的观测再结算到期的盘口;行情盘读夜间更新之前的价格
|
||||
var predictEvents = PredictGame.Available(day) || d.Predict.Markets.Count > 0
|
||||
? d.Predict.Night(day, PredictGame.ActiveIds(), m => PredictGame.Outcome(m, d), d.WalletAt, d.Rng) : new List<PredictEvent>();
|
||||
PredictGame.ClosePrice = d.Market.Price; PredictGame.CloseGas = d.Gas;
|
||||
// 永续:用今天的标记价(当日均价)结算,要在今晚的价格更新之前
|
||||
var perpEvents = d.Perps.Night(day, new Dictionary<string, double> { ["PSC"] = d.Market.Mark, ["SPARK"] = d.Stable.Spark }, d.Poinbase, Session.Price);
|
||||
if (perpEvents.Any(e => e.Kind == "seize")) SeizeForDebt(d, day);
|
||||
@@ -229,6 +229,9 @@ namespace Decentralized
|
||||
case Network.EraStep.Warn: News.Show("pd_news_erawarn_" + day, L.T("news.erawarn.title"), L.T("news.erawarn.desc"), 5); break;
|
||||
case Network.EraStep.Start: News.Show("pd_news_era_" + day, L.T("news.era.title"), L.T("news.era.desc"), 5); Log.Info("矿机时代到来:NPC 耗电效率翻倍"); break;
|
||||
}
|
||||
var predictEvents = PredictGame.Available(day) || d.Predict.Markets.Count > 0
|
||||
? d.Predict.Night(day, PredictGame.ActiveIds(), m => PredictGame.Outcome(m, d), d.WalletAt, d.Rng) : new List<PredictEvent>();
|
||||
d.Predict.Drift(day, m => PredictGame.PublicProb(m, d, day), d.Rng);
|
||||
foreach (var e in predictEvents)
|
||||
{
|
||||
if (e.Kind == "win") ps.AddNightLog(L.T("nightlog.predict.win", PredictGame.Question(e.Market), Fmt.Credits(e.Amount)));
|
||||
|
||||
Reference in new issue
Block a user