Ver código fonte

fix: disable filters when snipe list if on

Filip Dunder 1 ano atrás
pai
commit
3dbe5a5352
2 arquivos alterados com 15 adições e 7 exclusões
  1. 9 3
      README.md
  2. 6 4
      bot.ts

+ 9 - 3
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.

+ 6 - 4
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++) {