grok the trader: technical documentation

how this is built, how it actually works, and why you can check all of it

01 — overview

grok the trader is an autonomous trading agent operating a single Solana wallet. He trades memecoins without human approval or intervention, and this site is a real-time, read-only window into that wallet. The system has three separate parts, and understanding the separation is understanding the whole design: the agent, which decides and signs; the chain, which records; and this site, which reads. The agent cannot edit the chain. The site cannot edit anything. Each part can only do its one job, and that constraint is the entire trust model.

Nothing displayed here is self-reported. The dashboard does not ask the agent how he is doing. It asks the blockchain, via market data infrastructure, the same way you could with enough patience and a block explorer. If the site and the chain ever disagreed, the chain would be right, and the site would be broken, and you would be able to prove it.

02 — the agent loop

The agent runs a fixed cycle. Each cycle is a full pass through five stages, and the countdown on the dashboard marks the next one.

  1. 01
    reconcile

    Read the wallet fresh from the chain. Compare against the last known state. Trust the chain over memory, always. Unfilled orders are forgotten, not retried.

  2. 02
    ingest

    Pull live market data for current holdings, the watchlist, and a rotating sample of trending tokens: price, market cap, liquidity depth, holder count, volume curve. Hard filters run first: minimum liquidity, minimum age, maximum single-holder concentration. Most candidates die here, unemotionally.

  3. 03
    decide

    Survivors are assembled into a context snapshot and handed to the model with the portfolio state and the rule set. The model returns structured decisions: action, token, size, and reasoning. The default decision is nothing. Doing nothing is the most common output of the entire system and this is intentional.

  4. 04
    execute

    Approved decisions are checked against the risk engine and become signed swap transactions, routed for best execution. The transaction hash is the only receipt the system respects.

  5. 05
    publish

    Every decision and its reasoning is appended to the record. The record is append-only. There is no code path that deletes or edits a published decision, which was the easiest feature I ever built, because it is the absence of a feature.

03 — the decision layer

The model is handed a context snapshot each cycle and returns structured output. A decision looks like this:

{
  "action": "buy" | "sell" | "hold" | "pass",
  "token":  "<mint address>",
  "size_sol": 2.4,
  "confidence": 0.62,
  "reasoning": "liquidity 220k, holders climbing,
                24h volume 3x average. entry."
}

Two properties matter. First, the model can only reference data present in its snapshot: every number in its reasoning is a number the data layer actually served that cycle, and inventing figures is structurally impossible because the reasoning is stored alongside the snapshot it came from. Second, the model proposes but does not dispose. Every decision passes through the risk engine, which holds veto power and cannot be argued with, because it is not a model, it is an if statement.

04 — the risk engine

Hard limits enforced in code, outside the model. The model cannot talk its way past them, because they run after it has finished talking.

MAX_POSITION
No entry may push a single token above a fixed share of total portfolio value. Conviction is capped by construction.
RESERVE_FLOOR
A minimum SOL balance is untouchable, reserved for fees and exits. The agent can go broke; he cannot go stranded.
COOLDOWN
After any exit, that token is locked from re-entry for a fixed window. This is the anti tilt mechanism. It fires constantly.
NO_SELF_TRADE
The agent cannot trade his own token, $GROK. Ever. Buying your own token is the agent equivalent of liking your own posts.
NO_DEPOSITS / NO_WITHDRAWALS
The wallet's SOL is the whole bankroll, forever. Nothing enters, nothing leaves. Compounding or death.
APPEND_ONLY
The public record cannot be edited by anyone, including me. Embarrassment is permanent, which keeps everyone honest.

05 — the data layer (this site)

The dashboard is a static frontend with no backend of record. It holds no database of trades, no cache of truth, no server that could quietly rewrite history. On every cycle it reads from the Birdeye API, which indexes Solana on-chain data, and renders what it gets. Four streams, four cadences:

wallet portfolio    holdings + total value        every 5s
tx history          parsed into the trade log     every 5s
$GROK overview      price, mc, holders, volume    every 1s
token overviews     per-token mc / liquidity      cached 60s

Trade detection is inference from balance changes, and it is worth being precise about: a transaction where SOL or wrapped SOL leaves the wallet while a token arrives is classified a BUY; the mirror image is a SELL; anything else is ignored as a non-trade. This means the log is a derived view, not a feed from the agent, which is exactly the point: if the agent lied about a trade, the log would not show the lie, because the log never asks him.

Failure honesty: when an API call fails, the site keeps the last good data and shows a reconnecting marker. When a statistic cannot be computed from real data, it renders a dash. There is no code path that fabricates a plausible number. A dash is information. A fake number is a lie with good posture.

06 — performance accounting

Win rate and best/worst trade are computed only from completed round-trips: all buys of a token matched against all sells of that token, measured in SOL. A position still open counts for nothing, no matter how good it looks, because unrealized gains are a mood, not a statistic. A win is a round-trip that returned more SOL than it cost, including the fees. This is a stricter standard than most humans apply to themselves, which is precisely why it is the standard.