Skip to content

Automated pool discovery and configuration generator for Solana DEXs using GeckoTerminal API

License

Notifications You must be signed in to change notification settings

mishafyi/megagecko-pool-fetcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦎 MegaGecko Pool Fetcher

Automated pool discovery and configuration generator for Solana DEXs

TypeScript Node.js License: MIT Solana DeFi

A powerful tool that automatically discovers, filters, and generates ready-to-use pool configurations using the GeckoTerminal API across multiple Solana DEXs. Perfect for arbitrage bots, trading automation, and DeFi research.

✨ Why This Fetcher is Super Useful

🎯 Arbitrage Trading

Discover pools with sufficient liquidity across multiple DEXs (Raydium, Orca, Meteora, etc.) to identify arbitrage opportunities. Automatically filters pools by liquidity and volume, ensuring you only get pools that can handle meaningful trade sizes.

πŸ€– Automated Trading Bot Setup

Get ready-to-use pool configurations in seconds. Instead of manually researching and configuring each pool, this tool generates complete configs with all necessary information (program IDs, token addresses, pool addresses) that your trading bot can use immediately.

πŸ“Š Market Research & Analysis

Analyze trading volumes, liquidity levels, and price movements across different DEXs. Comprehensive data includes transaction counts, price changes, and market metrics to help you understand market dynamics.

πŸ’§ Liquidity Discovery

Find pools with optimal liquidity for your trading strategy. Filter by minimum liquidity and volume thresholds to discover pools that match your risk tolerance and trading size requirements.

πŸ” Pool Discovery

Quickly discover all available pools for specific token pairs across multiple DEXs. Perfect for finding alternative trading routes or identifying new market opportunities.

πŸ“ˆ Market Monitoring

Track pool metrics over time using the built-in logging system. Historical data helps you identify trends, monitor pool health, and make informed trading decisions.

⚑ Time-Saving Automation

Manually researching pools across multiple DEXs is time-consuming and error-prone. This tool automates the entire process, fetching, filtering, and formatting data in a single command.

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/yourusername/megagecko-pool-fetcher.git
cd megagecko-pool-fetcher

# Install dependencies
npm install

Usage

# Fetch and display pools with details
npm run fetch

# Fetch and output JSON only (for automation)
npm run fetch:json

First Run

On first run, the script will:

  1. Fetch pools from GeckoTerminal API
  2. Filter by liquidity and volume thresholds
  3. Generate pool configurations
  4. Save logs to logs/ directory

βš™οΈ Configuration

Fully customizable - All settings can be modified in fetchPools.ts:

Target Tokens

Edit the TARGET_TOKENS constant to specify which tokens you want to search for:

const TARGET_TOKENS: Record<string, string> = {
    USDC: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
    // Add your tokens here
};

Note: The example tokens (USDC, WBTC, cbBTC) are provided as examples only. Replace them with any Solana token addresses you want to track.

Filter Thresholds

Modify the minimum liquidity and volume filters in the main() function:

const MIN_LIQUIDITY = 1000;  // Minimum liquidity in USD
const MIN_VOLUME_24H = 1000; // Minimum 24h volume in USD

Note: The current values ($1,000) are examples. Adjust them based on your requirements.

πŸ“‹ Features

  • βœ… Multi-DEX Support - Raydium, Orca, Phoenix, Meteora, and more
  • βœ… Smart Filtering - Automatic filtering by liquidity and volume
  • βœ… Complete Data - Prices, volumes, transactions, market metrics
  • βœ… Ready-to-Use Configs - Generated pool configurations for your bot
  • βœ… Dual Logging - JSON logs for automation + human-readable logs
  • βœ… Fully Customizable - All settings can be modified to match your strategy

πŸ“Š Output

The script generates:

  1. Console Output - Formatted pool information and configs
  2. JSON Log (logs/pools-YYYY-MM-DD.json) - Machine-readable data
  3. Text Log (logs/pools-YYYY-MM-DD.txt) - Human-readable summary

Each pool config includes:

  • Pool ID, type, and program ID
  • Token details (addresses, decimals, symbols)
  • Account addresses (state, ammId, or market)
  • Liquidity, volume, prices, and market metrics

πŸ’‘ Example Use Case

Scenario: You want to find all USDC/SOL pools with at least $10,000 liquidity for your arbitrage bot.

  1. Edit TARGET_TOKENS to include USDC and SOL addresses
  2. Set MIN_LIQUIDITY = 10000 in the code
  3. Run npm run fetch
  4. Copy the generated configs to your bot
  5. Start trading! πŸš€

πŸ”§ Example Output

{
  "id": "gecko-orca-cbbtc-usdc-0",
  "type": "amm",
  "programId": "9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP",
  "tokenA": {
    "address": "cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij",
    "decimals": 8,
    "symbol": "cbBTC"
  },
  "tokenB": {
    "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "decimals": 6,
    "symbol": "USDC"
  },
  "accounts": {
    "ammId": "HxA6SKW5qA4o12fjVgTpXdq2YnZ5Zv1s7SB4FFomsyLM"
  },
  "liquidity_usd": "4341059.523",
  "volume_usd": { "h24": "20463475.1896452" },
  "prices": { ... },
  "transactions": { ... }
}

⚠️ API Usage Notice & Limits

GeckoTerminal API

This tool uses the GeckoTerminal API to fetch pool data.

Rate Limits:

  • 30 calls per minute (public API)
  • The script includes a 2-second delay between requests to respect rate limits
  • For higher rate limits, consider CoinGecko API paid plans

API Status:

  • Currently in Beta - subject to changes
  • Free for public use
  • Paid plans available for commercial use and higher limits

Usage Terms:

  • Review GeckoTerminal Terms and Conditions
  • For commercial applications, consider contacting GeckoTerminal or subscribing to a paid API plan
  • Attribution to GeckoTerminal is appreciated

Best Practices:

  • βœ… Respect rate limits (30 calls/minute)
  • βœ… Use responsibly and don't abuse the API
  • βœ… Consider paid plans for production/commercial use
  • βœ… Don't resell or redistribute their data

πŸ“š Documentation

For detailed information about:

  • All available pool config fields
  • Logging system details
  • Supported DEXs

See DOCUMENTATION.md

πŸ› οΈ Tech Stack

  • TypeScript - Type-safe JavaScript
  • Node.js - Runtime environment
  • GeckoTerminal API - Pool data source
  • ts-node - TypeScript execution

πŸ“ˆ Use Cases

  • Arbitrage Bots - Find profitable trading opportunities across DEXs
  • Liquidity Analysis - Research pool liquidity and volume trends
  • Trading Automation - Generate configs for automated trading systems
  • Market Research - Analyze DeFi market dynamics on Solana
  • Pool Monitoring - Track pool health and performance over time

🌟 Key Highlights

  • ⚑ Fast - Fetches and processes pools in seconds
  • πŸ”’ Reliable - Built-in rate limiting and error handling
  • πŸ“Š Comprehensive - Complete pool data with prices, volumes, transactions
  • 🎯 Focused - Smart filtering ensures only relevant pools
  • πŸ”§ Flexible - Fully customizable to match your strategy

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • GeckoTerminal for providing the API
  • Solana DEXs (Raydium, Orca, Meteora, Phoenix) for pool data

πŸ‘€ Author

MishaFYI


Built for Solana DeFi πŸš€

⭐ Star this repo if you find it useful!