فهرست منبع

Add profit variable

Sasan Salamzadeh 1 سال پیش
والد
کامیت
e07846eb3a
1فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 5 4
      Arbitrage.py

+ 5 - 4
Arbitrage.py

@@ -13,7 +13,8 @@ NOBITEX_API = "https://apiv2.nobitex.ir/v3/orderbook/USDTIRT"
 BITPIN_API = "https://api.bitpin.ir/v4/mth/matches/USDT_IRT/"
 
 # Minimum volume for Nobitex sell orders (in USDT)
-MIN_SELL_VOLUME = 1000.0
+MIN_SELL_VOLUME = 500.0
+MIN_PROFIT_IRR = 5000.0
 
 def log_error(message):
     """Log errors with timestamp."""
@@ -243,7 +244,7 @@ async def check_arbitrage():
         # Send single Telegram message for the best opportunity
         try:
             best_message = None
-            if best_ask_sell_diff > best_bid_buy_diff and best_ask_sell_diff > 8000 and best_ask_sell_details:
+            if best_ask_sell_diff > best_bid_buy_diff and best_ask_sell_diff > MIN_PROFIT_IRR and best_ask_sell_details:
                 ask_price, ask_volume, compare_price, compare_volume, orig_ask_price, orig_ask_volume, sell_price, sell_volume = best_ask_sell_details
                 best_message = (
                     f"✅ موقعیت آربیتراژ یافت شد 📈\n"
@@ -254,7 +255,7 @@ async def check_arbitrage():
                     f"📏 حجم قیمت میانگین: {compare_volume:.2f} دلار\n"
                     f"📈 تفاوت قیمت: {int(best_ask_sell_diff)} ریال"
                 )
-            elif best_bid_buy_diff > 8000 and best_bid_buy_details:
+            elif best_bid_buy_diff > MIN_PROFIT_IRR and best_bid_buy_details:
                 bid_price, bid_volume, compare_price, compare_volume, orig_bid_price, orig_bid_volume, buy_price, buy_volume = best_bid_buy_details
                 best_message = (
                     f"✅ موقعیت آربیتراژ یافت شد 📈\n"
@@ -269,7 +270,7 @@ async def check_arbitrage():
             if best_message:
                 await send_telegram_message(best_message)
             else:
-                print("No arbitrage opportunity found with price difference > 8000 IRR")
+                print("No arbitrage opportunity found with price difference > " + str(MIN_PROFIT_IRR) + " IRR")
         except Exception as e:
             log_error(f"Error preparing Telegram message: {e}")