mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-10 04:22:05 +10:00
scope filters for each token
This commit is contained in:
16
bot.ts
16
bot.ts
@ -54,8 +54,6 @@ export interface BotConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class Bot {
|
export class Bot {
|
||||||
private readonly poolFilters: PoolFilters;
|
|
||||||
|
|
||||||
// snipe list
|
// snipe list
|
||||||
private readonly snipeListCache?: SnipeListCache;
|
private readonly snipeListCache?: SnipeListCache;
|
||||||
|
|
||||||
@ -75,13 +73,7 @@ export class Bot {
|
|||||||
) {
|
) {
|
||||||
this.isWarp = txExecutor instanceof WarpTransactionExecutor;
|
this.isWarp = txExecutor instanceof WarpTransactionExecutor;
|
||||||
this.isJito = txExecutor instanceof JitoTransactionExecutor;
|
this.isJito = txExecutor instanceof JitoTransactionExecutor;
|
||||||
|
|
||||||
this.semaphore = new Semaphore(config.maxTokensAtTheTime);
|
this.semaphore = new Semaphore(config.maxTokensAtTheTime);
|
||||||
this.poolFilters = new PoolFilters(connection, {
|
|
||||||
quoteToken: this.config.quoteToken,
|
|
||||||
minPoolSize: this.config.minPoolSize,
|
|
||||||
maxPoolSize: this.config.maxPoolSize,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.config.useSnipeList) {
|
if (this.config.useSnipeList) {
|
||||||
this.snipeListCache = new SnipeListCache();
|
this.snipeListCache = new SnipeListCache();
|
||||||
@ -357,13 +349,19 @@ export class Bot {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const filters = new PoolFilters(this.connection, {
|
||||||
|
quoteToken: this.config.quoteToken,
|
||||||
|
minPoolSize: this.config.minPoolSize,
|
||||||
|
maxPoolSize: this.config.maxPoolSize,
|
||||||
|
});
|
||||||
|
|
||||||
const timesToCheck = this.config.filterCheckDuration / this.config.filterCheckInterval;
|
const timesToCheck = this.config.filterCheckDuration / this.config.filterCheckInterval;
|
||||||
let timesChecked = 0;
|
let timesChecked = 0;
|
||||||
let matchCount = 0;
|
let matchCount = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
const shouldBuy = await this.poolFilters.execute(poolKeys);
|
const shouldBuy = await filters.execute(poolKeys);
|
||||||
|
|
||||||
if (shouldBuy) {
|
if (shouldBuy) {
|
||||||
matchCount++;
|
matchCount++;
|
||||||
|
|||||||
Reference in New Issue
Block a user