A Telegram bot for monitoring Uniswap V3 liquidity positions across multiple chains and notifying users when positions go out of range.
- π Multi-Chain Support: Monitor LP positions on Ethereum, Polygon, Arbitrum, Sui, and Solana
- π Real-time Monitoring: Check position status and range deviations
- π Smart Notifications: Get alerted when positions go out of range
- π Wallet Management: Add and manage multiple wallet addresses
- βοΈ Customizable Settings: Configure notification preferences and thresholds
- π Position Analytics: View detailed position information and status
- Ethereum (ETH): Mainnet with Uniswap V3
- Polygon (MATIC): Polygon network with Uniswap V3
- Arbitrum (ARB): Arbitrum One with Uniswap V3
- Sui (SUI): Mainnet with Cetus, Turbos, and Kriya protocols
- Solana (SOL): Mainnet with Orca, Raydium, and Meteora protocols
- Python 3.8 or higher
- Telegram Bot Token (get from @BotFather)
- RPC endpoints for supported chains
-
Clone the repository
git clone <repository-url> cd lp-notifier
-
Install dependencies
# Create virtual environment python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install all dependencies including Solana/Sui packages pip install -r requirements.txt
-
Configure environment variables
cp .env.example .env # Edit .env with your configuration -
Set up your environment variables
# Required BOT_TOKEN=your_telegram_bot_token_here # EVM Chain RPC URLs ETHEREUM_RPC_URL=https://mainnet.infura.io/v3/YOUR_PROJECT_ID POLYGON_RPC_URL=https://polygon-rpc.com ARBITRUM_RPC_URL=https://arb1.arbitrum.io/rpc # NEW: Non-EVM Chain RPC URLs SUI_RPC_URL=https://fullnode.mainnet.sui.io:443 SOLANA_RPC_URL=https://api.mainnet-beta.solana.com # Optional: Customize monitoring settings LP_CHECK_INTERVAL=300 PRICE_DEVIATION_THRESHOLD=0.05 RANGE_DEVIATION_THRESHOLD=0.10
-
Run the bot
python main.py
| Command | Description |
|---|---|
/start |
Start the bot and see welcome message |
/help |
Show help and available commands |
/addwallet |
Add a new wallet address to monitor |
/removewallet <address> |
Remove a wallet from monitoring |
/wallets |
List all your registered wallets |
/check |
Check current status of all your LP positions |
/status |
Get a quick overview of your positions |
/settings |
Configure notification preferences and enabled chains |
- Start the bot: Send
/startto begin - Add your wallet: Use
/addwalletand follow the prompts - Check positions: Use
/checkto see your LP status - Configure settings: Use
/settingsto customize notifications
/addwallet
0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6
Then provide a label: Main DeFi Wallet
/addwallet
0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb123456789012345678901234567890123456789012345678901234567890
Then provide a label: Sui Trading Wallet
/addwallet
So11111111111111111111111111111111111111112
Then provide a label: Solana DeFi Wallet
/start
/addwallet
0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6
Main DeFi Wallet
/check
π LP Position Report
Total Positions: 8
Out of Range: 2
β οΈ ALERT: Some positions are out of range!
π Main DeFi Wallet
0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6
π Ethereum: 2 positions (1 out of range)
β οΈ ETH/USDC (ID: 12345)
Deviation: 12.5%
π Polygon: 1 position
π Sui Trading Wallet
0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb...
π Sui: 3 positions (1 out of range)
β οΈ SUI/USDC (Cetus - ID: cetus_123)
Deviation: 8.7%
π Solana DeFi Wallet
So11111111111111111111111111111111111111112
π Solana: 2 positions
β’ Orca: 1 position
β’ Meteora: 1 position
β οΈ LP Position Alert
Wallet: Sui Trading Wallet
0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb...
Out of Range Positions: 1
1. SUI/USDC (Cetus - Sui)
Position ID: cetus_position_123
Deviation: 15.2%
Current Tick: 2000
Range: 1800 - 2200
Use /check to see all your positions.
| Variable | Description | Default |
|---|---|---|
BOT_TOKEN |
Telegram bot token (required) | - |
ETHEREUM_RPC_URL |
Ethereum RPC endpoint | Infura default |
POLYGON_RPC_URL |
Polygon RPC endpoint | Polygon RPC |
ARBITRUM_RPC_URL |
Arbitrum RPC endpoint | Arbitrum RPC |
SUI_RPC_URL |
Sui RPC endpoint | Sui mainnet |
SOLANA_RPC_URL |
Solana RPC endpoint | Solana mainnet |
LP_CHECK_INTERVAL |
Position check interval (seconds) | 300 |
PRICE_DEVIATION_THRESHOLD |
Price deviation alert threshold | 0.05 (5%) |
RANGE_DEVIATION_THRESHOLD |
Range deviation alert threshold | 0.10 (10%) |
ENABLE_NOTIFICATIONS |
Enable/disable notifications | true |
MAX_NOTIFICATIONS_PER_HOUR |
Rate limit for notifications | 10 |
Users can configure:
- Enabled chains for monitoring
- Notification frequency
- Price deviation thresholds
- Range deviation thresholds
telegram_bot.py: Main bot implementation with command handlerslp_monitor.py: LP position monitoring and range checkingdatabase.py: SQLite database for user data and preferencesconfig.py: Configuration management and chain settings
- users: User information and preferences
- wallet_addresses: Registered wallet addresses per user
- lp_positions: Cached LP position data
- notifications: Notification history and rate limiting
- user_preferences: User-specific settings
lp-notifier/
βββ main.py # Main entry point
βββ telegram_bot.py # Telegram bot implementation
βββ lp_monitor.py # LP monitoring logic
βββ database.py # Database operations
βββ config.py # Configuration management
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ README.md # This file
βββ lp_notifier.db # SQLite database (created automatically)
To add support for a new chain:
- Add chain configuration to
config.py - Update
SUPPORTED_CHAINSdictionary - Implement chain-specific logic in
lp_monitor.py - Update documentation
# Run basic tests
python -m pytest tests/
# Run with coverage
python -m pytest --cov=. tests/- Private Keys: Never store private keys in the bot
- RPC Endpoints: Use secure, private RPC endpoints in production
- Rate Limiting: Implement rate limiting for API calls
- Data Privacy: User data is stored locally in SQLite
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Ethereum/Polygon/Arbitrum: Use 40 hex characters after 0x (e.g.,
0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6) - Sui: Use 64 hex characters after 0x (e.g.,
0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb123456789012345678901234567890123456789012345678901234567890) - Solana: Use Base58 encoded public key (e.g.,
So11111111111111111111111111111111111111112)
- Verify the wallet has LP positions on the specified chain
- Check if the RPC endpoints are working
- Ensure the wallet address is correct
- Check your RPC URLs in the .env file
- Verify internet connection
- Try different RPC endpoints
# Test basic functionality
python test_bot.py
# Test new chain integrations
python test_sui_solana.py
# Test specific components
python -c "from sui_monitor import SuiMonitor; print('Sui monitor OK')"
python -c "from solana_monitor import SolanaMonitor; print('Solana monitor OK')"# View bot logs
tail -f lp_notifier.log
# Check database
sqlite3 lp_notifier.db ".tables"
sqlite3 lp_notifier.db "SELECT * FROM users LIMIT 5;"# Build and run
docker-compose up -d
# View logs
docker-compose logs -f lp-notifier-bot
# Stop
docker-compose down# Build image
docker build -t lp-notifier-bot .
# Run container
docker run -d \
--name lp-notifier-bot \
--env-file .env \
-v $(pwd)/data:/app/data \
lp-notifier-botFor support or questions:
- Create an issue on GitHub
- Contact the bot administrator
- Check the
/helpcommand in the bot
- Add support for Sui blockchain
- Add support for Solana blockchain
- Multi-protocol support (Cetus, Orca, Raydium, Meteora, etc.)
- Add support for more chains (BSC, Optimism, etc.)
- Implement detailed position analytics
- Add historical performance tracking
- Web dashboard for advanced users
- Mobile app companion
- Advanced notification filters
- Integration with other DEX protocols