From ce42b8cadea3dfae5c7a02fe9b203a361ac15e90 Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Wed, 6 Aug 2025 00:45:53 +0200 Subject: [PATCH] feat: M2 Money Supply integration for Safe Paper Trading - Added macro sentiment analysis to paper-trading-safe API - Integrates Fear & Greed Index and M2 Money Supply data - Confidence adjustments based on macro conditions - Enhanced UI with macro sentiment panel showing F&G and M2 signals - Displays original vs adjusted confidence with macro impact - Shows M2 correlation timeline (3-6 month peak impact) - Macro adjustments applied: +/-10% for extreme F&G, +/-5% for M2 --- app/safe-paper-trading/page.js | 77 ++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/app/safe-paper-trading/page.js b/app/safe-paper-trading/page.js index 2a176e1..7926888 100644 --- a/app/safe-paper-trading/page.js +++ b/app/safe-paper-trading/page.js @@ -1212,6 +1212,11 @@ export default function SafePaperTradingPage() {

Confidence

{currentAnalysis.confidence}%

+ {currentAnalysis.originalConfidence && currentAnalysis.originalConfidence !== currentAnalysis.confidence && ( +

+ (Original: {currentAnalysis.originalConfidence}%, Macro: {currentAnalysis.macroAdjustment?.netAdjustment > 0 ? '+' : ''}{currentAnalysis.macroAdjustment?.netAdjustment}%) +

+ )}

Timeframes

@@ -1284,6 +1289,78 @@ export default function SafePaperTradingPage() {
+ {/* Macro Sentiment Panel */} + {currentAnalysis.macroSentiment && ( +
+

+ 💰 Macro Sentiment Analysis + {currentAnalysis.macroAdjustment?.applied && ( + + {currentAnalysis.macroAdjustment.netAdjustment > 0 ? '+' : ''}{currentAnalysis.macroAdjustment.netAdjustment}% + + )} +

+ +
+ {/* Fear & Greed Index */} +
+

Fear & Greed Index

+
+ = 75 ? 'text-green-400' : + currentAnalysis.macroSentiment.fearAndGreed?.value >= 55 ? 'text-yellow-400' : + 'text-gray-400' + }`}> + {currentAnalysis.macroSentiment.fearAndGreed?.value || 'N/A'} + + + {currentAnalysis.macroSentiment.fearAndGreed?.classification || 'unknown'} + +
+
+ + {/* M2 Money Supply */} +
+

M2 Money Supply

+
+ + {currentAnalysis.macroSentiment.m2MoneySupply?.cryptoSignal?.signal || 'N/A'} + + + ({currentAnalysis.macroSentiment.m2MoneySupply?.cryptoSignal?.confidence || 0}%) + +
+ {currentAnalysis.macroSentiment.m2MoneySupply?.cryptoSignal?.timeframe && ( +

+ {currentAnalysis.macroSentiment.m2MoneySupply.cryptoSignal.timeframe} +

+ )} +
+
+ + {/* Macro Adjustments Applied */} + {currentAnalysis.macroAdjustment?.applied && ( +
+

Macro Adjustments Applied:

+
    + {currentAnalysis.macroAdjustment.adjustments.map((adjustment, index) => ( +
  • + • + {adjustment} +
  • + ))} +
+
+ )} +
+ )} + {/* Toggle Detailed Analysis */}