trump-code
trump-code copied to clipboard
๐ AI decoding Trump's posts ร stock market | AI ่งฃ็ขผๅทๆฎๆจๆ ร ็พ่ก | AIใงใใฉใณใๆ็จฟรๆ ชๅผๅธๅ ดใ่งฃ่ชญ โ 31.5M models, 61.3% hit rate, open source
๐ฑ cat Treehouse โ Win a treehouse stay in Japan for you + 3 friends. Your GitHub stars are your lottery tickets. ไธไบบไธญ็๏ผๅไบบๅ่กใ Enter the Draw โ
๐ TRUMP CODE
AI-powered cryptanalysis of presidential communications ร stock market impact.
๐ โ trumpcode.washinmura.jp โ LIVE DASHBOARD
Can you decode the President's posts before the market moves?
ไธญๆ็ ยท ๆฅๆฌ่ช็
What Is This?
Trump is the only person on Earth who can move global markets with a single social media post. This project applies brute-force computation to find statistically significant patterns between his posting behavior and stock market movements.
Not gut feeling. Not opinion. Pure data.
- 7,400+ Truth Social posts analyzed (3 independent sources, cross-verified)
- 31.5 million model combinations tested via brute-force search
- 551 surviving rules that passed train/test validation
- 61.3% hit rate across 566 verified predictions (z=5.39, p<0.05)
- Closed-loop system: predict โ verify โ learn โ evolve โ repeat daily
Key Discoveries
| # | Finding | Evidence | Impact |
|---|---|---|---|
| 1 | Pre-market RELIEF = strongest buy signal | Apr 9, 2025: S&P +9.52% | Avg +1.12% same-day |
| 2 | TARIFFโSHORT is 70% wrong | Circuit breaker analysis | Auto-reversed to LONG |
| 3 | China signals hidden on Truth Social only | 203 TS posts / 0 on X | 1.5x weight boost |
| 4 | Truth Social publishes 6.2h before X | 38/39 posts matched | 6-hour trading window |
| 5 | Pure tariff day = most dangerous | Apr 3: -4.84%, Apr 4: -5.97% | Avg -1.057% |
| 6 | 4 signals combo = most profitable | 12 occurrences, 66.7% up | Avg +2.792% |
| 7 | Silence = 80% bullish | Zero-post days analysis | Avg +0.409% |
| 8 | Late-night tariff tweets = anti-indicator | 62% wrong โ reverse = 62% right | Auto-inverted |
System Architecture
Trump posts on Truth Social
โ
โผ (detected every 5 min)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Real-Time Engine โ
โ Detect โ Classify signals โ Dual-platform boost โ โ
โ Event pattern check โ Snapshot PM + S&P 500 โ โ
โ Predict โ Track at 1h/3h/6h โ Verify โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Daily Pipeline (11 steps) โ
โ Fetch โ Analyze โ Run 551 rules โ Predict โ โ
โ Verify โ Circuit Breaker โ Prediction Market check โ โ
โ Learn (promote/demote/eliminate) โ โ
โ Evolve (crossover/mutation/distill) โ โ
โ AI Briefing โ Sync to GitHub โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Three Brains โ
โ ๐ง Opus โ deep causal analysis โ
โ ๐งฌ Evolver โ breeds new rules from survivors โ
โ ๐ Circuit Breaker โ stops if system degrades โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Output โ
โ ๐ Dashboard ๐ฌ Chatbot ๐ก API ๐ป CLI ๐ค MCP โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Model Leaderboard
11 named strategy models, ranked by verified performance:
| # | Model | Strategy | Hit Rate | Avg Return | Trades |
|---|---|---|---|---|---|
| ๐ฅ | A3 | Pre-market RELIEF โ same-day surge | 72.7% | +1.206% | 11 |
| ๐ฅ | D3 | Post volume spike โ panic bottom | 70.2% | +0.306% | 47 |
| ๐ฅ | D2 | Signature switch โ formal statement | 70.0% | +0.472% | 80 |
| 4 | B3 | Pre-market ACTION + positive mood โ rise | 66.7% | +0.199% | 33 |
| 5 | C1 | Burst posting โ long silence โ go long | 65.3% | +0.145% | 176 |
| 6 | B1 | 3 signals combo โ buy 3 days | 64.7% | +0.597% | 17 |
| 7 | B2 | 3-day tariff streak โ Deal pivot | 57.9% | +0.721% | 19 |
| 8 | A1 | Tariff during market hours โ next-day drop | 56.5% | -0.758% | 23 |
| โ ๏ธ | A2 | DEAL signal โ next-day rise | 52.2% | +0.029% | 90 |
| โ ๏ธ | C2 | Market brag โ short-term top | 45.0% | +0.105% | 60 |
| ๐๏ธ | C3 | Late-night tariff โ gap open (anti-indicator) | 37.5% | -0.414% | 8 |
Dual-Platform Intelligence (Truth Social vs X)
| Finding | Data | Trading Implication |
|---|---|---|
| China = 100% hidden from X | 203 TS posts / 0 X posts | China signals are more authentic |
| TS publishes 6.2h before X | 38/39 posts matched | 6-hour arbitrage window |
| X posting correlates with market | r=0.35 | He uses X when confident |
| X day returns 7x higher | +0.252% vs +0.037% | X appearance = confirmation signal |
Prediction Markets Integration
Live tracking of Trump-related prediction markets via Polymarket:
- 316+ active Trump markets tracked in real-time
- Dual-track snapshots: Polymarket prices + S&P 500 simultaneously
- Signal โ market correlation analysis
- Kalshi cross-platform spread detection
Live Dashboard
Real-time dashboard showing:
- Latest Trump posts with signal analysis
- Today's signals and market consensus
- Live Polymarket Trump markets
- Model rankings with performance bars
- 30-second auto-refresh
API Endpoints
Base URL: https://trumpcode.washinmura.jp
| Endpoint | Description |
|---|---|
GET /api/dashboard |
All data in one call |
GET /api/signals |
Latest signals + 7-day history |
GET /api/models |
Model performance rankings |
GET /api/status |
System health summary |
GET /api/recent-posts |
Latest 20 Trump posts + signal analysis |
GET /api/polymarket-trump |
Live Trump prediction markets (316+) |
GET /api/playbook |
Three playbooks (hedge/position/pump) |
GET /api/insights |
Crowd-sourced trading insights |
GET /api/data |
Downloadable dataset catalog |
GET /api/data/{file} |
Download raw data files |
POST /api/chat |
AI chatbot (Gemini Flash) |
Open Data
All data is 100% public. Clone and explore:
| File | Description | Updated |
|---|---|---|
trump_posts_all.json |
Full Truth Social archive (44,000+ posts) | Daily |
trump_posts_lite.json |
Posts with signals pre-tagged | Daily |
x_posts_full.json |
X (Twitter) full archive | Daily |
predictions_log.json |
566 verified predictions with outcomes | Daily |
surviving_rules.json |
551 active rules (brute-force + evolved) | Daily |
daily_report.json |
Daily trilingual report | Daily |
trump_playbook.json |
Three playbooks (hedge/position/pump) | Weekly |
signal_confidence.json |
Signal confidence scores (auto-adjusted) | Daily |
opus_analysis.json |
Claude Opus deep analysis | On demand |
learning_report.json |
Learning engine report | Daily |
evolution_log.json |
Rule evolution log (crossover/mutation) | Daily |
circuit_breaker_state.json |
System health + error analysis | Daily |
daily_features.json |
384 features ร 414 trading days | Daily |
market_SP500.json |
S&P 500 OHLC history | Daily |
Quick Start
# Clone
git clone https://github.com/sstklen/trump-code.git
cd trump-code
pip install -r requirements.txt
# Check today's signals
python3 trump_code_cli.py signals
# Run any of the 12 analyses
python3 analysis_06_market.py # Posts vs S&P 500 correlation
python3 analysis_09_combo_score.py # Multi-signal combo scoring
# Run brute-force model search (~25 min)
python3 overnight_search.py
# Start real-time monitor
python3 realtime_loop.py
# Start web dashboard + chatbot
export GEMINI_KEYS="key1,key2,key3"
python3 chatbot_server.py
# โ http://localhost:8888
CLI Commands
python3 trump_code_cli.py signals # Today's detected signals
python3 trump_code_cli.py models # Model performance leaderboard
python3 trump_code_cli.py predict # LONG/SHORT consensus
python3 trump_code_cli.py arbitrage # Prediction market opportunities
python3 trump_code_cli.py health # System health check
python3 trump_code_cli.py report # Full daily report
python3 trump_code_cli.py json # All data as JSON
MCP Server (for Claude Code / Cursor)
Add to ~/.claude/settings.json:
{
"mcpServers": {
"trump-code": {
"command": "python3",
"args": ["/path/to/trump-code/mcp_server.py"]
}
}
}
9 tools: signals, models, predict, arbitrage, health, events, dual_platform, crowd, full_report
Contributing
We need the world's eyes on this. One team can't decode Trump alone.
Ways to Help
- Propose new features โ Open an issue: what to track, why it matters, how to detect it
- Run your own analysis โ Clone the data, find patterns, submit a PR
- Verify predictions โ Check
daily_report.jsonagainst actual market closes - Share trading logic โ Use the chatbot to share insights (best ones get absorbed)
Ideas We Haven't Tried
| Idea | Difficulty |
|---|---|
| Correlate with Bitcoin/Gold/Oil | Easy |
| Analyze image/video posts | Medium |
| Track which accounts he retweets before big moves | Easy |
| Cross-reference with his public schedule | Medium |
| Detect if posts are written by him vs staff | Hard |
| Analyze deleted posts and edit history | Medium |
File Structure
trump-code/
โโโ public/insights.html # Dashboard (single-file, no build)
โโโ chatbot_server.py # Web server + all API endpoints
โโโ realtime_loop.py # Real-time monitor (every 5 min)
โโโ daily_pipeline.py # Daily pipeline (11 steps)
โโโ learning_engine.py # Promote/demote/eliminate rules
โโโ rule_evolver.py # Crossover/mutation/distill
โโโ circuit_breaker.py # System health + auto-pause
โโโ event_detector.py # Multi-day event patterns
โโโ dual_platform_signal.py # Truth Social vs X analysis
โโโ polymarket_client.py # Polymarket API client
โโโ kalshi_client.py # Kalshi API client
โโโ arbitrage_engine.py # Cross-platform arbitrage
โโโ mcp_server.py # MCP server (9 tools)
โโโ trump_code_cli.py # CLI interface
โโโ trump_monitor.py # Post monitor
โโโ analysis_01_caps.py # CAPS code analysis
โโโ analysis_02_timing.py # Posting time patterns
โโโ analysis_03_hidden.py # Hidden messages (acrostic)
โโโ analysis_04_entities.py # Country & people mentions
โโโ analysis_05_anomaly.py # Anomaly detection
โโโ analysis_06_market.py # Posts vs S&P 500
โโโ analysis_07_signal_sequence.py # Signal sequences
โโโ analysis_08_backtest.py # Strategy backtesting
โโโ analysis_09_combo_score.py # Multi-signal scoring
โโโ analysis_10_code_change.py # Signature change detection
โโโ analysis_11_brute_force.py # Brute-force rule search
โโโ analysis_12_big_moves.py # Big move prediction
โโโ data/ # All data (100% open)
โโโ tests/ # Test suite
Disclaimer
FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY.
This project is NOT financial advice. Do NOT make investment decisions based on these findings.
Statistical Limitations:
- 31.5 million model combinations tested. Even with train/test validation, surviving models may include false positives due to multiple comparisons (data snooping bias).
- Past patterns do NOT guarantee future results. Correlation โ causation.
- Trump can change his communication patterns at any time.
Legal: The authors assume NO liability for financial losses. Data sourced from public archives. Not affiliated with Truth Social, S&P Global, or any government entity. Not registered with any financial regulatory authority.
Also By Washin Mura | ๅๅฟๆ็ๅ ถไปๅฐๆก | ๅๅฟๆใฎไปใใญใธใงใฏใ
These are the tools we used to build Trump Code โ and everything else.
้ไบๆฏๆๅๆ้ Trump Code ๅๅ ถไปๆๆๅฐๆก็ๅทฅๅ ทใ
Trump Codeใๅซใๅ จใใญใธใงใฏใใไฝใใใใซไฝฟใฃใใใผใซใงใใ
| Project | EN | ไธญๆ | ๆฅๆฌ่ช | |
|---|---|---|---|---|
| 5x-cto | Dev pipeline: 1 MAX + 1 Codex = 5x capacity | ้็ผๆตๆฐด็ท๏ผไธๅไบบ็ถไบๅ็จ | ้็บใใคใใฉใคใณ๏ผ1ไบบใง5ไบบๅ | ๐ |
| YES.md | AI governance: safety gates + evidence rules | AI ๆฒป็๏ผๅฎๅ จ้้ + ่ญๆ่ฆๅ | AIใฌใใใณใน๏ผๅฎๅ จใฒใผใ๏ผ่จผๆ ใซใผใซ | โ |
| AI.MD | Convert CLAUDE.md to AI-native format | ่ธ้คพ CLAUDE.md ็บ AI ๅ็ๆ ผๅผ | CLAUDE.mdใAIใใคใใฃใๅฝขๅผใซ | ๐ |
| Washin Playbook | The full story: 7 chapters, zero coding | ๅฎๆดๆ ไบ๏ผ7 ็ซ ๏ผ้ถ็จๅผ่ๆฏ | ๅ จ่จ้ฒ๏ผ7็ซ ใใใญใฐใฉใใณใฐ็ต้จใผใญ | ๐ |
๐ฎ Prediction Game
Play Now โ trumpcode.washinmura.jp/game
Trump posts โ AI predicts market direction โ You vote Bull/Bear/Flat โ 6 hours later, SPY decides who wins.
Can the crowd beat the AI? ๐ค vs ๐ฅ
๐ค Contributors
Thanks to everyone who helps make Trump Code better!
| Contributor | Contribution |
|---|---|
| @yongjer | PyTorch GPU acceleration for brute-force engine โ 857x faster (60s โ 0.07s on RTX 4060 Ti) |
Want to contribute? See CONTRIBUTING.md.
Built by Washin Mura (ๅๅฟๆ) โ Boso Peninsula, Japan.
Powered by brute-force computation, not gut feeling.
If you find patterns we missed, open an issue. Let's decode this together.
โญ Star this repo to follow the live decoding.