MentionBot Inspiration During a late-night scrolling session, we watched Bitcoin drop 4% in under three minutes — all because of a single Truth Social post about tariffs. By the time any trader could react, the move was priced in. We asked ourselves: what if you could predict the post before it happened?
Trump's posting behavior isn't random. He posts in bursts, goes silent for hours, reacts to Fox News segments, and ramps up during market hours. We realized this was a temporal point pattern — and patterns can be modeled.
What it does MentionBot is a real-time prediction engine that estimates the probability of Trump posting on Truth Social within the next 60 minutes. When the probability crosses a threshold, it automatically searches live Polymarket prediction markets, calculates an alpha edge against crowd consensus, and surfaces actionable trades — all before a single word is posted.
How we built it Data Pipeline We ingested 17,922 original Truth Social posts spanning February 2022 to October 2025, stripping out 5,218 retweets and 6,269 duplicates. Each post was converted into an hourly time-series of 32,383 prediction windows, where the target label is binary:
$$y_t = \begin{cases} 1 & \text{if any post occurs in hour } t+1 \ 0 & \text{otherwise} \end{cases}$$
The positive rate is only 22.5% — a significant class imbalance problem.
Feature Engineering (34 features) Cyclical time encoding:
$$h_{\sin} = \sin!\left(\frac{2\pi \cdot h}{24}\right), \quad h_{\cos} = \cos!\left(\frac{2\pi \cdot h}{24}\right)$$
Burstiness score over a rolling 12-hour window:
$$B = \frac{\sigma_{\Delta t} - \mu_{\Delta t}}{\sigma_{\Delta t} + \mu_{\Delta t}}$$
where $B \to 1$ = bursty, $B \to 0$ = regular, $B \to -1$ = periodic. 11.2% of model importance.
Regime changepoint detection using Binary Segmentation with $\ell_2$ cost — our single most important feature at 13.2%.
Fox News schedule alignment — based on research documenting 1,146 live-tweets of Fox News over two years.
Model LightGBM with $\texttt{scale_pos_weight} = n_{\text{neg}}/n_{\text{pos}} \approx 3.4$, threshold optimized for:
$$F_1 = \frac{2 \cdot P \cdot R}{P + R}$$
Market Integration Polymarket Gamma API + Gemini 2.5 Flash for topic classification + Alpha Delta calculation.
Challenges we faced Class imbalance — 22.5% positive rate. Naive models just predict "no post" and get 77.5% accuracy. Feature leakage from time — v3 had hour_of_day at 34% importance (learned his sleep schedule). Behavioral features reduced it to 2.6%. Changepoint detection at scale — PELT with RBF on 32k rows was $O(n^2)$. Switched to Binseg on daily aggregates. Live inference gap — training features have full context, live sliders don't. Built approximation functions. What we learned Time-of-day features are a trap — they dominate but don't generalize Threshold optimization matters as much as model selection Trump's posting is genuinely self-exciting — a Hawkes process in the wild The gap between "works on test set" and "works in production" is where projects die