sstklen/trump-code
sstklen/trump-code has 812 GitHub stars and 103 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-09 20:53 UTC. Last push 2026-11-02.
ð AI decoding Trump's posts à stock market | AI è§£ç¢Œå·æ®æšæ à çŸè¡ | AIã§ãã©ã³ãæçš¿Ãæ ªåŒåžå Žãè§£èª â 31.5M models, 61.3% hit rate, open source
Measured star growth
- in 24h
- +1
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalð± 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.
Explore related projects
tensorflow/tensorflow
An Open Source Machine Learning Framework for Everyone
201,400 starshuggingface/transformers
ð€ Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
168,668 starsAUTOMATIC1111/stable-diffusion-webui
Stable Diffusion web UI
165,261 starsComfy-Org/ComfyUI
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
145,835 stars