Rules Engine
The decision-making core of ClashX.
Core Execution System
The rules engine evaluates bot strategy graphs against live market data and produces a list of actions to execute. It's the core system that takes user intent and translates it into on-chain Pacifica orders.
Supported Conditions
The rules engine supports over 50 approved condition types across several categories:
Price Conditions
price_above/price_belowprice_change_up/price_change_downprice_crosses_above/price_crosses_below
Indicator Conditions
rsi_above/rsi_belowsma_crossover/ema_crossovermacd_bullish/macd_bearishbollinger_bands_breakout
Supported Actions
When conditions are met, the engine emits actions. Available actions include:
open_long / open_short// Initiate a new positionclose_position / close_all_positions// Exit active tradesset_stop_loss / set_take_profit// Defensive order placementscale_in / scale_out// Partial position sizingpause_bot// Hard-stop automation based on severe risk triggersValidation Pipeline
Before a strategy graph can be deployed, it passes through rigorous structural validation:
Topology checks
Enforces no cycles, no orphan action nodes, single root per isolated logic tree.
Risk enforcement
Asserts that every open_ node has a reachable stop-loss path.
Parameter checks
Verifies schema compliance for numeric thresholds.