Skip to content

pentameal/trump-code

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

105 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” TRUMP CODE

AI-powered cryptanalysis of presidential communications ร— stock market impact.

Live Dashboard GitHub Stars

Buy Me a Claude Max

Models Tested Survivors Hit Rate Verified Open Data License: MIT

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

โ†’ trumpcode.washinmura.jp

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

  1. Propose new features โ€” Open an issue: what to track, why it matters, how to detect it
  2. Run your own analysis โ€” Clone the data, find patterns, submit a PR
  3. Verify predictions โ€” Check daily_report.json against actual market closes
  4. 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็ซ ใ€ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐ็ตŒ้จ“ใ‚ผใƒญ ๐Ÿ“š

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.

About

๐Ÿ” AI decoding Trump's posts ร— stock market | AI ่งฃ็ขผๅทๆ™ฎๆŽจๆ–‡ ร— ็พŽ่‚ก | AIใงใƒˆใƒฉใƒณใƒ—ๆŠ•็จฟร—ๆ ชๅผๅธ‚ๅ ดใ‚’่งฃ่ชญ โ€” 31.5M models, 61.3% hit rate, open source

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 87.4%
  • HTML 12.3%
  • Shell 0.3%