Skip to content

A high-performance sniper bot designed to detect and execute trades on newly created Meteora pools with minimal latency.

Notifications You must be signed in to change notification settings

fighting45/Meteora_Sniper_bot-

Repository files navigation

Meteora Sniper Bot

A high-performance sniper bot designed to detect and execute trades on newly created Meteora pools with minimal latency.

Features

  • Real-time Pool Detection: Uses Yellowstone GRPC streaming for instant transaction monitoring
  • Parallel Execution: Executes buy transactions across multiple wallets simultaneously
  • Jito Bundle Integration: Leverages Jito bundles for faster transaction processing with fallback to regular transactions
  • Custom Transaction Building: Builds optimized transactions from scratch including token account creation and WSOL handling
  • Speed Optimized: Every component designed for minimal latency

Architecture

src/
├── core/
│   └── sniper-bot.ts          # Main bot orchestrator
├── services/
│   ├── grpc-stream.ts         # GRPC streaming service
│   ├── transaction-parser.ts   # Meteora transaction parser
│   ├── transaction-builder.ts  # Custom transaction builder
│   ├── jito-bundle-sender.ts  # Jito bundle management
│   └── wallet-manager.ts      # Multi-wallet management
├── types/
│   ├── config.ts              # Configuration interfaces
│   └── meteora.ts             # Meteora-specific types
└── utils/
    └── config.ts              # Configuration management

Setup

  1. Install Dependencies

    npm install
  2. Configure Environment

    cp env.example .env

    Edit .env with your configuration:

    • GRPC_URL: Your Yellowstone GRPC endpoint
    • X_TOKEN: Authentication token for GRPC
    • METEORA_CONFIG_ACCOUNT: Meteora configuration account to monitor
    • Trading parameters (amount, slippage, priority fees)
  3. Setup Private Keys

    Option A: Use a file (recommended for multiple wallets)

    cp config/private-keys.example.txt config/private-keys.txt
    # Edit config/private-keys.txt with your actual private keys (one per line)

    Option B: Use environment variable

    # Set PRIVATE_KEYS in .env with comma-separated keys
    PRIVATE_KEYS=key1,key2,key3
  4. Build Project

    npm run build

Usage

Development Mode

npm run dev

Production Mode

npm run build
npm start

Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

Configuration

Environment Variables

Variable Description Required
GRPC_URL Yellowstone GRPC endpoint
X_TOKEN GRPC authentication token
METEORA_CONFIG_ACCOUNT Meteora config account address
METEORA_PROGRAM_ID Meteora program ID
JITO_BLOCK_ENGINE_URL Jito block engine URL
JITO_TIP_ACCOUNT Jito tip account address
SNIPE_AMOUNT_SOL SOL amount per wallet
MAX_SLIPPAGE_BPS Max slippage in basis points
PRIORITY_FEE_MICRO_LAMPORTS Priority fee
PRIVATE_KEYS_FILE Path to private keys file ✅*
PRIVATE_KEYS Comma-separated private keys ✅*

*Either PRIVATE_KEYS_FILE or PRIVATE_KEYS must be provided. File takes priority.

Trading Parameters

  • Snipe Amount: Amount of SOL to use per wallet
  • Max Slippage: Maximum acceptable slippage in basis points (500 = 5%)
  • Priority Fee: Micro-lamports for compute unit price

How It Works

  1. Initialization:

    • Loads configuration from environment variables
    • Initializes all wallets and checks balances
    • Sets up GRPC connection and services
  2. Monitoring:

    • Streams transactions from Yellowstone GRPC
    • Filters for Meteora program transactions
    • Parses transactions to detect pool creation
  3. Execution:

    • Extracts pool account information from creation transaction
    • Builds buy transactions for all wallets in parallel
    • Sends transactions via Jito bundles (with fallback)
    • Stops bot after successful execution

Security Considerations

  • Private keys are loaded from environment variables
  • No private keys are logged or stored
  • Each wallet operates independently
  • Fallback transaction method if Jito fails

Performance Optimizations

  • Parallel Processing: All operations are parallelized where possible
  • Pre-built Components: Transactions are built using optimized, pre-calculated components
  • Minimal Latency: Direct GRPC streaming with immediate processing
  • Jito Integration: Uses Jito bundles for faster block inclusion

Monitoring

The bot provides real-time logging including:

  • Transaction detection and parsing
  • Wallet balance information
  • Execution timing and results
  • Error handling and fallbacks

Error Handling

  • Graceful shutdown on SIGINT/SIGTERM
  • Automatic GRPC stream reconnection
  • Fallback to regular transactions if Jito fails
  • Comprehensive error logging

License

MIT License

About

A high-performance sniper bot designed to detect and execute trades on newly created Meteora pools with minimal latency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published