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