中文文档 | English
A powerful trading bot for Four.meme & PancakeSwap, enabling fast BSC token trading via Telegram.
- 🤖 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
# Clone the repository
git clone <your-repo-url>
cd fourmeme-ethers-interactive
# Install dependencies
npm installcp .env.example .env# 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| 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 |
npm startAfter successful launch, you will see:
Bot 已启动。发送 0x 合约地址即可查询。
当前钱包地址: 0x...
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%]
- Buy: Click
⚡️ Buy 0.1Bto buy tokens with 0.1 BNB - Sell: Click
📌 Sell 50%to sell 50% of your holdings
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)
- First-time token selling will automatically approve
- Subsequent sells don't require re-approval, saving gas
- 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)
- Four.meme internal: 10% slippage protection by default
- PancakeSwap external: 5% slippage protection by default
- Customize
SLIPPAGE_BPSinsrc/config/constants.js
Each transaction displays detailed timing statistics:
Quote retrieval time: 234ms (0.23s)
Buy process time: 1234ms (1.23s)
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
-
Private Key Security:
- Never commit
.envfile to Git - Never share your private key publicly
- Recommended to use a dedicated wallet for trading
- Never commit
-
Gas Fees:
- BSC transactions require BNB for gas fees
- Recommended to keep at least 0.01 BNB as gas reserve
-
Trading Risks:
- Cryptocurrency trading involves risks
- Manage your position size wisely
- Implement proper risk management
A: Ensure your wallet has enough BNB for purchasing and paying gas fees.
A: Check:
- Network connection is stable
- Gas Price is set reasonably
- Token has sufficient liquidity
A: Edit inline_keyboard button configuration in src/bot.js.
MIT License
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.