mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-09 20:12:06 +10:00
Added Jito-RPC Executer
This commit is contained in:
12
index.ts
12
index.ts
@ -40,13 +40,14 @@ import {
|
||||
PRICE_CHECK_INTERVAL,
|
||||
SNIPE_LIST_REFRESH_INTERVAL,
|
||||
TRANSACTION_EXECUTOR,
|
||||
WARP_FEE,
|
||||
CUSTOM_FEE,
|
||||
FILTER_CHECK_INTERVAL,
|
||||
FILTER_CHECK_DURATION,
|
||||
CONSECUTIVE_FILTER_MATCHES,
|
||||
} from './helpers';
|
||||
import { version } from './package.json';
|
||||
import { WarpTransactionExecutor } from './transactions/warp-transaction-executor';
|
||||
import { JitoTransactionExecutor } from './transactions/jito-rpc-transaction-executor';
|
||||
|
||||
const connection = new Connection(RPC_ENDPOINT, {
|
||||
wsEndpoint: RPC_WEBSOCKET_ENDPOINT,
|
||||
@ -80,8 +81,9 @@ function printDetails(wallet: Keypair, quoteToken: Token, bot: Bot) {
|
||||
logger.info('- Bot -');
|
||||
|
||||
logger.info(`Using warp: ${bot.isWarp}`);
|
||||
logger.info(`Using jito: ${bot.isJito}`);
|
||||
if (bot.isWarp) {
|
||||
logger.info(`Warp fee: ${WARP_FEE}`);
|
||||
logger.info(`${TRANSACTION_EXECUTOR} fee: ${CUSTOM_FEE}`);
|
||||
} else {
|
||||
logger.info(`Compute Unit limit: ${botConfig.unitLimit}`);
|
||||
logger.info(`Compute Unit price (micro lamports): ${botConfig.unitPrice}`);
|
||||
@ -143,7 +145,11 @@ const runListener = async () => {
|
||||
|
||||
switch (TRANSACTION_EXECUTOR) {
|
||||
case 'warp': {
|
||||
txExecutor = new WarpTransactionExecutor(WARP_FEE);
|
||||
txExecutor = new WarpTransactionExecutor(CUSTOM_FEE);
|
||||
break;
|
||||
}
|
||||
case 'jito': {
|
||||
txExecutor = new JitoTransactionExecutor(CUSTOM_FEE, connection);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user