-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathquestions.py
More file actions
90 lines (81 loc) · 3.31 KB
/
questions.py
File metadata and controls
90 lines (81 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import bittensor as bt
import requests
import random
"""
List of questions that can be answered by the crypto analysis document.
"""
questions = [
# Portfolio Analytics questions
"Can you analyze my portfolio's rolling volatility and identify which assets are contributing most to risk?",
"How do the volatility trends of my top portfolio assets compare over the last 90 days?",
"Provide insights on my portfolio holdings and how I can better diversify?",
"What's my current portfolio risk assessment and how can I optimize for a better risk-return ratio?",
"What's the maximum drawdown for my current portfolio and how does it compare to market benchmarks?",
"Evaluate my portfolio risk",
# Yield questions
"How can I earn the best yield on USDC?",
"How can I earn the best yield on SOL?",
"How can I earn the best yield on USDT?",
"How can I earn the best yield on JTO?",
"How can I earn the best yield on JLP?",
"How can I earn the best yield on cbBTC?",
"How can I earn the best yield on bSOL?",
"How can I earn the best yield on jitoSOL?",
# Trading questions
"What are the trading tokens on Solana?",
"What are the trading tokens on Sui?",
"What are the trading tokens on Ethereum?",
"What are the trading tokens on Base?",
"What is the highest trending token on Base?",
"What is the highest trending token on Solana?",
"What is the highest trending token on Sui?",
"What is the highest trending token on Ethereum?",
# Investment questions
"Should i buy SOL?",
"Should i buy ETH?",
"Should i buy BTC?",
"Should i buy LINK?",
"Should i buy BONK?",
"Should i buy SHIB?",
"Should i buy ZORA?",
# Token risk questions
"Evaluate the risk of PENGU",
"Evaluate the risk of PEPE",
"Evaluate the risk of ZORA on Base",
"Evaluate the risk of SMOG on Solana",
"Who are the top holders of PENGU?",
"Who are the top holders of PEPE?",
"Who are the top holders of LINK?",
"Who are the top holders of ZORA on Base?",
"Who are the top holders of AERO on Base?",
"What are the top 3 safest memecoins to buy on Solana?",
"What are the top 3 safest memecoins to buy on Sui?",
"What are the top 3 safest memecoins to buy on Base?",
"What are the top 3 safest memecoins to buy on Ethereum?",
]
def fetch_question_once(
api_url: str = "https://quant-api.opengradient.ai/api/subnet/question",
timeout: float = 60.0,
) -> str:
response_obj = requests.get(
api_url,
timeout=timeout
)
response_obj.raise_for_status()
question_result = response_obj.json()
return question_result["question"]
def fetch_question(
api_url: str = "https://quant-api.opengradient.ai/api/subnet/question",
timeout: float = 60.0,
retry_count: int = 3,
) -> str:
for i in range(retry_count + 1):
try:
question = fetch_question_once(api_url, timeout=timeout)
bt.logging.info(f"Fetched question: '{question}'")
return question
except Exception as ex:
bt.logging.warning(f"Question fetch failed during try no. {i + 1} on: {ex}")
question = random.choice(questions)
bt.logging.warning(f"Fetching question failed too many times; returning one of the default questions: '{question}'")
return question