English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

AlphaGPT Cheat Sheet: A Transformer That Generates Trading Factors for Solana Meme Coins

Forum topic · ✨步子哥 · 2026-06-24

Summary

AlphaGPT is an open-source crypto quant system that does not predict prices; instead, a Transformer autoregressively generates factor formulas as token sequences (features and operators), which a stack-based virtual machine executes into factor signals. Formulas are scored by backtested net PnL, and REINFORCE reinforcement learning raises the probability of high-scoring generation paths. Top formulas are then wired to an on-chain Solana wallet for live trading via the Jupiter v6 aggregator. The stack includes PyTorch (looped Transformer with QKNorm/RMSNorm/SwiGLU/MTPHead), Newton-Schulz LoRD low-rank decay regularization, Birdeye and DexScreener market data, PostgreSQL + TimescaleDB, and a Streamlit dashboard with an emergency stop. The repository ships no pretrained best_meme_strategy.json or .env template, and live trading uses real private keys with real loss risk. Risk controls include a sigmoid > 0.85 entry threshold, -5% stop-loss, +10% take-profit with a half-position moonbag, and honeypot filtering requiring liquidity above $5,000. An experimental A-share variant (times.py) applies the same paradigm to 511260.SH using Sortino as the reward.

AlphaGPT Cheat Sheet: Auto-Generating Factor Formulas, Not Predicting Prices

One-line essence: AlphaGPT does not predict prices. Like GPT writing code, it automatically generates factor formulas, uses backtest returns as the reward, and trains the formula-writing Transformer with reinforcement learning. High-scoring formulas are then connected to an on-chain wallet to place real orders. It is not a prediction model — it is a system that writes factors automatically.

Core Idea

  • Generate formulas rather than predict prices.
  • A Transformer autoregressively emits a token sequence — each token is either a feature or an operator. A stack-based virtual machine (StackVM) executes them into factor signals.
  • Formulas are readable: decode() can reconstruct them, e.g. MUL(RET, DECAY(VOL_CHG)). They are debuggable and interpretable.
  • The reward comes from backtests: formulas with higher net PnL increase the probability of the generation paths that produced them — standard RL (REINFORCE).
  • Data Flow: From Market Data to On-Chain

    1. Sample — Transformer emits formula token sequences 2. Execute — StackVM runs tokens into factor signals 3. Score — backtest net PnL as fitness 4. Feedback — REINFORCE raises the probability of good paths

    Pipeline: Birdeye API → data_pipeline (liquidity/FDV filtering) → Postgres (TimescaleDB hypertable) → AlphaGPT model → StackVM → MemeBacktest → strategy_manager (signal when sigmoid > 0.85) → execution (Jupiter on-chain swap), with the RL feedback loop closing back to the model.

    Tech Stack

    | Area | Tools | |---|---| | Deep learning | PyTorch, Looped Transformer (+ QKNorm/RMSNorm/SwiGLU/MTPHead) | | Regularization | Newton-Schulz LoRD (Muon-style low-rank decay) | | Data sources | Birdeye (primary) / DexScreener (backup) | | Storage | PostgreSQL + TimescaleDB hypertable | | Trading | Solana RPC + Jupiter v6 aggregator | | Dashboard | Streamlit + Plotly | | A-share experiment | Tushare (times.py) |

    Module Reference

  • data_pipeline — fetch Birdeye market data into the DB, filter low-liquidity junk coins
  • model_core — factor mining engine: Transformer + VM + backtest-driven training
  • strategy_manager — 15-minute live loop, loads formulas, scores and places orders, with stop-loss/take-profit
  • execution — Jupiter quotes + Solana RPC signing and order submission
  • dashboard — Streamlit positions/PnL/logs with an emergency-stop button
  • lord — grokking experiments comparing LoRD vs L2 regularization
  • times.py — same paradigm ported to 511260.SH (A-share), reward uses Sortino
  • Five Steps to Run

    1. Create the crypto_quant database, configure .env 2. python -m data_pipeline.run_pipeline to fetch data 3. python -m model_core.engine to train, producing best_meme_strategy.json 4. python -m strategy_manager.runner for live trading 5. streamlit run dashboard/app.py to monitor and emergency-stop

    Factors & Operators (12 + 12)

    Base factors (6): ret (log return), liq_score (liquidity health), pressure (buy/sell pressure), fomo (volume acceleration), dev (deviation from mean), log_vol (log volume). Extended (6): volatility clustering, momentum reversal, RSI, amplitude, close position, volume trend.

    Operators: ADD SUB MUL DIV NEG ABS SIGN plus GATE (gating), JUMP (jump detection), DECAY (decay stacking), DELAY1 (lag), MAX3 (three-value max).

    Trading & Risk Controls

  • Entry threshold: sigmoid > 0.85
  • Stop-loss -5% / take-profit +10%, keeping a half-position moonbag
  • Exit signal: score < 0.45, with trailing take-profit
  • Anti-honeypot: liquidity > $5,000 and sell quotes verifiable
  • Gotchas Before You Start

  • The repo does not include a trained best_meme_strategy.json — run training first
  • No .env template: assemble your own Birdeye key, QuickNode RPC, and Solana private key
  • Many external dependencies: Postgres, Birdeye, Jupiter, QuickNode — all are required
  • Red flag: your private key goes into .env — this is real on-chain live trading; losses are not recoverable
  • The README contains only the author's safety disclaimer; technical docs are in CATREADME.md
  • Key Files

  • model_core/alphagpt.py — model
  • model_core/vm.py — stack VM
  • model_core/engine.py — training loop
  • strategy_manager/runner.py — live-trading entry point
  • execution/trader.py — on-chain order placement
  • times.py — A-share experimental version
Takeaway: generating formulas ≠ predicting prices.

Tags

#alphagpt#solana#quantitative-trading#reinforcement-learning#transformer#factor-mining#cryptocurrency#meme-coins

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178208072