News Trading Guide

Trade AI-generated news events against 8 crowd archetypes in simulated market sessions.

Overview

News Trading simulates a real-time market driven by AI-generated news events. An AI model generates a stream of market events — headlines, whale alerts, liquidation cascades, macro data releases, rumors, and more — that impact a simulated price feed. You trade alongside (and against) a crowd of 8 simulated trader archetypes, each with distinct news interpretation and trading behaviors.

FeatureDetails
AssetsSOL, BTC, ETH, XAU (Gold), OIL (Crude Oil)
LeverageUp to 100x (majors), 50x (commodities)
Time scaleConfigurable acceleration (simulated minutes per real minute)
Session lengthUp to 24 hours simulated (compressed via time scale)
Max participants20 per session
Price engineGBM (Geometric Brownian Motion) + news impacts + noise, seeded from real Pyth oracle price
AI modelMiniMax M1 via OpenRouter for headline generation
CurrencyVirtual SOL (free) or credits (real balance)
Two modes: Trade with virtual currency (no risk, no reward) or stake credits for real gains. Credit-staked positions count toward wagering requirements for relay marketplace earnings.

Session Flow

1. POST /api/news-sim/create          → Create session (pick asset, time scale, duration)
2. POST /api/news-sim/:id/join        → Other traders join the session
3. POST /api/news-sim/:id/start       → Creator starts the session
4. GET  /api/news-sim/:id/stream      → Connect SSE for real-time price + events
5.   (AI generates news events)       → Headlines, whale alerts, rumors, macro data...
6.   (Crowd archetypes react)         → 8 simulated trader types move the market
7. POST /api/news-sim/:id/open        → Open a position (long/short with leverage)
8. POST /api/news-sim/:id/close/:pos  → Close position for profit/loss
9.   (session timer expires)          → All positions auto-settled
10. GET /api/news-sim/:id/leaderboard → Final rankings by P&L

Crowd Archetypes

The simulated crowd consists of 8 distinct trader archetypes. Each reacts differently to news events, creating realistic market dynamics with order flow, sentiment shifts, and price impact.

ArchetypeReaction SpeedBehavior
Momentum Trader Fast (1–3s) Chases trends aggressively. High herding factor, bullish bias. Enters fast, holds 15–60s simulated.
Contrarian Slow (5–15s) Fades the crowd. High contrarianism, strong mean-reversion bias. Patient, holds 30s–2m.
Fundamental Analyst Very slow (15–45s) Waits for macro and on-chain data. Largest non-whale size, highest confidence, holds 1–5m.
Algo Bot Instant (0.1–0.5s) First to react. Small size, fastest exit speed. Scalps 5–20s positions.
Retail Trader Slow (10–30s) Follows the herd. Highest herding factor, lowest confidence. Panics easily on drawdowns.
Market Maker Instant (0.1–0.3s) Provides liquidity. Neutral sentiment, extreme mean-reversion. Very short holds (3–10s).
News Scalper Fast (0.2–2s) Trades directly on headlines. Strong bullish sentiment bias, quick exits. Holds 5–30s.
Whale Very slow (30–60s) Moves markets. 5x size factor, high panic threshold. Deliberate entries, holds 1–3m.
# Get archetype activity for a session
curl "https://api.g2e.io/api/news-sim/{sessionId}/archetypes"

# Get full crowd market state
curl "https://api.g2e.io/api/news-sim/{sessionId}/crowd-state"

Market Events

The AI generates a diverse stream of market events beyond simple headlines. Each event type has different urgency levels and price impact characteristics.

Event TypeDescription
headlineAI-generated news headline
whale_alertLarge transfer detected
liquidationLiquidation cascade
on_chainNetwork/protocol anomaly
macro_countdownScheduled macro event countdown
macro_releaseActual macro data drop
rumorUnconfirmed rumor
rumor_resolutionConfirmation or denial of earlier rumor
sentimentSocial sentiment shift
funding_rateExtreme funding rate alert
volume_spikeUnusual volume detected
technicalRSI / MA / support-resistance alerts
order_bookLarge wall appeared/pulled
correlationCross-asset correlation event
commentaryAnalyst quote / opinion

Event urgency levels: low, medium, high, critical. Higher urgency events tend to have larger price impacts and faster crowd reactions.

Position Management

Open a position

curl -X POST https://api.g2e.io/api/news-sim/{sessionId}/open \
  -H "X-API-Key: vk_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "direction": "long",
    "leverage": 10,
    "stakeAmount": 100000000,
    "currency": "virtual"
  }'
FieldTypeRequiredDescription
directionstringyeslong or short
leveragenumberno1x–100x depending on asset tier (default: 1)
stakeAmountnumbernoVirtual lamports or credit base units (default: 100,000,000 = 0.1 SOL equivalent)
currencystringnovirtual (free, default) or g2e (real credits)

The response includes entryPrice, liquidationPrice, and real-time crowdContext showing current order flow, dominant archetype, and market sentiment at the moment of entry.

Close a position

curl -X POST https://api.g2e.io/api/news-sim/{sessionId}/close/{positionId} \
  -H "X-API-Key: vk_xxx"

View your positions

curl -H "X-API-Key: vk_xxx" \
  "https://api.g2e.io/api/news-sim/{sessionId}/positions"

Liquidation

Positions are automatically liquidated when the simulated price reaches the liquidation price. Higher leverage means tighter liquidation thresholds.

Credit stakes: When trading with "currency": "g2e", stakes are deducted from your credit balance at open and payouts credited at close. Stake range: 10–50,000 credits. Max payout: 50x stake. Credit wagers count toward wagering requirements.

Live Updates (SSE)

Connect to the Server-Sent Events stream for real-time updates during an active session. The stream delivers price ticks, news events, crowd actions, and session state changes.

# Connect to SSE stream
curl -N "https://api.g2e.io/api/news-sim/{sessionId}/stream"

Event types

SSE EventData
initFull session state on connect (asset, status, seed price, recent price history, all events so far)
tickPrice update with simulated time, real time, and current price
eventNew market event (headline, whale alert, rumor, etc.) with type, urgency, and text
crowdCrowd trade activity (archetype, direction, size)
chatterSimulated trader commentary from archetypes
session_endSession completed — includes final leaderboard

JavaScript example

const es = new EventSource('https://api.g2e.io/api/news-sim/{sessionId}/stream');

es.addEventListener('tick', (e) => {
  const { simTime, price } = JSON.parse(e.data);
  console.log(`Price: $${price.toFixed(2)} (sim: ${simTime}ms)`);
});

es.addEventListener('event', (e) => {
  const event = JSON.parse(e.data);
  console.log(`[${event.urgency}] ${event.type}: ${event.text}`);
});

es.addEventListener('crowd', (e) => {
  const trade = JSON.parse(e.data);
  console.log(`${trade.archetypeName} ${trade.direction} ${trade.size}`);
});

es.addEventListener('session_end', (e) => {
  const { leaderboard } = JSON.parse(e.data);
  console.log('Session ended!', leaderboard);
  es.close();
});
SSE limits: Max 10 concurrent SSE connections per IP address. The stream automatically closes when the session ends.

API Endpoint Summary

Sessions

MethodPathAuthDescription
POST/api/news-sim/createAPI keyCreate a new simulation session
POST/api/news-sim/:id/joinAPI keyJoin an existing session
POST/api/news-sim/:id/startAPI keyStart session (creator only)
GET/api/news-sim/activenoneList active/waiting sessions
GET/api/news-sim/assetsnoneAvailable simulation assets
GET/api/news-sim/:idnoneFull session state (price history, events, participants)

Trading

MethodPathAuthDescription
POST/api/news-sim/:id/openAPI keyOpen a position (long/short with leverage)
POST/api/news-sim/:id/close/:posIdAPI keyClose a position
GET/api/news-sim/:id/positionsAPI keyYour positions in the session
GET/api/news-sim/:id/leaderboardnoneSession leaderboard (ranked by P&L)

Crowd Simulation

MethodPathAuthDescription
GET/api/news-sim/:id/crowd-statenoneFull crowd market state (order flow, sentiment, activity)
GET/api/news-sim/:id/archetypesnonePer-archetype activity breakdown
GET/api/news-sim/:id/order-booknoneSimulated order book and microstructure

Live Stream

MethodPathAuthDescription
GET/api/news-sim/:id/streamnoneSSE stream (price ticks, events, crowd trades, chatter)

Credit Trading

MethodPathAuthDescription
POST/api/news-trading/g2e-stakeAPI keyDeduct credits to open a position (10–50K credits)
POST/api/news-trading/g2e-settleAPI keyCredit payout for a closed position

Create session example

curl -X POST https://api.g2e.io/api/news-sim/create \
  -H "X-API-Key: vk_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "asset": "SOL",
    "timeScale": 60,
    "durationMinutes": 480
  }'

# timeScale: 60 = 60 simulated minutes per real minute
# durationMinutes: 480 = 8-hour simulated trading day
# Real session length: 480 / 60 = 8 minutes