Opening a Position
Fetching Price from Muon Oracle
def fetch_muon_price():
try:
response = requests.get(MUON_URL)
data = response.json()
fetched_price_wei = data["result"]["data"]["result"]["price"]
return Decimal(fetched_price_wei) / Decimal('1e18')
except Exception as e:
print(f"[ERROR] Failed to fetch Muon price: {e}")
return NoneApplying Slippage
# For long positions, add 1% slippage
adjusted_price = fetched_price * Decimal('1.01')Preparing Trade Parameters
Sending the Trade Request
Last updated
