The live trader writes its complete state to PostgreSQL on every position open and close, logs structured output for every decision it makes, and surfaces pipeline health through theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/alphaleaks60-maker/docs2/llms.txt
Use this file to discover all available pages before exploring further.
/api/stats endpoint. This page covers what to watch, where to find it, and what the values mean.
PostgreSQL tables
live_portfolio
Thelive_portfolio table is the single source of truth for overall performance. It tracks the running portfolio state across all trades:
| Field | Description |
|---|---|
current_balance | Available SOL balance (not including deployed capital in open positions) |
total_pnl | Cumulative net profit and loss across all closed trades, in SOL |
total_trades | Total number of closed positions |
total_wins | Number of closed positions with positive net P&L |
total_losses | Number of closed positions with negative net P&L |
current_streak | Positive integer for win streak, negative for loss streak |
is_active | Whether this is the currently running portfolio instance |
live_trades
Thelive_trades table records one row per trade, updated on entry and again on exit:
| Field | Description |
|---|---|
token_mint | The Pump.fun token mint address |
strategy | The strategy name that opened the position (e.g. reach_2x_1h) |
entry_price | SOL price per token at time of buy |
exit_price | SOL price per token at time of sell (null if position still open) |
position_size_sol | Amount of SOL deployed |
exit_reason | One of: take_profit, trailing_stop, stop_loss, timeout, anti_signal |
net_pnl | Net profit or loss in SOL after Jito tip costs |
entry_time | Timestamp of the buy transaction |
exit_time | Timestamp of the sell transaction (null if still open) |
status | open or closed |
Pipeline stats
The/api/stats endpoint returns a snapshot of the full pipeline state. Poll this endpoint to verify that the upstream data pipeline is healthy before attributing poor signal quality to the live trader.
| Field | Healthy | Warning |
|---|---|---|
ws.connected | true | false — pipeline not receiving on-chain data |
ws.eventsPerSec | 20–200+ (market dependent) | Near 0 — possible WebSocket disconnect |
models.fallbacks | 0 | Rising — ML inference degraded, signals using rule-based scoring |
wallets.scored | Growing over time | Stagnant — feature computation may have stalled |
regime.state | Any valid state | bear — signal quality is typically lower across the board |
Live feed as a health signal
The SSE stream itself is a health indicator. A healthy pipeline emits aheartbeat event every 15 seconds. If the heartbeat stops while the connection stays open, the upstream pipeline has stalled at the WebSocket level.
Anti-signal rate
Anti-signals appear on the feed asdata.type === 'anti_signal'. A healthy market produces a low but non-zero rate of anti-signals. A sudden spike across multiple tokens simultaneously usually indicates a coordinated campaign or a broader shift toward lower-quality tokens.
Anti-signal payloads include a severity field (count of triggers that fired, minimum 2) and a reasons array:
Checking system health
A healthy live trader will show all of the following:Process is running and logging
The process should emit a log line for every signal received, including the score and the strategy selection decision (or the reason a trade was skipped).
Models are loaded
models.loaded is 4 (or the number of ONNX model files present on disk). models.fallbacks is 0 or very low.live_portfolio shows recent activity
The
total_trades count in live_portfolio should increment as positions close. If it has been static for many hours during market hours, a circuit breaker may be active.Key log patterns
- Backlog warnings
- Model drift
- Circuit breakers
- Anti-signal exits
The WebSocket subscriber maintains a backlog counter. If pending events exceed 10, a warning is emitted:A sustained backlog means the pipeline is processing events slower than they arrive. Signals emitted during a backlog period may be delayed, which can affect entry timing.
Performance reporting
For a quick performance summary across a time window:Market regime context
The current market regime affects signal quality across all strategies. The regime is reclassified every 10 minutes and available in/api/stats under regime.state:
| State | Meaning for the live trader |
|---|---|
bull_euphoria | High graduation rates and strong volume. ML probability outputs tend to be higher across the board. |
bull_normal | Standard positive conditions. |
transition | Market dynamics shifting. Elevated uncertainty — model confidence may be less reliable. |
bear | Low graduation rates, thin volume. Signal quality tends to be lower; more trades may exit via stop loss. |
bear or transition, the cause may be macromarket, not a problem with the trader.
Circuit breakers
Trigger conditions, reset behaviour, and SQL queries for diagnosing halts.
Market regime
How the 4-state regime classifier works and how it affects signal quality.
ML models
ONNX model architecture, calibration, and hot-reload behaviour.
API overview
Full reference for the /api/stats endpoint and live feed.