Преглед на файлове

经排查,getPairSBalance会返回Reserves。

skyfffire преди 2 години
родител
ревизия
0aeac58c2e
променени са 1 файла, в които са добавени 16 реда и са изтрити 2 реда
  1. 16 2
      arbitrage/history.go

+ 16 - 2
arbitrage/history.go

@@ -130,6 +130,12 @@ func (h *HistoryArbitrage) run() {
 	//	To:   h.wallets[0].account.Address,
 	//})
 
+	//tempLpList := []string{
+	//	"0x1652db7faeab767a20950b894e72efb9d2438a41",
+	//}
+	//
+	//HistoryInfo(fmt.Sprintf("%+v", h.getPairSBalance(tempLpList)))
+
 running:
 	for {
 		select {
@@ -162,7 +168,15 @@ func (h *HistoryArbitrage) OnTick() {
 	h.pathList = GetFinalPathList(h.pathList)
 	// 根据利润排序
 	InsertionSort(h.pathList)
-	HistoryInfo(fmt.Sprintf("len=%v", len(h.pathList)))
+	//HistoryInfo(fmt.Sprintf("len=%v", len(h.pathList)))
+	path := h.pathList[0]
+	if path.FeeTokenProfit.GreaterThan(MinProfit) {
+		HistoryInfo(fmt.Sprintf("level=%+v, Sim=%+v, lpList=%+v", path.Level, path.Sim.ToJsonString(), path.LpHashList))
+		for fmIndex, fm := range path.FmList {
+			HistoryInfo(fmt.Sprintf("fm%v=%+v", fmIndex, fm))
+		}
+		HistoryInfo("")
+	}
 	//for _, path := range h.pathList {
 	//	if path.FeeTokenProfit.GreaterThan(MinProfit) {
 	//		//HistoryInfo(fmt.Sprintf("level=%+v, Sim=%+v, lpList=%+v", path.Level, path.Sim.ToJsonString(), path.LpHashList))
@@ -176,7 +190,7 @@ func (h *HistoryArbitrage) OnTick() {
 	// Gas War
 	// TODO 获取fee
 
-	time.Sleep(3 * time.Second)
+	time.Sleep(60 * time.Second)
 }
 
 func (h *HistoryArbitrage) Stop() error {