
How it works
One pass,
six stages,
a colony at the end
Observe
Quotes and daily bars come from the Robinhood Trading MCP when a token exists. Without one, CORAL generates a deterministic synthetic series seeded per symbol, so the same ticker produces the same tape on every run. An observation is labelled with its source and that label travels into the polyp, so a decision made on synthetic data can never be mistaken for a real one.
{ symbol: "NVDA", price: 182.44, change24h: 0.011,
rsi14: 31.2, sma20: 179.8, momentum20: 0.043,
volatility: 0.024, source: "robinhood-mcp" }Recall
Before reasoning, CORAL asks its own past what resembles this. Recall is a weighted blend of token overlap, exponential recency decay on a thirty-day half-life, outcome weight, symbol match, and shared tags. Losses are weighted as loudly as wins on purpose: the polyp that lost money is the most valuable row in the reef.
score = 0.50·text + 0.22·recency + 0.18·outcome
+ 0.10·sameSymbol + 0.05·tags
# coral reef 'NVDA oversold' --why
# 4e89b847 text 0.34, same symbol, loss → 1.00Reason
With a key, one structured call per basket. The model sees reef state, every observation, and the recalled polyps verbatim, and returns a typed decision per symbol. Without a key, or if the call fails, a deterministic heuristic decides instead. It scores mean reversion, trend continuation, reef bias, an overbought penalty, a volatility penalty, and a scar penalty when recall contains two losses. The pipeline downstream is identical.
if (rsi14 < 35 && momentum20 > 0) score += 0.40
if (momentum20 > 0.015 && price > sma20) score += 0.30
if (bias < -0.2) score -= 0.25
if (lossesInRecall >= 2) score -= 0.20 // scarred
action = score >= 0.25 ? "buy" : "hold"Gate
The risk manager runs after the model has spoken and before anything touches a venue. It is not a prompt, so the model cannot argue with it. Every check returns a reason string, because a rejection without a justification is useless to whoever reads the reef later. The gate can scale an order down instead of refusing it, and it records what it scaled from.
confidence 0.68 ≥ minConfidence 0.55 ok
notional 250 ≤ maxOrderUsd 250 ok
deployed 300 + 250 ≤ maxDeployedUsd 2500 ok
NVDA exposure 0 + 250 ≤ cap 625 ok
consecutiveLosses 0 < 4 ok
→ allowed, notional $250.00Settle
Polyps older than an hour get judged by price. A buy polyp wins if price moved up more than one percent and loses below minus one. A sell polyp is inverted. A hold has no position, so it realises nothing and settles neutral. That last rule matters: counting a flat tape as a win is how a reef ends up advertising a hundred percent on zero profit.
move = (price - entry) / entry
buy → move > 0.01 ? "win" : move < -0.01 ? "loss" : "neutral"
sell → move < -0.01 ? "win" : move > 0.01 ? "loss" : "neutral"
hold → "neutral" // no position, no resultCalcify
Every decision from the pass becomes a polyp, including the ones the gate refused. Those are tagged gated and hold the rejection reason in their artifacts. A pass that settled older polyps also writes a reflection. Nothing is dropped for being embarrassing, which is the whole point of a reef.
{ kind: "trade", action: "buy", confidence: 0.68,
thesis: "BUY · rsi 31 · mom 4.3% · 24h 1.1% · 6 polyps recalled",
tags: ["mean-reversion", "oversold", "sanctioned"],
outcome: "pending", pnl: 0,
artifacts: { observation, recalled, gate, execution, runId } }What a polyp actually is
One row in SQLite, Zod-validated on the way in and append-only in spirit. A polyp is never rewritten to look sharper in hindsight. Only outcome and pnl are filled in later, when the market has judged it.
kindobservation, decision, trade, reflection, or skill. Only decisions and trades are scored.agentwhich host made the call, so a Claude-shaped decision and a Codex-shaped one stay distinguishable.thesisthe falsifiable sentence. Everything recall scores against lives here.confidencezero to one, and a hard gate input. Dishonest confidence gets sized down or refused.outcome, pnlfilled in by settle. Never set at write time, because that would be marking your own homework.tagsthe zones. coral evolve groups by tag and reweights each zone by its smoothed win rate.artifactsfrozen evidence: the observation, recall ids, the gate verdict, the execution. JSON, never re-derived.What evolving changes
It reweights routing. Each zone gets a Laplace-smoothed win rate, (wins+1)/(decided+2), so three lucky wins do not read as a hundred percent edge. Zones above 0.60 are promoted, below 0.42 demoted, and a zone with five losses and no wins is retired.
Demoted does not mean deleted. A demoted skill still routes, it just loses ties to a stronger one. The reef reweights, it does not forget.
It is deliberately not self-modifying. No prompt rewrites the prompt, no generated code gets promoted to production. A trading agent that can edit its own rules is a liability.
Evolution · generation 2
promoted momentum, mean-reversion
demoted overbought-chase
retired -
Notes
· promoted: momentum, mean-reversion
· demoted: overbought-chase, still routes
but loses ties$ coral evolve
Evolution · generation 2
promoted -
demoted -
Notes
· not enough evidence yet: 3 zones, none
with 3+ polyps. Reef needs more decisions
before it can be judged.Next: what stops this from being a very eloquent way to lose money.
Safety and risk