|
|
@@ -3,6 +3,7 @@ const OneInch = require('../libs/web3/1inch')
|
|
|
const BinanceSpot = require('../libs/binance/binance-spot')
|
|
|
const Config = require('../config/config')
|
|
|
const NumKit = require('../kit/num-kit')
|
|
|
+const TimeKit = require('../kit/time-kit')
|
|
|
const TableKit = require('../kit/table-kit')
|
|
|
|
|
|
const orderHandler = function(context, task) {
|
|
|
@@ -45,7 +46,7 @@ const orderHandler = function(context, task) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const table = new TableKit(['pair', 'binance', 'order price', 'profit'], 25)
|
|
|
+const table = new TableKit(['pair', 'binance', 'order price', 'profit', 'prev time'], 20)
|
|
|
|
|
|
const pricesHandler = function(context, task) {
|
|
|
const logger = task.logger
|
|
|
@@ -63,13 +64,14 @@ const pricesHandler = function(context, task) {
|
|
|
const percentage = NumKit.getSubFloat((DiffPrice / OneInchPrice) * 100, 2)
|
|
|
const orderPrice = token.orderPrice ? token.orderPrice : NaN
|
|
|
const orderPercentage = NumKit.getSubFloat(((BinancePrice - orderPrice) / orderPrice) * 100, 2)
|
|
|
+ const prevTimeStr = token.prevHandleTime ? TimeKit.getTimeByMillisecond(token.prevHandleTime) : ''
|
|
|
|
|
|
// 价格非法的就不处理了
|
|
|
// if ((() => {
|
|
|
//
|
|
|
// })()) return
|
|
|
|
|
|
- const rows = [pair.toString(), BinancePrice.toString(), orderPrice.toString(), orderPercentage.toString().concat('%')]
|
|
|
+ const rows = [pair.toString(), BinancePrice.toString(), orderPrice.toString(), orderPercentage.toString().concat('%'), prevTimeStr]
|
|
|
|
|
|
// 识别到在拉盘
|
|
|
token.isLong = (() => {
|