Add mutable filter

Check if owner can change metadata
This commit is contained in:
Theo Brigitte
2024-04-21 15:35:40 +02:00
parent 6dbebe2169
commit a5d9fc1a88
6 changed files with 11 additions and 1 deletions

View File

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

View File

@ -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`. - `USE_SNIPE_LIST` - Set to `true` to enable buying only tokens listed in `snipe-list.txt`.
- Pool must not exist before the script starts. - Pool must not exist before the script starts.
- `SNIPE_LIST_REFRESH_INTERVAL` - Interval in milliseconds to refresh the snipe list. - `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_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_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. - `CHECK_IF_BURNED` - Set to `true` to buy tokens only if their liquidity pool is burned.

View File

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

View File

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

View File

@ -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_INTERVAL = Number(retrieveEnvVariable('FILTER_CHECK_INTERVAL', logger));
export const FILTER_CHECK_DURATION = Number(retrieveEnvVariable('FILTER_CHECK_DURATION', 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 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_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_FREEZABLE = retrieveEnvVariable('CHECK_IF_FREEZABLE', logger) === 'true';
export const CHECK_IF_BURNED = retrieveEnvVariable('CHECK_IF_BURNED', logger) === 'true'; export const CHECK_IF_BURNED = retrieveEnvVariable('CHECK_IF_BURNED', logger) === 'true';

View File

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