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

AlphaGPT Cheat Sheet: Auto-Generating Trading Formulas for Solana Meme Coins

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

Summary

AlphaGPT is an open-source crypto quantitative research project that does not predict prices. Instead, a looped PyTorch Transformer autoregressively generates human-readable trading formulas composed of features and operators; a stack-based virtual machine executes the token sequence into factor signals, which a meme-coin backtester scores using net PnL and feeds back via REINFORCE to reinforce high-return formula paths. The data pipeline pulls on-chain OHLCV from Birdeye (DexScreener fallback) into PostgreSQL with a TimescaleDB hypertable after filtering low-liquidity tokens. The trained formulas run live via a strategy manager (15-minute loop, sigmoid > 0.85 entry, -5% stop-loss, +10% take-profit, trailing exit at score < 0.45, >$5000 liquidity honeypot check) routed through Jupiter v6 aggregator on Solana RPC, monitored through a Streamlit dashboard with a kill-switch. The stack uses QKNorm, RMSNorm, SwiGLU, MTPHead, and Newton-Schulz LoRD regularization. Twelve features and twelve operators are exposed, and a parallel A-share experiment (times.py) transfers the paradigm to 511260.SH using Sortino-based rewards.

What AlphaGPT Does

AlphaGPT is an open-source Python project (Python 3.11, PyTorch) located at C:/GitHub/AlphaGPT. It is not a price-prediction model — it is an automated factor-formula generator for Solana meme-coin quant trading.

The core idea: a looped Transformer autoregressively emits a token sequence where each token is either a feature or an operator. A stack-based virtual machine executes those tokens into an interpretable formula such as MUL(RET, DECAY(VOL_CHG)). The formula is decoded back into readable code, debugged, and explained. Backtest net PnL becomes the RL reward signal via REINFORCE, pushing the probability of high-return formula paths upward.

Tech Stack

  • Deep learning: PyTorch · Looped Transformer with QKNorm / RMSNorm / SwiGLU / MTPHead
  • Regularization: Newton-Schulz LoRD (Muon-style low-rank decay); a lord/ module runs LoRD vs L2 grokking experiments
  • Data sources: Birdeye API (primary) / DexScreener (fallback)
  • Storage: PostgreSQL + TimescaleDB hypertable
  • Execution: Solana RPC + Jupiter v6 aggregator
  • Dashboard: Streamlit + Plotly
  • A-share experiment: Tushare-fed times.py migrates the same paradigm to 511260.SH using Sortino-based rewards
  • Data Flow

    1. Birdeye API → on-chain OHLCV 2. data_pipeline → filters by liquidity / FDV 3. Postgres + Timescale → time-series storage 4. AlphaGPT (Transformer) → generates formula tokens 5. StackVM → executes tokens into factor signals 6. MemeBacktest → scores net PnL 7. REINFORCE feedback loop retrains the Transformer 8. strategy_manager (sigmoid > 0.85) → triggers execution → Jupiter on-chain swap

    The closed RL loop: ① sample formula tokens → ② execute on StackVM → ③ backtest score (fitness) → ④ reinforce good paths.

    Module Quick Reference

    | Module | Role | |---|---| | data_pipeline | Fetch Birdeye market data; filter low-liquidity junk | | model_core | Factor-mining engine: Transformer + VM + backtest training | | strategy_manager | 15-min loop; loads formula, scores, places orders with stop-loss/take-profit | | execution | Jupiter quotes + Solana RPC signing | | dashboard | Streamlit positions/PnL/log viewer with emergency stop | | lord | LoRD vs L2 regularization grokking experiments | | times.py | A-share variant on 511260.SH (Sortino reward) |

    Run It in 5 Steps

    1. Create the crypto_quant database and configure .env 2. python -m data_pipeline.run_pipeline 3. python -m model_core.engine — emits best_meme_strategy.json 4. python -m strategy_manager.runner — leave running for live trading 5. streamlit run dashboard/app.py — dashboard + kill switch

    Factors and Operators (12 + 12)

    6 base features: ret log return · liq_score liquidity health · pressure buy/sell pressure · fomo volume acceleration · dev mean deviation · log_vol log volume. 6 extended features: 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-accumulate), DELAY1 (lag), MAX3 (three-value max).

    Risk Controls

  • Entry threshold: sigmoid > 0.85
  • Stop-loss: -5% · Take-profit: +10% (half closed, moonbag retained)
  • Exit signal: score < 0.45 · trailing take-profit
  • Honeypot guard: liquidity > $5,000 and sell side reliably quotable
  • Caveats Before You Clone

  • The repo does not ship a trained best_meme_strategy.json — you must train first
  • No .env template; assemble manually: Birdeye key, QuickNode RPC, Solana private key
  • External services required: Postgres, Birdeye, Jupiter, QuickNode — missing any one breaks the run
  • Private keys in .env mean real on-chain capital at risk — losses are not refundable
  • The README is mostly a safety disclaimer; the technical docs live 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
  • execution/trader.py — on-chain order router
  • times.py — A-share experimental port

Tags

#alphagpt#transformer#reinforcement-learning#factor-mining#solana#meme-coin#quant-trading#stack-vm

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