@@ -243,7 +243,7 @@ Available chains: _eth, bsc, ftm, avax, cro, arbi, poly, base, sol, sonic_`, { p
243243 const tokenAddress = match [ 1 ] ;
244244 console . log ( `[LOG] Fetching price data for token address: ${ tokenAddress } ` ) ;
245245
246- bot . sendMessage ( chatId , `🔍 Generating 7-day price chart for token: ${ tokenAddress } . Please wait...` ) ;
246+ bot . sendMessage ( chatId , `🔍 Generating 2W price chart for token: ${ tokenAddress } . Please wait...` ) ;
247247
248248 try {
249249 const response = await axios . get ( `https://api.vybenetwork.xyz/price/${ tokenAddress } /token-ohlcv` , {
@@ -436,33 +436,40 @@ Available chains: _eth, bsc, ftm, avax, cro, arbi, poly, base, sol, sonic_`, { p
436436
437437 message += `*Summary:*\n` ;
438438 message += `- *Win Rate:* ${ summary . winRate ? ( summary . winRate * 100 ) . toFixed ( 2 ) + '%' : 'N/A' } \n` ;
439- message += `- *Realized PnL (USD):* $${ summary . realizedPnlUsd . toFixed ( 2 ) } \n` ;
440- message += `- *Unrealized PnL (USD):* $${ summary . unrealizedPnlUsd . toFixed ( 2 ) } \n` ;
439+ message += `- *Realized PnL (USD):* $${ formatValue ( summary . realizedPnlUsd ) } \n` ;
440+ message += `- *Unrealized PnL (USD):* $${ formatValue ( summary . unrealizedPnlUsd ) } \n` ;
441441 message += `- *Unique Tokens Traded:* ${ summary . uniqueTokensTraded } \n` ;
442- message += `- *Average Trade (USD):* $${ summary . averageTradeUsd . toFixed ( 2 ) } \n` ;
442+ message += `- *Average Trade (USD):* $${ formatValue ( summary . averageTradeUsd ) } \n` ;
443443 message += `- *Total Trades:* ${ summary . tradesCount } \n` ;
444444 message += `- *Winning Trades:* ${ summary . winningTradesCount } \n` ;
445445 message += `- *Losing Trades:* ${ summary . losingTradesCount } \n` ;
446- message += `- *Trades Volume (USD):* $${ summary . tradesVolumeUsd . toFixed ( 2 ) } \n` ;
447- message += `- *Best Performing Token:* ${ summary . bestPerformingToken || 'N/A' } \n` ;
448- message += `- *Worst Performing Token:* ${ summary . worstPerformingToken || 'N/A' } \n\n` ;
446+ message += `- *Trades Volume (USD):* $${ formatValue ( summary . tradesVolumeUsd ) } \n` ;
447+ message += `- *Best Performing Token:* ${ summary . bestPerformingToken . tokenSymbol || 'N/A' } \n` ;
448+ message += `- *Worst Performing Token:* ${ summary . worstPerformingToken . tokenSymbol || 'N/A' } \n\n` ;
449449
450450 if ( summary . pnlTrendSevenDays . length > 0 ) {
451451 message += `*PnL Trend (Last 7 Days):*\n` ;
452- summary . pnlTrendSevenDays . forEach ( ( trend : any , index : number ) => {
453- message += ` Day ${ index + 1 } : $${ trend . toFixed ( 2 ) } \n` ;
452+ summary . pnlTrendSevenDays . forEach ( ( trend : number [ ] , dayIndex : number ) => {
453+ const dailyTrend = trend . map ( value => `$${ formatValue ( value ) } ` ) . join ( ', ' ) ;
454+ message += ` Day ${ dayIndex + 1 } : [${ dailyTrend } ]\n` ;
454455 } ) ;
455456 message += `\n` ;
456457 }
457458
458459 if ( tokenMetrics . length > 0 ) {
459460 message += `*Token Metrics:*\n` ;
460461 tokenMetrics . forEach ( ( token : any ) => {
461- message += `🔹 *${ token . name } (${ token . symbol } )*\n` ;
462- message += ` - *Realized PnL (USD):* $${ token . realizedPnlUsd . toFixed ( 2 ) } \n` ;
463- message += ` - *Unrealized PnL (USD):* $${ token . unrealizedPnlUsd . toFixed ( 2 ) } \n` ;
464- message += ` - *Trades Count:* ${ token . tradesCount } \n` ;
465- message += ` - *Volume (USD):* $${ token . volumeUsd . toFixed ( 2 ) } \n\n` ;
462+ message += `🔹 *${ token . tokenSymbol } *\n` ;
463+ message += ` - *Realized PnL (USD):* $${ formatValue ( token . realizedPnlUsd ) } \n` ;
464+ message += ` - *Unrealized PnL (USD):* $${ formatValue ( token . unrealizedPnlUsd ) } \n` ;
465+ message += ` - *Buys:*\n` ;
466+ message += ` - *Volume (USD):* $${ formatValue ( token . buys . volumeUsd ) } \n` ;
467+ message += ` - *Token Amount:* ${ token . buys . tokenAmount } \n` ;
468+ message += ` - *Transaction Count:* ${ token . buys . transactionCount } \n` ;
469+ message += ` - *Sells:*\n` ;
470+ message += ` - *Volume (USD):* $${ formatValue ( token . sells . volumeUsd ) } \n` ;
471+ message += ` - *Token Amount:* ${ token . sells . tokenAmount } \n` ;
472+ message += ` - *Transaction Count:* ${ token . sells . transactionCount } \n\n` ;
466473 } ) ;
467474 }
468475
@@ -479,7 +486,7 @@ Available chains: _eth, bsc, ftm, avax, cro, arbi, poly, base, sol, sonic_`, { p
479486 const chatId = msg . chat . id ;
480487
481488 // Check if the message starts with '/' and no command matched
482- if ( msg . text ?. startsWith ( '/' ) && ! msg . text . match ( / ^ \/ ( s t a r t | h e l p | e c h o | t i m e | w a l l e t p n l | t o k e n b a l a n c e s | a n a l y t i c s | g e t 2 w p r i c e c h a r t ) / ) ) {
489+ if ( msg . text ?. startsWith ( '/' ) && ! msg . text . match ( / ^ \/ ( s t a r t | h e l p | e c h o | t i m e | w a l l e t p n l | t o k e n b a l a n c e s | t o k e n d e t a i l | a n a l y t i c s | g e t 2 w p r i c e c h a r t ) / ) ) {
483490 bot . sendMessage ( chatId , `⚠️ Unknown command: "${ msg . text } ". Type /help to see available commands.` ) ;
484491 } else if ( ! msg . text ?. startsWith ( '/' ) ) {
485492 bot . sendMessage ( chatId , `🤖 I received your message: "${ msg . text } ".\nSince I work only on configured commands, type /help to see available commands.` ) ;
0 commit comments