Added Jito-RPC Executer

This commit is contained in:
engmabdulwahab
2024-04-22 07:27:59 +04:00
parent 95ae801a53
commit 39ef59f5a6
6 changed files with 174 additions and 18 deletions

View File

@ -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: {