Spaces:
Running
Running
Update app/arbitrage_analyzer.py
Browse files- app/arbitrage_analyzer.py +10 -10
app/arbitrage_analyzer.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
"""
|
2 |
-
The Discrepancy Analyzer
|
3 |
|
4 |
-
Uses Gemini to provide risk assessment
|
5 |
-
|
6 |
"""
|
7 |
import os
|
8 |
import logging
|
@@ -27,18 +27,18 @@ class ArbitrageAnalyzer:
|
|
27 |
"contents": [{
|
28 |
"parts": [{
|
29 |
"text": f"""
|
30 |
-
You are a DeFi
|
31 |
Provide a concise "Alpha Briefing" as a single, minified JSON object with NO markdown formatting.
|
32 |
|
33 |
The JSON object must have these exact keys: "risk", "strategy", "rationale".
|
34 |
|
35 |
-
- "risk": Assess the execution risk. MUST be one of "LOW", "MEDIUM", "HIGH". Consider oracle
|
36 |
-
- "strategy": A
|
37 |
-
- "rationale": A short explanation for the risk assessment.
|
38 |
|
39 |
-
|
40 |
-
-
|
41 |
-
-
|
42 |
- Discrepancy: {opportunity['spread_pct']:.3f}%
|
43 |
"""
|
44 |
}]
|
|
|
1 |
"""
|
2 |
+
The Oracle Discrepancy Analyzer.
|
3 |
|
4 |
+
Uses Gemini to provide risk assessment and strategic plans for
|
5 |
+
discrepancies between the Pyth and Chainlink oracles.
|
6 |
"""
|
7 |
import os
|
8 |
import logging
|
|
|
27 |
"contents": [{
|
28 |
"parts": [{
|
29 |
"text": f"""
|
30 |
+
You are a high-frequency DeFi strategist. A price dislocation for Bitcoin (BTC) has been detected between the Pyth and Chainlink oracle networks.
|
31 |
Provide a concise "Alpha Briefing" as a single, minified JSON object with NO markdown formatting.
|
32 |
|
33 |
The JSON object must have these exact keys: "risk", "strategy", "rationale".
|
34 |
|
35 |
+
- "risk": Assess the execution risk. MUST be one of "LOW", "MEDIUM", "HIGH". Consider which oracle is more likely to be lagging and potential for front-running.
|
36 |
+
- "strategy": A brief, one-sentence action plan. For example: "Exploit Pyth's lag on Solana DEXs." or "High risk, monitor for oracle convergence."
|
37 |
+
- "rationale": A short explanation for the risk assessment, mentioning potential causes like exchange downtime on one oracle's sources.
|
38 |
|
39 |
+
DISLOCATION DETAILS:
|
40 |
+
- Pyth Network Price: ${opportunity['pyth_price']:,.2f}
|
41 |
+
- Chainlink Aggregated Price: ${opportunity['chainlink_price']:,.2f}
|
42 |
- Discrepancy: {opportunity['spread_pct']:.3f}%
|
43 |
"""
|
44 |
}]
|