Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fourmeme-ethers-interactive

中文文档 | English

A powerful trading bot for Four.meme & PancakeSwap, enabling fast BSC token trading via Telegram.

✨ Features

  • 🤖 Telegram Bot Integration: Trade instantly by sending contract addresses
  • ⚡️ Lightning Fast: Optimized transaction flow with millisecond-level confirmation
  • 🔄 Smart Routing:
    • Auto-detect token graduation status
    • Non-graduated tokens: Trade on Four.meme internal market
    • Graduated tokens: Auto-switch to PancakeSwap external market
  • 💰 Flexible Trading:
    • Multiple buy tiers (0.01B ~ 1B)
    • Percentage-based selling (10% ~ 100%)
  • 🔐 Secure & Reliable:
    • Automatic token approval (once only)
    • Configurable slippage protection
    • Detailed transaction logs and timing stats

📦 Installation

# Clone the repository
git clone <your-repo-url>
cd fourmeme-ethers-interactive

# Install dependencies
npm install

⚙️ Configuration

1. Create .env configuration file

cp .env.example .env

2. Edit .env file with the following parameters:

# BSC RPC node URL
RPC_URL=https://bsc.blockrazor.xyz/

# BSC WebSocket node URL (for event listening)
WSS_URL=wss://multi-flashy-research.bsc.quiknode.pro/your-key

# Wallet private key (keep it secure, never share)
PRIVATE_KEY=0xyour_private_key

# Telegram Bot Token (get from @BotFather)
TELEGRAM_BOT_TOKEN=your_bot_token

# Gas Price configuration (unit: gwei)
BUY_GAS_PRICE=5       # Gas Price for buying
SELL_GAS_PRICE=5      # Gas Price for selling

3. Parameter Description

Parameter Description Example
RPC_URL BSC mainnet RPC node https://bsc-dataseed1.binance.org
WSS_URL BSC WebSocket node wss://bsc-ws-node.example.com
PRIVATE_KEY Wallet private key (starts with 0x) 0x123abc...
TELEGRAM_BOT_TOKEN Telegram Bot Token 123456:ABC-DEF...
BUY_GAS_PRICE Buy Gas price (gwei) 5
SELL_GAS_PRICE Sell Gas price (gwei) 5

🚀 Launch

npm start

After successful launch, you will see:

Bot 已启动。发送 0x 合约地址即可查询。
当前钱包地址: 0x...

📱 Usage

1. Open Telegram and find your bot

2. Send token contract address

Send a BSC token contract address (e.g., 0x123abc...), the bot will return:

📊 Token Info
🪙 Contract Address: 0x123abc...
📥 Current Holdings: 100 TOKEN

[⚡️ Buy 0.01B] [⚡️ Buy 0.03B] [⚡️ Buy 0.05B] [⚡️ Buy 0.07B]
[⚡️ Buy 0.1B]  [⚡️ Buy 0.2B]  [⚡️ Buy 0.5B]  [⚡️ Buy 1B]
[📌 Sell 10%]  [📌 Sell 30%]  [📌 Sell 50%]  [📌 Sell 100%]

3. Click buttons to trade

  • Buy: Click ⚡️ Buy 0.1B to buy tokens with 0.1 BNB
  • Sell: Click 📌 Sell 50% to sell 50% of your holdings

4. View transaction results

After successful transaction, the bot will return transaction hash and BSCScan link:

⚡️ Transaction successful: [View on BSCScan](https://bscscan.com/tx/0x...)
Buy process time: 1234ms (1.23s)

🔧 Advanced Features

Automatic Approval Management

  • First-time token selling will automatically approve
  • Subsequent sells don't require re-approval, saving gas

Smart Route Switching

  • Bot automatically detects if token has graduated from Four.meme
  • Non-graduated: Use Four.meme internal market (low slippage)
  • Graduated: Auto-switch to PancakeSwap (better liquidity)

Slippage Protection

  • Four.meme internal: 10% slippage protection by default
  • PancakeSwap external: 5% slippage protection by default
  • Customize SLIPPAGE_BPS in src/config/constants.js

Performance Monitoring

Each transaction displays detailed timing statistics:

Quote retrieval time: 234ms (0.23s)
Buy process time: 1234ms (1.23s)

📂 Project Structure

fourmeme-ethers-interactive/
├── src/
│   ├── config/
│   │   ├── config.js         # Main configuration
│   │   ├── constants.js      # Constants definition
│   │   └── tool.js           # Utility functions
│   ├── service/
│   │   └── pancake.js        # PancakeSwap trading logic
│   ├── bot.js                # Telegram Bot entry
│   └── buy.js                # Buy/Sell core logic
├── .env                      # Environment variables
├── package.json
└── README.md

⚠️ Security Tips

  1. Private Key Security:

    • Never commit .env file to Git
    • Never share your private key publicly
    • Recommended to use a dedicated wallet for trading
  2. Gas Fees:

    • BSC transactions require BNB for gas fees
    • Recommended to keep at least 0.01 BNB as gas reserve
  3. Trading Risks:

    • Cryptocurrency trading involves risks
    • Manage your position size wisely
    • Implement proper risk management

🐛 FAQ

Q: What to do when seeing "Insufficient funds"?

A: Ensure your wallet has enough BNB for purchasing and paying gas fees.

Q: What to do when transaction fails?

A: Check:

  • Network connection is stable
  • Gas Price is set reasonably
  • Token has sufficient liquidity

Q: How to modify buy amount tiers?

A: Edit inline_keyboard button configuration in src/bot.js.

📄 License

MIT License

🤝 Contributing

Issues and Pull Requests are welcome!


Disclaimer: This project is for educational purposes only. Users are responsible for any risks associated with using this tool for trading.

About

A powerful trading bot for Four.meme & PancakeSwap

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages