Browse Source

一些字段錯誤的修復。

skyfffire 4 months ago
parent
commit
8a73a5a6ad
2 changed files with 6 additions and 4 deletions
  1. 1 1
      as.py
  2. 5 3
      submit_process_demo.py

+ 1 - 1
as.py

@@ -149,7 +149,6 @@ def move_completed_process_to_history(process_id_to_move: str) -> bool:
 
 # 策略構建器
 def strategy_builder(process_item):
-    process_id = process_item['id']
     profit = Decimal(process_item['profit'])
     profitLimit = Decimal(process_item['profitLimit'])
     strategy = process_item['strategy']
@@ -185,6 +184,7 @@ def arbitrage_process_flow(process_item):
     在单独线程中执行的实际套利逻辑。
     会直接修改 'process_item' 字典。
     """
+    process_id = process_item['id']
     
     ap = strategy_builder(process_item)
 

+ 5 - 3
submit_process_demo.py

@@ -2,6 +2,7 @@ import requests
 import json
 import time
 import logging
+from config import wallet
 from decimal import Decimal # 使用 Decimal 来表示精确的金额和价差
 
 from checker.config import arb
@@ -22,8 +23,8 @@ def create_mock_arbitrage_data():
     EXCHANGE_OUT_AMOUNT = Decimal(2100000)
     IN_AMOUNT_TO_QUERY = Decimal(12)
     OUT_TOKEN_ADDRESS = '0xf816507E690f5Aa4E29d164885EB5fa7a5627860' # RATO on Ethereum
-    USER_WALLET = '0xb1f33026Db86a86372493a3B124d7123e9045Bb4'
-    USER_EXCHANGE_WALLET = '0xc71835a042F4d870B0F4296cc89cAeb921a9f3DA'
+    USER_WALLET = wallet["user_wallet"]
+    USER_EXCHANGE_WALLET = wallet["user_exchange_wallet"]
     SLIPPAGE = 1
     MEXC_TARGET_PAIR_USDT = 'RATO_USDT' # MEXC 现货交易对
 
@@ -59,7 +60,8 @@ def create_mock_arbitrage_data():
         "toToken": OUT_TOKEN_ADDRESS,
         "toTokenAmountHuman": str(human_out_target),
         "toTokenDecimal": str(out_dec),
-        "exchangeOutAmount": str(EXCHANGE_OUT_AMOUNT)
+        "exchangeOutAmount": str(EXCHANGE_OUT_AMOUNT),
+        "strategy": "erc20_to_mexc",
     }
     return data