Forráskód Böngészése

Add mutable filter

Check if owner can change metadata
Theo Brigitte 1 éve
szülő
commit
a5d9fc1a88
6 módosított fájl, 11 hozzáadás és 1 törlés
  1. 1 0
      .env.copy
  2. 1 0
      README.md
  3. 1 0
      filters/index.ts
  4. 6 1
      filters/pool-filters.ts
  5. 1 0
      helpers/constants.ts
  6. 1 0
      index.ts

+ 1 - 0
.env.copy

@@ -42,6 +42,7 @@ SNIPE_LIST_REFRESH_INTERVAL=30000
 FILTER_CHECK_DURATION=60000
 FILTER_CHECK_INTERVAL=2000
 CONSECUTIVE_FILTER_MATCHES=3
+CHECK_IF_MUTABLE=true
 CHECK_IF_MINT_IS_RENOUNCED=true
 CHECK_IF_FREEZABLE=true
 CHECK_IF_BURNED=true

+ 1 - 0
README.md

@@ -78,6 +78,7 @@ You should see the following output:
 - `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_MUTABLE` - Set to `true` to buy tokens only if their metadata are not mutable.
 - `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.

+ 1 - 0
filters/index.ts

@@ -1,4 +1,5 @@
 export * from './burn.filter';
+export * from './mutable.filter';
 export * from './pool-filters';
 export * from './pool-size.filter';
 export * from './renounced.filter';

+ 6 - 1
filters/pool-filters.ts

@@ -1,9 +1,10 @@
 import { Connection } from '@solana/web3.js';
 import { LiquidityPoolKeysV4, Token, TokenAmount } from '@raydium-io/raydium-sdk';
 import { BurnFilter } from './burn.filter';
+import { MutableFilter } from './mutable.filter';
 import { RenouncedFreezeFilter } from './renounced.filter';
 import { PoolSizeFilter } from './pool-size.filter';
-import { CHECK_IF_BURNED, CHECK_IF_FREEZABLE, CHECK_IF_MINT_IS_RENOUNCED, logger } from '../helpers';
+import { CHECK_IF_BURNED, CHECK_IF_FREEZABLE, CHECK_IF_MINT_IS_RENOUNCED, CHECK_IF_MUTABLE, logger } from '../helpers';
 
 export interface Filter {
   execute(poolKeysV4: LiquidityPoolKeysV4): Promise<FilterResult>;
@@ -35,6 +36,10 @@ export class PoolFilters {
       this.filters.push(new RenouncedFreezeFilter(connection, CHECK_IF_MINT_IS_RENOUNCED, CHECK_IF_FREEZABLE));
     }
 
+    if (CHECK_IF_MUTABLE) {
+      this.filters.push(new MutableFilter(connection));
+    }
+
     if (!args.minPoolSize.isZero() || !args.maxPoolSize.isZero()) {
       this.filters.push(new PoolSizeFilter(connection, args.quoteToken, args.minPoolSize, args.maxPoolSize));
     }

+ 1 - 0
helpers/constants.ts

@@ -54,6 +54,7 @@ export const SELL_SLIPPAGE = Number(retrieveEnvVariable('SELL_SLIPPAGE', logger)
 export const FILTER_CHECK_INTERVAL = Number(retrieveEnvVariable('FILTER_CHECK_INTERVAL', logger));
 export const FILTER_CHECK_DURATION = Number(retrieveEnvVariable('FILTER_CHECK_DURATION', logger));
 export const CONSECUTIVE_FILTER_MATCHES = Number(retrieveEnvVariable('CONSECUTIVE_FILTER_MATCHES', logger));
+export const CHECK_IF_MUTABLE = retrieveEnvVariable('CHECK_IF_MUTABLE', logger) === 'true';
 export const CHECK_IF_MINT_IS_RENOUNCED = retrieveEnvVariable('CHECK_IF_MINT_IS_RENOUNCED', logger) === 'true';
 export const CHECK_IF_FREEZABLE = retrieveEnvVariable('CHECK_IF_FREEZABLE', logger) === 'true';
 export const CHECK_IF_BURNED = retrieveEnvVariable('CHECK_IF_BURNED', logger) === 'true';

+ 1 - 0
index.ts

@@ -14,6 +14,7 @@ import {
   RPC_WEBSOCKET_ENDPOINT,
   PRE_LOAD_EXISTING_MARKETS,
   LOG_LEVEL,
+  CHECK_IF_MUTABLE,
   CHECK_IF_MINT_IS_RENOUNCED,
   CHECK_IF_FREEZABLE,
   CHECK_IF_BURNED,