A Telegram bot for managing Solana wallets and interacting with DeFi protocols. This bot allows users to deposit USDC, mint USDi, and manage their wallets directly through Telegram.
- 💰 Wallet Creation & Management
- 💎 USDC Deposits & Withdrawals
- 📈 Minting
- 🔄 USDi/USDC Conversions
- 🔒 Secure Backup & Recovery
- 📊 Balance Checking
- 🌀 Liquidity Pools (Orca Whirlpools Integration)
- 🔄 Network Switching (mainnet/devnet/testnet)
- Node.js (v16 or higher)
- npm or yarn
- Telegram Bot Token (from @BotFather)
- Solana RPC endpoint (optional, defaults to public endpoints)
- Clone the repository:
git clone https://github.com/btunter/hedge-traing-bot-beta.git
cd hedge-traing-bot-beta- Install dependencies:
npm install- Create a
.envfile in the root directory:
# Required
BOT_TOKEN=your_telegram_bot_token_here
# Network configuration (optional)
SOLANA_NETWORK=mainnet-beta # Options: mainnet-beta, devnet, testnet, localnet
# Custom RPC endpoints (optional)
MAINNET_RPC_URL=https://your-custom-mainnet-rpc.com
DEVNET_RPC_URL=https://your-custom-devnet-rpc.com
TESTNET_RPC_URL=https://your-custom-testnet-rpc.comStart the bot in development mode:
npm run devStart with a specific Solana network:
SOLANA_NETWORK=devnet npm run devBuild the TypeScript code:
npm run buildStart the production version:
npm start/start- Initialize the bot and show main menu/deposit- Get deposit address/mint- Start minting/balance- Check current balances/convert- Convert between USDi and USDC/withdraw- Withdraw funds/backup- Backup wallet seed phrase/reset- Reset wallet/help- Show available commands
/pools- List supported pools/poolstats <index>- Show stats for a specific pool/pooldeposit <index> <amount>- Deposit to a specific pool/positions- List your open positions/closepos <mint>- Close a specific position
/network [network]- Display current network or request change
src/
├── commands/ # Command handlers
├── services/ # Core services
│ ├── wallet.ts # Wallet management
│ ├── orcaLiquidity.ts # Orca pool interaction
│ └── connectionManager.ts # Solana connection management
├── types/ # TypeScript type definitions
└── utils/ # Utilities and constants
The bot supports dynamic configuration through environment variables:
| Variable | Description | Default |
|---|---|---|
BOT_TOKEN |
Telegram Bot Token | (required) |
SOLANA_NETWORK |
Solana network to use | mainnet-beta |
MAINNET_RPC_URL |
Custom RPC URL for mainnet | Public endpoint |
DEVNET_RPC_URL |
Custom RPC URL for devnet | Public endpoint |
TESTNET_RPC_URL |
Custom RPC URL for testnet | Public endpoint |
LOCALNET_RPC_URL |
Custom RPC URL for localnet | http://localhost:8899 |
- Seed phrases are only shown once during backup
- Private keys are stored encrypted (TODO)
- Never share your seed phrase or private keys
- Always verify transaction details before confirming
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This bot is provided as-is. Users are responsible for their own funds and should exercise caution when using DeFi protocols.