Spaces:
Running
Running
Update crypto__analysis_tasks.py
Browse files- crypto__analysis_tasks.py +103 -34
crypto__analysis_tasks.py
CHANGED
|
@@ -5,68 +5,137 @@ class CryptoAnalysisTasks:
|
|
| 5 |
def market_research(self, agent, crypto):
|
| 6 |
return Task(
|
| 7 |
description=dedent(f"""
|
| 8 |
-
|
| 9 |
|
| 10 |
-
|
| 11 |
-
1. Get current price
|
| 12 |
-
2.
|
| 13 |
-
3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
Price: $X
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"""),
|
| 18 |
-
expected_output=f"
|
| 19 |
agent=agent
|
| 20 |
)
|
| 21 |
|
| 22 |
def technical_analysis(self, agent, crypto):
|
| 23 |
return Task(
|
| 24 |
description=dedent(f"""
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
"""),
|
| 35 |
-
expected_output=f"
|
| 36 |
agent=agent
|
| 37 |
)
|
| 38 |
|
| 39 |
def sentiment_analysis(self, agent, crypto):
|
| 40 |
return Task(
|
| 41 |
description=dedent(f"""
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
-
Sentiment:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
"""),
|
| 52 |
-
expected_output=f"
|
| 53 |
agent=agent
|
| 54 |
)
|
| 55 |
|
| 56 |
def recommend(self, agent, crypto):
|
| 57 |
return Task(
|
| 58 |
description=dedent(f"""
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
|
|
|
| 69 |
"""),
|
| 70 |
-
expected_output=f"
|
| 71 |
agent=agent
|
| 72 |
-
)
|
|
|
|
| 5 |
def market_research(self, agent, crypto):
|
| 6 |
return Task(
|
| 7 |
description=dedent(f"""
|
| 8 |
+
Conduct comprehensive market research for {crypto} cryptocurrency.
|
| 9 |
|
| 10 |
+
REQUIRED DATA POINTS:
|
| 11 |
+
1. Current Price: Get exact current price in USD
|
| 12 |
+
2. Market Cap: Current market capitalization
|
| 13 |
+
3. 24h Volume: Trading volume in last 24 hours
|
| 14 |
+
4. Price Changes: 24h, 7d, and 30d percentage changes
|
| 15 |
+
5. Market Dominance: Percentage of total crypto market
|
| 16 |
+
6. News Analysis: 3-5 recent news headlines with impact assessment
|
| 17 |
+
7. Competitive Analysis: Compare to Bitcoin and Ethereum
|
| 18 |
+
8. Market Trends: Current market phase (bull/bear/sideways)
|
| 19 |
|
| 20 |
+
FORMAT REQUIREMENTS:
|
| 21 |
+
- Price: $X.XX (24h change: +/-X.X%)
|
| 22 |
+
- Market Cap: $X.XB/M (Rank: #X)
|
| 23 |
+
- Volume 24h: $X.XM (Volume/MCap ratio: X.X%)
|
| 24 |
+
- 7d Change: +/-X.X%, 30d Change: +/-X.X%
|
| 25 |
+
- Market Dominance: X.X% of total crypto market
|
| 26 |
+
- News Impact: [List 3 key headlines with bullish/bearish/neutral impact]
|
| 27 |
+
- Vs Bitcoin: Outperforming/Underperforming by X.X%
|
| 28 |
+
- Vs Ethereum: Outperforming/Underperforming by X.X%
|
| 29 |
+
- Market Phase: [Bull/Bear/Sideways] with reasoning
|
| 30 |
+
|
| 31 |
+
ANALYSIS REQUIREMENTS:
|
| 32 |
+
Provide detailed commentary on each metric and its significance for investment decisions.
|
| 33 |
"""),
|
| 34 |
+
expected_output=f"Comprehensive market analysis report for {crypto} with all required data points and professional commentary",
|
| 35 |
agent=agent
|
| 36 |
)
|
| 37 |
|
| 38 |
def technical_analysis(self, agent, crypto):
|
| 39 |
return Task(
|
| 40 |
description=dedent(f"""
|
| 41 |
+
Perform detailed technical analysis for {crypto} cryptocurrency.
|
| 42 |
+
|
| 43 |
+
REQUIRED TECHNICAL INDICATORS:
|
| 44 |
+
1. RSI (14-day): Calculate current RSI and signal (Overbought >70, Oversold <30)
|
| 45 |
+
2. Moving Averages: 7-day, 20-day, 50-day, and 200-day SMAs
|
| 46 |
+
3. Trend Analysis: Current trend direction and strength
|
| 47 |
+
4. Support/Resistance: Key price levels for entry/exit
|
| 48 |
+
5. Volume Analysis: Volume trends and significance
|
| 49 |
+
6. Momentum Indicators: MACD, Stochastic if available
|
| 50 |
+
7. Chart Patterns: Identify any significant patterns
|
| 51 |
+
8. Fibonacci Levels: Key retracement/extension levels
|
| 52 |
|
| 53 |
+
FORMAT REQUIREMENTS:
|
| 54 |
+
- RSI: X.X (Signal: Overbought/Oversold/Neutral)
|
| 55 |
+
- 7-day MA: $X.XX, 20-day MA: $X.XX, 50-day MA: $X.XX
|
| 56 |
+
- Trend: Bullish/Bearish/Sideways (Strength: Strong/Moderate/Weak)
|
| 57 |
+
- Support: $X.XX, $X.XX | Resistance: $X.XX, $X.XX
|
| 58 |
+
- Volume Trend: Increasing/Decreasing/Stable
|
| 59 |
+
- Entry Points: $X.XX - $X.XX (Conservative: $X.XX)
|
| 60 |
+
- Stop Loss: $X.XX | Take Profit: $X.XX
|
| 61 |
+
- Pattern: [Head & Shoulders/Triangle/Wedge/None]
|
| 62 |
|
| 63 |
+
PROBABILITY ASSESSMENT:
|
| 64 |
+
Provide probability percentages for next 7-day and 30-day price movements.
|
| 65 |
"""),
|
| 66 |
+
expected_output=f"Detailed technical analysis for {crypto} with specific indicators, price levels, and probability assessments",
|
| 67 |
agent=agent
|
| 68 |
)
|
| 69 |
|
| 70 |
def sentiment_analysis(self, agent, crypto):
|
| 71 |
return Task(
|
| 72 |
description=dedent(f"""
|
| 73 |
+
Conduct multi-source sentiment analysis for {crypto} cryptocurrency.
|
| 74 |
+
|
| 75 |
+
REQUIRED SENTIMENT SOURCES:
|
| 76 |
+
1. Overall Market Sentiment: General market mood towards {crypto}
|
| 77 |
+
2. Social Media Sentiment: Twitter, Reddit, Discord community analysis
|
| 78 |
+
3. News Sentiment: Traditional media, crypto publications, regulatory news
|
| 79 |
+
4. Community Sentiment: Developer activity, governance, ecosystem growth
|
| 80 |
+
5. Institutional Sentiment: Corporate adoption, investment fund interest
|
| 81 |
+
6. Fear & Greed Index: Current market psychology
|
| 82 |
|
| 83 |
+
ANALYSIS METHODOLOGY:
|
| 84 |
+
- Analyze each source independently
|
| 85 |
+
- Assign clear Positive/Negative/Neutral ratings
|
| 86 |
+
- Provide confidence scores (High/Medium/Low)
|
| 87 |
+
- Identify sentiment drivers and catalysts
|
| 88 |
|
| 89 |
+
FORMAT REQUIREMENTS:
|
| 90 |
+
- Overall Sentiment: Positive/Negative/Neutral (Confidence: High/Medium/Low)
|
| 91 |
+
- Social Media: Positive/Negative/Neutral (Twitter: X%, Reddit: X%)
|
| 92 |
+
- News Sentiment: Positive/Negative/Neutral (Recent headlines impact)
|
| 93 |
+
- Community: Positive/Negative/Neutral (Developer activity, governance)
|
| 94 |
+
- Institutional: Positive/Negative/Neutral (Corporate interest level)
|
| 95 |
+
- Key Drivers: [List 3-5 main factors influencing sentiment]
|
| 96 |
+
- Sentiment Score: X/10 (Weighted composite)
|
| 97 |
+
- Change from Last Week: Improving/Deteriorating/Stable
|
| 98 |
+
|
| 99 |
+
ENSURE DIFFERENTIATED ANALYSIS:
|
| 100 |
+
Each sentiment category must be analyzed separately and may have different ratings.
|
| 101 |
+
Do not assign the same sentiment to all categories.
|
| 102 |
"""),
|
| 103 |
+
expected_output=f"Comprehensive sentiment analysis for {crypto} with differentiated ratings across all sources",
|
| 104 |
agent=agent
|
| 105 |
)
|
| 106 |
|
| 107 |
def recommend(self, agent, crypto):
|
| 108 |
return Task(
|
| 109 |
description=dedent(f"""
|
| 110 |
+
Synthesize all analyses to provide a comprehensive investment recommendation for {crypto}.
|
| 111 |
+
|
| 112 |
+
INTEGRATION REQUIREMENTS:
|
| 113 |
+
1. Market Analysis Summary: Key market metrics and trends
|
| 114 |
+
2. Technical Analysis Summary: Critical indicators and signals
|
| 115 |
+
3. Sentiment Analysis Summary: Weighted sentiment across sources
|
| 116 |
+
4. Risk Assessment: Identify and quantify key risks
|
| 117 |
+
5. Investment Recommendation: Clear BUY/HOLD/SELL with reasoning
|
| 118 |
+
6. Position Sizing: Recommended portfolio allocation percentage
|
| 119 |
+
7. Time Horizon: Short-term (1-3 months) vs Long-term (6-12 months) outlook
|
| 120 |
+
8. Exit Strategy: Clear profit-taking and stop-loss levels
|
| 121 |
|
| 122 |
+
FORMAT REQUIREMENTS:
|
| 123 |
+
- Recommendation: BUY/HOLD/SELL
|
| 124 |
+
- Confidence: High/Medium/Low (with percentage if possible)
|
| 125 |
+
- Time Horizon: Short-term/Medium-term/Long-term
|
| 126 |
+
- Position Size: X% of portfolio (Conservative/Moderate/Aggressive)
|
| 127 |
+
- Entry Range: $X.XX - $X.XX
|
| 128 |
+
- Target Price: $X.XX (Timeframe: X months)
|
| 129 |
+
- Stop Loss: $X.XX
|
| 130 |
+
- Risk Level: Low/Moderate/High
|
| 131 |
+
- Key Catalysts: [3-5 factors that could drive price]
|
| 132 |
+
- Risk Factors: [3-5 main risks to monitor]
|
| 133 |
+
- Reasoning: [Detailed explanation combining all analyses]
|
| 134 |
|
| 135 |
+
DECISION MATRIX:
|
| 136 |
+
Clearly explain how market, technical, and sentiment factors influenced the final recommendation.
|
| 137 |
+
Address both bull and bear case scenarios.
|
| 138 |
"""),
|
| 139 |
+
expected_output=f"Comprehensive investment recommendation for {crypto} with specific targets, risk assessment, and detailed reasoning",
|
| 140 |
agent=agent
|
| 141 |
+
)
|