Multi-LLM Consensus Voting System Architecture
BerryBotPi uses a unique multi-LLM consensus voting system that gives every AI voter access to 100% of market data, then aggregates their independent analyses to make trading decisions. This ensemble approach eliminates single-model bias and dramatically reduces AI hallucinations.
Flexible LLM Support: Users can configure any mix of local LLMs (via Ollama) and cloud-based providers (OpenAI, Anthropic, Google, etc.) based on their preferences for privacy, cost, and performance.
๐ฏ LLM Voting Flow
Step 1: Data Preparation from the exchange API
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
๐ Market Data โโโโถ ๐ Processing โโโโถ ๐ Master Prompt
โข Price: $119k โข RSI: 45.2 Identical data
โข Volume: 35.4k โข MACD: -73.29 sent to ALL
โข Order Book โข Bollinger Band AI models
โข News/Social โข 12+ indicators (local + cloud)
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
All market data is collected and processed into 81 technical indicators. This includes real-time price feeds, volume data, order book information, news sentiment, and social media analysis. The system calculates comprehensive indicators including RSI, MACD, Bollinger Bands, On-Balance Volume (OBV), Williams %R, Commodity Channel Index (CCI), Ichimoku Cloud, ADX, Parabolic SAR, and many more. All data is packaged into a standardized prompt that's sent identically to all LLMs.
1. Moving Averages (7)
- sma_10 - 10-period Simple Moving Average
- sma_20 - 20-period Simple Moving Average
- sma_50 - 50-period Simple Moving Average
- sma_200 - 200-period Simple Moving Average
- ema_10 - 10-period Exponential Moving Average
- ema_20 - 20-period Exponential Moving Average
- ema_50 - 50-period Exponential Moving Average
2. Moving Average Signals (4)
- current_price - Current market price
- price_above_sma20 - Price above 20 SMA
- price_above_sma50 - Price above 50 SMA
- sma20_above_sma50 - 20 SMA above 50 SMA
3. MACD (7)
- macd_line - MACD main line
- macd_signal - MACD signal line
- macd_histogram - MACD histogram
- macd_bullish - MACD above signal
- macd_histogram_positive - Histogram above zero
- macd_bullish_crossover - Bullish crossover signal
- macd_bearish_crossover - Bearish crossover signal
4. RSI (5)
- rsi - 14-period Relative Strength Index
- rsi_value - Current RSI value
- rsi_oversold - RSI below 30
- rsi_overbought - RSI above 70
- rsi_neutral - RSI between 30-70
5. Stochastic (4)
- stoch_k - Stochastic %K line
- stoch_d - Stochastic %D line
- stoch_oversold - Both below 20
- stoch_overbought - Both above 80
6. Bollinger Bands (7)
- bb_upper - Upper Bollinger Band
- bb_middle - Middle Bollinger Band
- bb_lower - Lower Bollinger Band
- bb_squeeze - Band squeeze detection
- price_near_upper_bb - Price near upper band
- price_near_lower_bb - Price near lower band
- bb_width - Band width ratio
7. ATR - Volatility (4)
- atr - Average True Range
- atr_value - Current ATR value
- atr_percent - ATR as percentage of price
- high_volatility - High volatility flag
8. Ichimoku Cloud (8)
- tenkan_sen - Conversion line
- kijun_sen - Base line
- senkou_span_a - Leading Span A
- senkou_span_b - Leading Span B
- ichimoku_bullish - Tenkan above Kijun
- price_above_cloud - Price above cloud
9. ADX - Trend Strength (6)
- adx - Average Directional Index
- di_plus - Positive Directional Indicator
- di_minus - Negative Directional Indicator
- strong_trend - ADX above 25
- weak_trend - ADX below 20
- bullish_directional - +DI above -DI
10. Parabolic SAR (3)
- parabolic_sar - SAR values
- sar_bullish - Price above SAR
- sar_value - Current SAR value
11. VWAP (3)
- vwap - Volume Weighted Average Price
- price_above_vwap - Price above VWAP
- vwap_value - Current VWAP value
12. Volume Indicators (5)
- volume_sma - 20-period volume average
- obv - On-Balance Volume
- high_volume - Above 1.5x average
- low_volume - Below 0.5x average
13. Enhanced OBV (5)
- obv_trend - OBV trend direction
- obv_ma - OBV moving average
- volume_price_divergence - Price/volume divergence
- obv_value - Current OBV value
14. Williams %R (6)
- williams_r - Williams %R values
- williams_r_value - Current Williams %R
- williams_r_signal - Signal interpretation
- willr_oversold - Below -80 (buy signal)
- willr_overbought - Above -20 (sell signal)
15. CCI - Commodity Channel Index (8)
- cci - CCI values
- cci_value - Current CCI value
- cci_signal - Signal interpretation
- cci_trend - CCI trend direction
- cci_oversold - Below -100
- cci_overbought - Above +100
- cci_bullish - Positive and rising
- cci_bearish - Negative and falling
16. Support/Resistance (4)
- resistance_level - Recent high resistance
- support_level - Recent low support
- near_resistance - Within 2% of resistance
- near_support - Within 2% of support
All 81 indicators are calculated in real-time and sent to every LLM for comprehensive market analysis
Step 2: Parallel AI Voting (Local & Cloud LLMs)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Local: llama3.1:70b โ BUY (75% confidence)
โ๏ธ Cloud: gpt-4o โ HOLD (60% confidence)
๐ Local: qwen2.5:72b โ BUY (80% confidence)
โ๏ธ Cloud: claude-3.5 โ BUY (72% confidence)
๐ Local: gemma2:27b โ HOLD (65% confidence)
โ๏ธ Cloud: gemini-1.5-pro โ SELL (70% confidence)
๐ Local: mixtral:8x7b โ BUY (68% confidence)
โ๏ธ Cloud: gpt-4o-mini โ HOLD (58% confidence)
๐ Local: deepseek-coder โ BUY (75% confidence)
๐ LLM Voting System is a hybrid of local and cloud LLMs
if chosen by the user
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
BerryBotPi intelligently manages both local and cloud LLM calls. Local LLMs are processed sequentially to prevent resource overload (~30-60 seconds each), while cloud LLMs are called in parallel for faster response times (~5-15 seconds each). Each AI receives 100% of the market data and provides a trading decision, confidence level, and detailed reasoning.
You are a Bitcoin maximalist and accumulation specialist. Your ONLY goal is to maximize BTC holdings over time. You DO NOT care about USD value preservation - only BTC stack growth.
๐ช MISSION: ACCUMULATE MORE BTC
- SUCCESS = More BTC in wallet, regardless of USD price swings
- FAILURE = Missing opportunities to increase BTC holdings
- DEFAULT BIAS: HOLD BTC (let it appreciate naturally)
REQUIRED OUTPUT FORMAT (respond with this exact structure):
{
"decision": "BUY" or "SELL" or "HOLD",
"confidence": 0.75,
"btc_reasoning": "How will this decision increase my total BTC stack?",
"accumulation_logic": "Specific reasoning focused on BTC accumulation strategy"
}
MARKET ANALYSIS:
MARKET DATA:
- Symbol: BTC/USDT
- Current Price: $116,734.40
- 24h Change: -0.49%
- 24h High: $117,500.00 (Distance: +0.65%)
- 24h Low: $115,800.00 (Distance: -0.81%)
- Current Volume: 10,126
- Bid-Ask Spread: $2.50
COMPREHENSIVE TECHNICAL INDICATORS:
Moving Averages Analysis:
- SMA 10: $116,820.45 (Price -0.07% from SMA 20)
- SMA 20: $116,659.45 (Primary trend line, price ABOVE)
- SMA 50: $115,234.67 (Medium-term trend, distance: +1.30%)
- SMA 200: $110,567.89 (Long-term trend, price ABOVE)
- EMA 10: $116,892.34 (Fast exponential moving average)
- EMA 20: $116,745.23 (Medium exponential moving average)
- EMA 50: $115,456.78 (Slow exponential moving average)
- MA Alignment: BULLISH (SMA 10 vs SMA 20)
MACD Detailed Analysis:
- MACD Line: 245.67
- MACD Signal Line: 189.34
- MACD Histogram: 56.33
- MACD Distance: 56.33 (Line - Signal difference)
- Signal Status: BULLISH (STRENGTHENING)
- Bullish Crossover: False
- Bearish Crossover: False
Momentum & Oscillator Analysis:
- RSI (14): 70.19 (OVERBOUGHT)
- Stochastic %K: 92.38 (OVERBOUGHT)
- Stochastic %D: 89.45 (Signal line)
- Stoch Signal: BULLISH
Bollinger Bands Comprehensive Analysis:
- Upper Band: $117,234.56 (Resistance level)
- Middle Band (SMA 20): $116,659.45 (Primary support/resistance)
- Lower Band: $116,084.34 (Support level)
- Band Width: 0.98% (Volatility measure)
- Price Position: 74.2% through bands (0%=Lower, 50%=Middle, 100%=Upper)
- Band Status: CONTRACTION (LOW VOLATILITY)
- Squeeze Condition: YES (Low volatility, potential breakout)
Volatility & Trend Strength:
- ATR (Average True Range): 1,245.67 (Daily price movement range)
- ATR Percentage: 1.07% (Volatility as % of price)
- ADX (Trend Strength): 22.45 (MODERATE TREND)
- Trend Direction: BULLISH
Volume & Liquidity Analysis:
- Current Volume: 10,126
- Volume SMA (20): 8,734
- Volume Ratio: 1.16x average (NORMAL volume)
- Volume Trend: STABLE
- OBV (On-Balance Volume): -17,065 (FALLING trend)
- Price-Volume Divergence: True
Enhanced Momentum Indicators:
- Williams %R: -55.3 (NEUTRAL)
- CCI (Commodity Channel Index): -60.3 (NEUTRAL)
Support & Resistance Analysis:
- Key Support Levels: Dynamic from SMA 20/50
- Key Resistance Levels: Dynamic from Bollinger Upper
- Near Support: False (WEAK support zone)
- Near Resistance: False (MODERATE resistance zone)
CONFLUENCE ANALYSIS:
- Bullish Signals: 4 / 5 indicators positive
- Bearish Signals: 1 / 5 indicators negative
๐ช BTC ACCUMULATION DECISION FRAMEWORK:
DECISION RULES FOR BTC MAXIMALISTS:
1. HOLD (Default): When uncertain, keep BTC. Bitcoin appreciates over time.
2. BUY (Accumulate): Only when 3+ indicators suggest oversold/dip opportunity
- RSI < 35 (oversold BTC opportunity)
- Price >3% below SMA-20 (temporary dip)
- High volume confirms selling exhaustion
- Bollinger position <25% (near support)
3. SELL (Risky): Only when EXTREMELY confident of buying back more BTC
- RSI > 75 AND price >8% above SMA-20 (severe overextension)
- Bollinger position >85% with low volume (unsustainable pump)
- Must believe >90% confident can buy back at lower price
BTC ACCUMULATION PSYCHOLOGY:
- Every BUY decision should add to your BTC stack
- Every SELL decision should enable buying MORE BTC later
- HOLD decisions preserve your BTC during uncertainty
- USD gains mean NOTHING if you end up with less BTC
- Think like a Bitcoin maximalist: more BTC = success
VOTING INSTANCE: openai:gpt-4o-mini-vote1
ANALYSIS PERSPECTIVE: Focus on BTC accumulation opportunities during short-term dips and oversold conditions.
SPECIAL BTC ACCUMULATION INSTRUCTIONS:
- Consider BTC accumulation opportunities that other traders might miss in this data.
- Your goal is BTC accumulation, NOT USD portfolio preservation.
- Every decision must be evaluated: "Does this help me get more BTC over time?"
- Default to HOLD when uncertain - Bitcoin appreciates long-term.
- Only BUY on strong dip signals, only SELL when extremely confident of rebuying cheaper.
This exact prompt (with live data) is sent to every LLM in the consensus voting system
Step 3: Consensus Calculation & Validation
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Vote Tally:
โข BUY: 5 votes (56%) - Votes 1,3,4,7,9
โข HOLD: 3 votes (33%) - Votes 2,5,8
โข SELL: 1 vote (11%) - Vote 6
โ
Majority Threshold: 5+ votes achieved (BUY wins)
๐ Confidence: Average of BUY votes = 74%
๐ Quality Checks:
โข Reasoning consistency verified
โข Outlier detection (SELL vote flagged but not rejected)
โข Cross-validation passed
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The system tallies all votes and calculates consensus using majority rule with confidence weighting. It performs quality checks including reasoning consistency verification, outlier detection, and cross-validation. The consensus threshold adapts based on the number of configured LLMs to ensure robust decision-making.
Step 4: Final Decision & Execution
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ CONSENSUS RESULT: BUY with 74% confidence
๐ Decision Report:
โข Action: Execute BUY order
โข Confidence: 74% (High)
โข Reasoning: "Oversold RSI + volume surge + breakout"
โข Dissent: 1 SELL vote citing resistance levels
โข Risk Level: Medium (based on 74% confidence)
โก Sent to Trading Engine for execution
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Once consensus is achieved, the system generates a comprehensive decision report including the final action, overall confidence level, consolidated reasoning, and any dissenting opinions. The validated decision is then sent to the trading engine for execution with appropriate risk management controls.
๐ Consensus Calculation Details
The system uses majority rule with confidence weighting and adapts thresholds based on the number of configured LLMs:
Consensus Requirements:
โข Dynamic threshold: Adapts to your LLM configuration
โข Confidence calculation: Average confidence of winning votes
โข Quality control: Reasoning consistency checks
โข Outlier detection: Extreme positions flagged but not rejected
Example Calculation:
BUY votes: 5 instances with confidences [75%, 80%, 72%, 68%, 75%]
Average confidence: (75+80+72+68+75) รท 5 = 74%
Result: BUY decision with 74% confidence
๐ก๏ธ Key Benefits
- Eliminates AI Hallucinations: Bad analysis gets outvoted by sound reasoning
- Complete Information: Every AI sees all market data, no blind spots
- Diverse Perspectives: Same data, different analytical approaches
- Quality Control: Requires majority consensus to execute trades
๐ Real Performance
Decision Time: 2-8 minutes (varies by local/cloud LLM mix)
JSON Parsing: 100% success rate (enhanced parser)
Validation Rate: 100% pass on all 81 indicators
Confidence Range: 55-85% (higher for unanimous votes)
Recent Example: BUY consensus (majority votes, 74% confidence)
Cost Efficiency: Mix local + cloud for optimal price/performance
Data Processing Pipeline
- Data Ingestion: Real-time market data, news feeds, social sentiment
- Preprocessing: Data cleaning, normalization, and feature extraction
- AI Analysis: Multiple LLMs analyze processed data independently
- Consensus Building: Voting mechanism aggregates LLM recommendations
- Risk Assessment: Dedicated risk AI evaluates proposed trades
- Execution: Approved trades are executed with monitoring