diff --git a/README.md b/README.md index 799613b..9f9957d 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,15 @@ You should see the following output: - Stop loss is calculated based on quote mint. - `SELL_SLIPPAGE` - Slippage %. +#### Snipe list +- `USE_SNIPE_LIST` - Set to `true` to enable buying only tokens listed in `snipe-list.txt`. + - Pool must not exist before the bot starts. + - If token can be traded before bot starts nothing will happen. Bot will not buy the token. +- `SNIPE_LIST_REFRESH_INTERVAL` - Interval in milliseconds to refresh the snipe list. + - You can update snipe list while bot is running. It will pickup the new changes each time it does refresh. + +Note: When using snipe list filters below will be disabled. + #### Filters - `FILTER_CHECK_INTERVAL` - Interval in milliseconds for checking if pool match the filters. - Set to zero to disable filters. @@ -75,9 +84,6 @@ You should see the following output: - Set to zero to disable filters. - `CONSECUTIVE_FILTER_MATCHES` - How many times in a row pool needs to match the filters. - This is useful because when pool is burned (and rugged), other filters may not report the same behavior. eg. pool size may still have old value -- `USE_SNIPE_LIST` - Set to `true` to enable buying only tokens listed in `snipe-list.txt`. - - Pool must not exist before the script starts. -- `SNIPE_LIST_REFRESH_INTERVAL` - Interval in milliseconds to refresh the snipe list. - `CHECK_IF_MINT_IS_RENOUNCED` - Set to `true` to buy tokens only if their mint is renounced. - `CHECK_IF_FREEZABLE` - Set to `true` to buy tokens only if they are not freezable. - `CHECK_IF_BURNED` - Set to `true` to buy tokens only if their liquidity pool is burned. diff --git a/bot.ts b/bot.ts index ad2c31d..449bd18 100644 --- a/bot.ts +++ b/bot.ts @@ -100,7 +100,7 @@ export class Bot { } public async buy(accountId: PublicKey, poolState: LiquidityStateV4) { - logger.trace({ mint: poolState.baseMint }, `Processing buy...`); + logger.trace({ mint: poolState.baseMint }, `Processing new pool...`); if (this.config.useSnipeList && !this.snipeListCache?.isInList(poolState.baseMint.toString())) { logger.debug({ mint: poolState.baseMint.toString() }, `Skipping buy because token is not in a snipe list`); @@ -131,11 +131,13 @@ export class Bot { ]); const poolKeys: LiquidityPoolKeysV4 = createPoolKeys(accountId, poolState, market); - const match = await this.filterMatch(poolKeys); + if (!this.config.useSnipeList) { + const match = await this.filterMatch(poolKeys); - if (!match) { - logger.trace({ mint: poolKeys.baseMint.toString() }, `Skipping buy because pool doesn't match filters`); - return; + if (!match) { + logger.trace({ mint: poolKeys.baseMint.toString() }, `Skipping buy because pool doesn't match filters`); + return; + } } for (let i = 0; i < this.config.maxBuyRetries; i++) { @@ -170,7 +172,7 @@ export class Bot { break; } - logger.debug( + logger.info( { mint: poolState.baseMint.toString(), signature: result.signature, @@ -197,7 +199,7 @@ export class Bot { } try { - logger.trace({ mint: rawAccount.mint }, `Processing sell...`); + logger.trace({ mint: rawAccount.mint }, `Processing new token...`); const poolData = await this.poolStorage.get(rawAccount.mint.toString()); @@ -269,7 +271,7 @@ export class Bot { } } } catch (error) { - logger.debug({ mint: rawAccount.mint.toString(), error }, `Failed to sell token`); + logger.error({ mint: rawAccount.mint.toString(), error }, `Failed to sell token`); } finally { if (this.config.oneTokenAtATime) { this.sellExecutionCount--; @@ -351,7 +353,7 @@ export class Bot { private async filterMatch(poolKeys: LiquidityPoolKeysV4) { if (this.config.filterCheckInterval === 0 || this.config.filterCheckDuration === 0) { - return; + return true; } const timesToCheck = this.config.filterCheckDuration / this.config.filterCheckInterval; diff --git a/index.ts b/index.ts index 39acf85..2c7ae33 100644 --- a/index.ts +++ b/index.ts @@ -109,17 +109,24 @@ function printDetails(wallet: Keypair, quoteToken: Token, bot: Bot) { logger.info(`Take profit: ${botConfig.takeProfit}%`); logger.info(`Stop loss: ${botConfig.stopLoss}%`); - logger.info('- Filters -'); + logger.info('- Snipe list -'); logger.info(`Snipe list: ${botConfig.useSnipeList}`); logger.info(`Snipe list refresh interval: ${SNIPE_LIST_REFRESH_INTERVAL} ms`); - logger.info(`Filter check interval: ${botConfig.filterCheckInterval} ms`); - logger.info(`Filter check duration: ${botConfig.filterCheckDuration} ms`); - logger.info(`Consecutive filter matches: ${botConfig.consecutiveMatchCount} ms`); - logger.info(`Check renounced: ${botConfig.checkRenounced}`); - logger.info(`Check freezable: ${botConfig.checkFreezable}`); - logger.info(`Check burned: ${botConfig.checkBurned}`); - logger.info(`Min pool size: ${botConfig.minPoolSize.toFixed()}`); - logger.info(`Max pool size: ${botConfig.maxPoolSize.toFixed()}`); + + if (botConfig.useSnipeList) { + logger.info('- Filters -'); + logger.info(`Filters are disabled when snipe list is on`); + } else { + logger.info('- Filters -'); + logger.info(`Filter check interval: ${botConfig.filterCheckInterval} ms`); + logger.info(`Filter check duration: ${botConfig.filterCheckDuration} ms`); + logger.info(`Consecutive filter matches: ${botConfig.consecutiveMatchCount}`); + logger.info(`Check renounced: ${botConfig.checkRenounced}`); + logger.info(`Check freezable: ${botConfig.checkFreezable}`); + logger.info(`Check burned: ${botConfig.checkBurned}`); + logger.info(`Min pool size: ${botConfig.minPoolSize.toFixed()}`); + logger.info(`Max pool size: ${botConfig.maxPoolSize.toFixed()}`); + } logger.info('------- CONFIGURATION END -------'); diff --git a/package-lock.json b/package-lock.json index dc75a61..b11b17c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "warp-solana-bot", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "warp-solana-bot", - "version": "2.0.0", + "version": "2.0.1", "dependencies": { "@raydium-io/raydium-sdk": "^1.3.1-beta.47", "@solana/spl-token": "^0.4.0", diff --git a/package.json b/package.json index a783d18..526c489 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "warp-solana-bot", "author": "Filip Dundjer", "homepage": "https://warp.id", - "version": "2.0.0", + "version": "2.0.1", "scripts": { "start": "ts-node index.ts", "tsc": "tsc --noEmit"