The live trader is a standalone process that subscribes to the signal channel, scores incoming signals using ONNX models loaded directly in-process, and executes buys and sells on the Pump.fun bonding curve. It runs alongside the main pipeline independently — it can be restarted, upgraded, or paused without affecting data collection or intelligence processing.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.
How it works
Signals arrive on a real-time channel. Each signal type routes to a different handler, then flows through portfolio management, execution, and exit monitoring:Inline scoring
Rather than waiting for the main pipeline’sMlInference service to score a signal and write it back to the database, the live trader runs ONNX inference inline — loading the same models and assembling the same feature vector independently. This eliminates the 5-second lag between signal emission and ML score availability.
The signal payload includes all the fields needed to build the feature vector, so no database round-trip is required. A decision is made within milliseconds of the signal arriving.
Inline scoring uses the same ONNX model files and calibration parameters as the main pipeline’s
MlInference service. The outputs are numerically identical — the only difference is where the computation runs.Strategy selection
When a signal arrives, the trader evaluates all strategies that are eligible given the current phase and balance. A strategy must pass all six criteria to be considered:- The ML model’s calibrated probability must meet or exceed the strategy’s
score_threshold - The
dead_probmust be below the strategy’sdead_threshold - The current phase must be ≥ the strategy’s
min_phase - A concurrent position slot must be available
- No position must already be open in that token
- The token must not be in per-token cooldown (30 minutes after a close)
Execution
TheTradeExecutor handles all on-chain execution:
Derive bonding curve account
The bonding curve account address is derived deterministically from the token mint, with no RPC lookup required.
Calculate expected output
The exact expected token output is calculated from the bonding curve math before the transaction is sent, so slippage is known in advance.
Exit monitoring
An exit monitor polls every 3 seconds for each open position, checking against real-time price data maintained in the cache layer by the pipeline’sCurveManager.
Four exit conditions are checked in order:
| Condition | Trigger | Log reason |
|---|---|---|
| Take profit | Current price ≥ entry × take_profit_multiple | take_profit |
| Trailing stop | Price dropped >15% from peak multiple | trailing_stop |
| Stop loss | Current price ≤ entry × stop_loss_multiple | stop_loss |
| Timeout | Hold time exceeded strategy’s max_hold_minutes | timeout |
anti_signal arrives for a token with an open position, the position is force-exited immediately regardless of current price, profit, or hold time. The anti-signal response takes priority over all other exit logic.
Simulation mode
The live trader can be run in simulation mode where every decision — score evaluation, strategy selection, position sizing, exit logic — executes exactly as in live mode, but no transactions are submitted on-chain. All decisions are logged in full detail.Persistence
Every trade is fully persisted to the database. On restart, the trader loads all open positions from the database and resumes monitoring them. No positions are lost across restarts. Thelive_portfolio table tracks the overall portfolio — current balance, total P&L, win count, loss count, and streak data — and is the single source of truth for performance reporting.