Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/0xW1re/solvedocs/llms.txt

Use this file to discover all available pages before exploring further.

The live trader protects capital through a layered set of automatic controls. Some are hard stops that permanently halt trading until a manual restart; others are soft cooldowns that resume automatically. Together they ensure the system does not continue trading into conditions where the signal quality or market environment makes further losses likely.

Minimum balance reserve

if balance < 0.08 SOL → halt permanently
If available balance drops below 0.08 SOL, the trader sets halted = true and opens no further positions. This state persists for the current session — trading does not resume until the trader is manually restarted with a funded wallet. The threshold is deliberately set above the cost of executing a sell, ensuring there is always enough SOL to exit any open position cleanly. The reserve also factors into position sizing before the halt threshold is reached:
size = min(size, balance - 0.08)
This means positions become progressively smaller as the balance approaches the minimum, rather than running at full size and then suddenly halting.
The halted flag is in-memory only. It resets on process restart, which is treated as a deliberate human action that acknowledges the halt condition. Restarting without investigating the cause of the halt will resume trading immediately.

Daily drawdown limit

equity = available_balance + total_open_position_sol
drawdown = (day_start_equity - equity) / day_start_equity

if drawdown ≥ 30% → halt until midnight UTC
If total portfolio value — available SOL plus deployed SOL in open positions — drops 30% from the day’s starting value, trading halts until midnight UTC. The daily halt resets automatically via a midnight UTC timer. The drawdown calculation uses total equity, not just available balance. Opening positions does not itself trigger drawdown — deployed capital is still counted as equity. Drawdown only increases when deployed capital actually loses value.

Phase-based position limits

The number of concurrent positions the trader may hold at any time is determined by its current phase:
PhaseBalance thresholdMax concurrent positions
10.2 SOL+1
21.0 SOL+2
310.0 SOL+5
When all slots for the current phase are occupied, incoming signals are evaluated but no buy is submitted. The slot check is one of the six eligibility criteria evaluated during strategy selection.

Consecutive loss cooldown

if consecutive_losses ≥ 5 → cooldown for 15 minutes
consecutive_losses resets to 0 after any winning trade
Five consecutive losing trades triggers a 15-minute trading pause. This is a soft circuit breaker — trading resumes automatically when the cooldown expires. The consecutive loss counter resets after any winning trade, not just after the cooldown ends. Five consecutive losses may indicate that signal quality has temporarily degraded — for example, a rapid market regime shift that the detector has not yet classified — or that the models are encountering a distribution they were not trained on. A brief pause is preferable to continuing to trade into worsening conditions.

Per-token cooldown

After closing any position on a token, that token enters a 30-minute cooldown. The trader will not re-enter the same token within this window, regardless of how strong the next signal appears. This prevents re-entry on tokens that have already pumped and dumped, where the signal system may still emit buy signals from wallets who are now stuck. The cooldown applies regardless of the reason for the close.

Score threshold and dead probability gates

Before a strategy is selected, two probability checks run against the ML model’s output:
  • Score threshold: the calibrated buy probability must meet or exceed the strategy’s score_threshold (80% for standard strategies, 90% for most genesis strategies)
  • Dead probability veto: the dead_prob output must be below the strategy’s dead_threshold — strategies that define a dead threshold will not trade if the model considers the token likely to go to zero
Both checks must pass. A signal with a high buy probability but an elevated dead probability is vetoed by the dead threshold.

Anti-signal force exits

When an anti_signal arrives for a token with an open position, the position is force-exited immediately — regardless of current price, profit, or hold time. This takes priority over all other exit logic, including take profit. Anti-signals are generated when the adversarial detection layer identifies conditions that make continued holding dangerous: coordinated dumps, high bot concentration, creator rug history, or other risk triggers. Exiting a profitable position early is considered a small cost compared to holding through a coordinated exit.
Anti-signals do not themselves block new trades on other tokens. They are position-specific exits, not system-wide halts. A burst of anti-signals across many tokens simultaneously is worth monitoring as a leading indicator of broader market deterioration.

Simulation mode

The live trader can be run in simulation mode where every circuit breaker, sizing calculation, and strategy selection executes exactly as in live mode — but no transactions are submitted on-chain. All decisions, including halts and cooldowns, are logged in full. Simulation mode is the recommended way to validate a new model or strategy configuration before deploying capital. It exercises the full decision path, so the logged output is directly comparable to what live mode would produce.

Observing circuit breaker status

The trader logs a warning with the reason every time a circuit breaker blocks a trade. The /api/stats endpoint reflects the current portfolio state. A natural external indicator of a halt or cooldown is the absence of new position-open events on the live feed while the signal stream continues to emit events normally.

Build docs developers (and LLMs) love