Telegram bot for monitoring and managing Meteora DLMM LP positions. View positions, track PnL, get alerts, and close positions -- all from Telegram. Powered by LP Agent API.
| Command | Description |
|---|---|
/positions |
Open LP positions with PnL, fees, range status |
/history |
Last 10 closed positions |
/overview |
Portfolio metrics (total PnL, win rate, APR) |
/revenue |
Daily/weekly/monthly revenue breakdown |
/balance |
Wallet token balances |
/discover |
Top 5 pools by 24h volume |
/pool <addr> |
Pool details (fees, liquidity, type) |
/close |
Close a position and swap to SOL |
/alerts |
Current alert thresholds |
/close walks you through an interactive flow:
- Shows your open positions as buttons
- Tap a position to see a quote
- Confirm to execute -- closes 100%, swaps to SOL via Jupiter
- Returns a Solscan transaction link
Caution
/close executes a real on-chain transaction. Double-check the position before confirming. There is no undo.
The bot checks positions on a cron interval and notifies when:
- PnL crosses upper/lower thresholds
- Position goes out of range (or back in)
- Unclaimed fees hit a milestone
- DPR drops below minimum
No open positions = no alerts, the monitor idles.
The bot sends a compact summary of all open positions at a configurable interval (default: every 1 minute). Each update shows pair, value, PnL%, range status, fees, and DPR. Only sends when there are open positions.
Set POSITION_UPDATE_INTERVAL in your .env to control the frequency (in minutes).
Automatically closes positions when PnL crosses take-profit or stop-loss thresholds.
AUTO_TP_PERCENT=10-- close when PnL >= +10%AUTO_SL_PERCENT=-15-- close when PnL <= -15%
Note
Requires SOLANA_PRIVATE_KEY to execute on-chain closes. Without it, the bot sends an alert but does not close the position.
Caution
Auto TP/SL executes real on-chain transactions. Set thresholds carefully. Each position is only auto-closed once -- if the close fails, it retries on the next check cycle.
All API calls retry up to 3 times on 429 (rate limit) and 5xx (server error) responses. Backoff is exponential: 2s, 4s, 8s. Non-retryable errors (4xx, network) fail immediately.
- Telegram Bot Token -- create via @BotFather
- Telegram Chat ID -- send a message to your bot, then check
https://api.telegram.org/bot<TOKEN>/getUpdates - LP Agent API Key -- get from lpagent.io (free tier: 5 RPM)
- Wallet Address -- your Solana wallet
cp .env.example .envEdit .env with your values:
TELEGRAM_BOT_TOKEN=your_token
TELEGRAM_CHAT_ID=your_chat_id
LPAGENT_API_KEY=your_api_key
WALLET_ADDRESS=your_solana_wallet
# Required for /close and auto TP/SL (base58 private key)
# SOLANA_PRIVATE_KEY=
# Optional alert thresholds
ALERT_PNL_UPPER=20 # notify when PnL >= 20%
ALERT_PNL_LOWER=-10 # notify when PnL <= -10%
ALERT_FEE_MILESTONE=5 # notify every $5 in unclaimed fees
ALERT_DPR_MIN=1 # notify when DPR < 1%
ALERT_CHECK_INTERVAL=2 # check every 2 minutes
# Auto updates and TP/SL
POSITION_UPDATE_INTERVAL=1 # send position summary every N minutes
AUTO_TP_PERCENT=10 # auto close when PnL >= 10%
AUTO_SL_PERCENT=-15 # auto close when PnL <= -15%npm install
npm run build
npm startFor development:
npm run devdocker build -t meteora-bot .
docker run -d --env-file .env --name meteora-bot meteora-botNote
Free tier is limited to 5 requests per minute. The bot queues requests automatically, but responses may be slightly delayed under heavy use.
Warning
Never commit your .env file. It contains your API keys and wallet address.
The API client tracks request timestamps and queues anything beyond 5 RPM. The alert monitor uses ~0.5 RPM (1 call every 2 minutes), leaving room for manual commands.
- grammY -- Telegram bot framework
- LP Agent API -- Meteora DLMM data + zap-out
- TypeScript, node-cron, axios
MIT
