id string | symbols list | days list | source string | split string |
|---|---|---|---|---|
bsc-cg-2026-05-26_2026-10-22 | ["ETH","XRP","DOGE","ADA","LINK","BCH","TON","LTC","AVAX","SHIB","DOT","UNI","AAVE","ATOM","FIL","IN(...TRUNCATED) | [{"date":"2026-05-26T00:00:00","timestamp":1779753600000,"quotes":[{"id":0,"name":"ETH","symbol":"ET(...TRUNCATED) | coingecko | full |
Conviction Gym
An RL environment for conviction-based crypto trading plus a Beam agent-trace dataset — built for the Build with Beam challenge.
Unlike a backtest where the strategy is baked into the loop, this
environment owns only the physics (mark-to-market, 1% slippage, gas,
bankroll constraints). Every decision — enter / exit / partial / hold — is
an agent action. It works for classic RL policies (structured Dict
observation, MultiDiscrete([K,4,3]) action space) and LLM agents
(env.render() emits a compact text market snapshot per step).
Built from the production Early, Not Wrong autonomous trading agent.
What's inside
| path | contents |
|---|---|
episodes.json |
150 real market days (2026-05-26 → 2026-10-22) × 26 BSC tokens — CoinGecko prices/mcap/volume + alternative.me Fear & Greed, kline slices for RSI(14) |
traces/ |
360 Beam rollout steps as JSONL: observation_text + reasoning + action + reward + token usage, tagged by reasoning_effort (minimal…max) and max_tokens budget (1024 / 8192) |
code/ |
The environment: TypeScript reference impl + cross-validated Python Gymnasium port (pip install -e code/python) |
Headline findings
Beam (reflection/Beam-1.0-501B-A23B) played the env as its policy —
one JSON action per market day.
1. The completion-budget trap hits agentic loops. At
max_tokens=1024, high/max effort truncated on 23–24/30 steps
(finish_reason=length, empty answer → forced hold). The trap isn't a
QA-only phenomenon — on sequential tasks it silently turns "think hard"
into "do nothing" (and here it helped the score: doing nothing beat
Beam's own trading).
2. With a fair budget the effort dial is non-monotonic. At
max_tokens=8192 on the choppy eval window:
| effort | return | trades | reason tok/step |
|---|---|---|---|
| minimal | −4.9% | 24 | 201 |
| low | −4.1% | 12 | 680 |
| medium | −6.5% | 34 | 1,589 |
| high | −5.0% | 26 | 2,395 |
| max | −4.2% | 28 | 2,883 |
More thinking → more churn, not more return. Every level underperformed the conviction heuristic (−1.7%), random (−1.9%) and buy & hold (−1.9%).
3. In a trending window Beam beats the heuristic. On the window
where the production conviction strategy made +9.6%, Beam at max made
+12.9% — it traded less and held longer. Beam's trading skill is
regime-dependent; the dial buys different decisions, not reliably
better ones.
Caveats: single window per cell, one rollout per level, temperature 0.2,
assisted mode. Every cell is rerunnable (run-beam.ts --sweep <level>).
Quickstart
import json, conviction_gym as cg
specs = json.load(open("episodes.json"))
env = cg.ConvictionGymEnv(specs[0], {"mode": "assisted"})
obs, _ = env.reset()
obs, reward, done, _, info = env.step(env.action_space.sample())
Run Beam yourself (any OpenAI-compatible endpoint):
pip install -e code/python
python -m conviction_gym.rollout --policy beam --effort max \
--episodes episodes.json --traces my-traces.jsonl
Trace schema
{"episode_id": "bsc-cg-…-w4", "policy": "beam:Beam-1.0-501B-A23B",
"reasoning_effort": "max", "step": 12, "date": "2026-10-05",
"observation_text": "Day 13 (2026-10-05) | regime: …",
"reasoning": "…", "action": {"symbolIndex": 3, "op": "enter", "size": "standard"},
"reward": 0.41, "portfolioValueUsd": 993.2,
"usage": {"promptTokens": 2140, "completionTokens": 1180,
"reasoningTokens": 1050, "latencyMs": 5120}}
- Downloads last month
- 186

