From 3dbe5a5352ea32fd9b1027c6c7de18e913800ef5 Mon Sep 17 00:00:00 2001 From: Filip Dunder Date: Sun, 21 Apr 2024 14:39:16 +0200 Subject: [PATCH 1/5] fix: disable filters when snipe list if on --- README.md | 12 +++++++++--- bot.ts | 10 ++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) 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..2ad6490 100644 --- a/bot.ts +++ b/bot.ts @@ -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++) { From 610340146d8f711265ee292635e9372510917e8e Mon Sep 17 00:00:00 2001 From: Filip Dunder Date: Sun, 21 Apr 2024 14:49:26 +0200 Subject: [PATCH 2/5] fix: filters --- bot.ts | 2 +- index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.ts b/bot.ts index 2ad6490..0202af6 100644 --- a/bot.ts +++ b/bot.ts @@ -353,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..c4011d4 100644 --- a/index.ts +++ b/index.ts @@ -114,7 +114,7 @@ function printDetails(wallet: Keypair, quoteToken: Token, bot: Bot) { 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(`Consecutive filter matches: ${botConfig.consecutiveMatchCount}`); logger.info(`Check renounced: ${botConfig.checkRenounced}`); logger.info(`Check freezable: ${botConfig.checkFreezable}`); logger.info(`Check burned: ${botConfig.checkBurned}`); From 41075b7eb62803739f2f8208b1862d4159d903ab Mon Sep 17 00:00:00 2001 From: Filip Dunder Date: Sun, 21 Apr 2024 15:25:44 +0200 Subject: [PATCH 3/5] fix: fix output --- index.ts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/index.ts b/index.ts index c4011d4..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}`); - 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 -------'); From ef87a3608fe3d483f5c8d09a1b5cea1bab016c27 Mon Sep 17 00:00:00 2001 From: Filip Dunder Date: Sun, 21 Apr 2024 15:36:30 +0200 Subject: [PATCH 4/5] fix: change log levels --- bot.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot.ts b/bot.ts index 0202af6..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`); @@ -172,7 +172,7 @@ export class Bot { break; } - logger.debug( + logger.info( { mint: poolState.baseMint.toString(), signature: result.signature, @@ -199,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()); @@ -271,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--; From a7d435a20972d6ceb33ad843ca7c8d6ca3be0b86 Mon Sep 17 00:00:00 2001 From: Filip Dunder Date: Sun, 21 Apr 2024 16:02:14 +0200 Subject: [PATCH 5/5] bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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"