@@ -59,15 +59,15 @@ const Main = async () => {
5959
6060console . log ( `---` . repeat ( 10 ) ) ;
6161
62- let ethAmount = new BigNumber ( config . ETH_IN_AMOUNT ) . shiftedBy ( 18 ) . toString ( )
62+ let ethInAmount = new BigNumber ( config . ETH_IN_AMOUNT ) . shiftedBy ( 18 ) . toString ( )
6363schedule ( `*/${ config . PRICE_CHECK_INTERVAL_IN_SECONDS } * * * * *` , async function ( ) {
6464console . log ( `***` . repeat ( 10 ) ) ;
6565MONITORED_TOKENS . forEach ( async ( token :any ) => {
6666try {
6767const buy_quote :Quote = await oneInch . getQuote ( {
6868srcToken :'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' ,
6969toToken :token . address ,
70- srcAmount :ethAmount
70+ srcAmount :ethInAmount
7171} )
7272let token_amount = buy_quote . toAmount
7373const sell_quote :Quote = await oneInch . getQuote ( {
@@ -91,6 +91,7 @@ const Main = async () => {
9191} ;
9292const timestamp = new Date ( )
9393let eth_out = parseFloat ( new BigNumber ( sell_quote . toAmount ) . shiftedBy ( - sell_quote . toToken . decimals ) . toFixed ( 6 ) )
94+
9495const profit_pct = ( ( eth_out - config . ETH_IN_AMOUNT ) / config . ETH_IN_AMOUNT ) * 100
9596let token_out = parseFloat ( new BigNumber ( token_amount ) . shiftedBy ( - buy_quote . toToken . decimals ) . toFixed ( 6 ) )
9697let best_buy_protocols = ( await flat ( buy_quote . protocols ) ) . map ( ( quote :any ) => quote . name ) . join ( ',' )
@@ -107,7 +108,7 @@ const Main = async () => {
107108rate :`${ config . PRICE_CHECK_INTERVAL_IN_SECONDS } s`
108109} ,
109110] ) ;
110- if ( ! ( JSON . stringify ( best_buy_protocols ) == JSON . stringify ( best_sell_protocols ) ) ) {
111+ if ( JSON . stringify ( best_buy_protocols ) != JSON . stringify ( best_sell_protocols ) ) {
111112console . log ( table ) ;
112113}
113114