A Telegram bot that delivers real-time Solana and SharkPool metrics directly to your chat.
Built using the SharkLabs Public API.
| Command | Description |
|---|---|
/start |
Welcome message and command overview |
/help |
Detailed help for all commands |
/metrics |
Live Solana & SharkSOL stats (price, TPS, APY, epoch) |
/lst |
Recent LST APY history (last 5 of 30 data points) |
/stake <vote_address> |
Lookup SharkPool stake for any validator |
This bot integrates with three SharkPool API endpoints:
GET /metrics— Solana price, TPS, SharkSOL APY, pool amount, epoch infoGET /lst/metrics— Historical LST APY and lamport dataGET /validators/vote/{voteAddress}/stake— Validator-specific stake information
- Node.js v18+
- A Telegram Bot Token from @BotFather
-
Clone the repository
git clone https://github.com/yourusername/sharkpulse-bot.git cd sharkpulse-bot -
Install dependencies
npm install
-
Configure environment
cp .env.example .env
Edit
.envand add your Telegram bot token:BOT_TOKEN=your_telegram_bot_token_here -
Start the bot
npm start
-
Test it!
Open Telegram, find your bot, and send
/start
- Open Telegram and search for @BotFather
- Send
/newbotand follow the prompts - Choose a name (e.g., "SharkPulse Bot")
- Choose a username (e.g.,
SharkPulseBot- must end in "bot") - Copy the token BotFather gives you
User: /metrics
Bot: 📊 SharkPool / Solana Metrics
💰 SOL Price: $234.56
⚡ TPS: 2,847
🦈 SharkSOL APY: 7.82%
🏊 Pool Amount: 1,234,567 SOL
📅 Epoch: 685
📊 Progress: 45.23%
⏱️ Time Remaining: 1h 23m
User: /stake 7K8DVxtNJGnMtUY1CQJT5jcs8sFGSZTDiG7kowvFpECh
Bot: 🔍 SharkPool Stake for Validator
📍 Vote Address: 7K8DVxtNJGnMtUY1CQJT5jcs8sFGSZTDiG7kowvFpECh
💎 Current Stake: 50,000 SOL
📜 Recent Stake History:
• 2024-12-01: 48,500 SOL
• 2024-12-05: 49,200 SOL
• 2024-12-08: 50,000 SOL
- Runtime: Node.js (ES Modules)
- Bot Framework: Telegraf.js
- HTTP Client: node-fetch
- API: SharkPool Public API
sharkpulse-bot/
├── index.js # Main bot logic
├── package.json # Dependencies and scripts
├── .env.example # Environment template
├── .env # Your local config (not committed)
└── README.md # This file
- Push your code to GitHub
- Connect your repository to your hosting platform
- Set the
BOT_TOKENenvironment variable - Deploy!
Use a process manager like PM2:
npm install -g pm2
pm2 start index.js --name sharkpulse-bot
pm2 saveMIT License - feel free to use and modify!
Built for the SharkLabs Special Quest 🦈