mgbam commited on
Commit
e1601a0
·
verified ·
1 Parent(s): b50b626

Update app/arbitrage_analyzer.py

Browse files
Files changed (1) hide show
  1. app/arbitrage_analyzer.py +10 -10
app/arbitrage_analyzer.py CHANGED
@@ -1,8 +1,8 @@
1
  """
2
- The Discrepancy Analyzer Engine.
3
 
4
- Uses Gemini to provide risk assessment for on-chain vs. off-chain
5
- price discrepancies.
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 analyst. A significant price discrepancy for Bitcoin (BTC) has been detected between a decentralized on-chain oracle and a centralized off-chain aggregator.
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 latency, network congestion (gas fees), and DEX slippage.
36
- - "strategy": A very brief, one-sentence action plan. For example: "Consider buying BTC on a DEX like Uniswap and selling on a CEX." or "Monitor situation, high risk of slippage."
37
- - "rationale": A short explanation for the risk assessment.
38
 
39
- DISCREPANCY DETAILS:
40
- - On-Chain Price (Pyth): ${opportunity['on_chain_price']:,.2f}
41
- - Off-Chain Agg. Price (CeFi): ${opportunity['off_chain_price']:,.2f}
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
  }]