@@ -59,15 +59,15 @@ const Main = async () => {
59
59
60
60
console . log ( `---` . repeat ( 10 ) ) ;
61
61
62
- let ethAmount = new BigNumber ( config . ETH_IN_AMOUNT ) . shiftedBy ( 18 ) . toString ( )
62
+ let ethInAmount = new BigNumber ( config . ETH_IN_AMOUNT ) . shiftedBy ( 18 ) . toString ( )
63
63
schedule ( `*/${ config . PRICE_CHECK_INTERVAL_IN_SECONDS } * * * * *` , async function ( ) {
64
64
console . log ( `***` . repeat ( 10 ) ) ;
65
65
MONITORED_TOKENS . forEach ( async ( token : any ) => {
66
66
try {
67
67
const buy_quote : Quote = await oneInch . getQuote ( {
68
68
srcToken : '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' ,
69
69
toToken : token . address ,
70
- srcAmount : ethAmount
70
+ srcAmount : ethInAmount
71
71
} )
72
72
let token_amount = buy_quote . toAmount
73
73
const sell_quote : Quote = await oneInch . getQuote ( {
@@ -91,6 +91,7 @@ const Main = async () => {
91
91
} ;
92
92
const timestamp = new Date ( )
93
93
let eth_out = parseFloat ( new BigNumber ( sell_quote . toAmount ) . shiftedBy ( - sell_quote . toToken . decimals ) . toFixed ( 6 ) )
94
+
94
95
const profit_pct = ( ( eth_out - config . ETH_IN_AMOUNT ) / config . ETH_IN_AMOUNT ) * 100
95
96
let token_out = parseFloat ( new BigNumber ( token_amount ) . shiftedBy ( - buy_quote . toToken . decimals ) . toFixed ( 6 ) )
96
97
let best_buy_protocols = ( await flat ( buy_quote . protocols ) ) . map ( ( quote : any ) => quote . name ) . join ( ',' )
@@ -107,7 +108,7 @@ const Main = async () => {
107
108
rate : `${ config . PRICE_CHECK_INTERVAL_IN_SECONDS } s`
108
109
} ,
109
110
] ) ;
110
- if ( ! ( JSON . stringify ( best_buy_protocols ) == JSON . stringify ( best_sell_protocols ) ) ) {
111
+ if ( JSON . stringify ( best_buy_protocols ) != JSON . stringify ( best_sell_protocols ) ) {
111
112
console . log ( table ) ;
112
113
}
113
114
0 commit comments