warp-id / solana-trading-bot

Solana Trading Bot - Beta
Microsoft Public License
1.3k stars 615 forks source link

Skipping buy because one token at a time is turned on and token is already being processed #138

Open NukeThemAII opened 1 month ago

NukeThemAII commented 1 month ago

Getting a lot Skipping buy because one token at a time is turned on and token is already being processed, but nothing is being processes.

https://imgur.com/GeY6BqM

Why is that ?

edujr1 commented 1 month ago

https://imgur.com/GeY6BqM

This happens because your bot is already working with a token, in this case it has not yet purchased, but is monitoring it. Once finished, he is free to take another token. This is limited by the MAX_TOKENS_AT_THE_TIME env

NukeThemAII commented 1 month ago

ah got ya thanks, btw any way to better store or track logs?

edujr1 commented 1 month ago

ah got ya thanks, btw any way to better store or track logs?

You can use PM2

Ismola commented 3 weeks ago

ah got ya thanks, btw any way to better store or track logs?

In bot.ts, when a transaction ocurrs:

if (result.confirmed) {
          logger.info(
            {
              dex: `https://dexscreener.com/solana/${rawAccount.mint.toString()}?maker=${this.config.wallet.publicKey}`,
              mint: rawAccount.mint.toString(),
              signature: result.signature,
              url: `https://solscan.io/tx/${result.signature}`,
            },
            `Venta confirmada tx`,
          );

          await addTransaction({
            dex: `https://dexscreener.com/solana/${rawAccount.mint.toString()}?maker=${this.config.wallet.publicKey}`,
            mint: rawAccount.mint.toString(),
            signature: result.signature ? result.signature : "",
            url: `https://solscan.io/tx/${result.signature}`,
            success: true,
            direction: 'sell',

          })

To save the Transaction in a database

export const addTransaction = async (transaction: ITransaction) => {
    try {
        const data = new Transaction(transaction);

        await data.save();

    } catch (err) {

        console.log(err)

    }
};