Skip to main content

Documentation 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.

Circuit breakers are hard stops that halt trading when conditions indicate the system or market is in a state where continued trading is likely to destroy capital. They are not soft warnings — they unconditionally block new position opens, and some permanently halt the trader until a manually initiated restart.
Circuit breaker state (except daily drawdown reset) persists for the duration of the current process. If the halted flag is set, the only way to resume trading is to restart the process with a funded wallet and a clear understanding of what triggered the halt.

Active circuit breakers

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 for the remainder of the session. This is a permanent halt within the current process — it requires a manual restart.The 0.08 SOL threshold is intentionally set above the Jito tip cost of 0.0002 SOL per trade round-trip. This ensures there is always enough SOL to execute a sell transaction even if the trader has somehow entered a position it shouldn’t have.
Position sizing accounts for the minimum balance reserve directly: size = min(size, balance - 0.08). This means positions shrink naturally as the balance approaches the floor, rather than halting abruptly at the threshold.

Anti-signal force exits

Anti-signals are not technically circuit breakers — they don’t block new trades — but they function similarly in terms of protecting capital. 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 can mean exiting a profitable position early if adversarial conditions are detected after entry. The cost of leaving profit on the table is considered far smaller than the risk of holding through a coordinated dump.
Anti-signals are generated by the AntiSignalEmitter service and published on the same trade:signals Redis channel as buy signals. They carry a severity field (count of risk triggers that fired, minimum 2) and a human-readable reasons array.

Interaction with position sizing

The circuit breaker minimum balance is factored directly into position sizing:
size = min(size, balance - 0.08)
This means a trader at 0.12 SOL will size at most 0.04 SOL into a new position. As the balance approaches the 0.08 SOL floor, positions become progressively smaller until the minimum position size check (min_position = 0.05 SOL) causes trades to be skipped entirely, well before the hard halt triggers.

State persistence

StatePersistenceReset
halted (minimum balance)In-memory, session onlyManual process restart
Daily drawdown haltIn-memory, session onlyMidnight UTC (daily reset timer)
Consecutive loss cooldownIn-memory, session onlyAutomatic after 15 minutes
All circuit breaker state is in-memory only and resets on process restart. This is intentional — a restart is a deliberate human action that implicitly acknowledges the halt condition and provides an opportunity to assess what caused it before resuming.

Monitoring circuit breaker status

The most direct way to see whether a circuit breaker has fired is to check the logs — the trader emits a warning with the specific reason every time a circuit breaker blocks a trade. For a database view of recent performance, use these queries:
SELECT
  current_balance,
  total_pnl,
  total_trades,
  total_wins,
  ROUND(total_wins::numeric / NULLIF(total_trades, 0) * 100, 1) AS win_rate_pct
FROM live_portfolio
WHERE is_active = TRUE;
A trader that has halted due to minimum balance will show no recently closed trades and no open positions. A consecutive loss cooldown will show a run of recent closed trades all with negative P&L.

Monitoring

Full reference for PostgreSQL tables, pipeline stats, and key log patterns.

Strategies

How position sizing interacts with phase gating and the minimum balance reserve.

Build docs developers (and LLMs) love