Skip to content

MatthewSullivn/sharkpulse-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦈 SharkPulse Bot

A Telegram bot that delivers real-time Solana and SharkPool metrics directly to your chat.

Built using the SharkLabs Public API.

Features

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

API Endpoints Used

This bot integrates with three SharkPool API endpoints:

  • GET /metrics — Solana price, TPS, SharkSOL APY, pool amount, epoch info
  • GET /lst/metrics — Historical LST APY and lamport data
  • GET /validators/vote/{voteAddress}/stake — Validator-specific stake information

📚 Full API Documentation

Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/sharkpulse-bot.git
    cd sharkpulse-bot
  2. Install dependencies

    npm install
  3. Configure environment

    cp .env.example .env

    Edit .env and add your Telegram bot token:

    BOT_TOKEN=your_telegram_bot_token_here
    
  4. Start the bot

    npm start
  5. Test it!

    Open Telegram, find your bot, and send /start

Getting a Telegram Bot Token

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts
  3. Choose a name (e.g., "SharkPulse Bot")
  4. Choose a username (e.g., SharkPulseBot - must end in "bot")
  5. Copy the token BotFather gives you

Example Usage

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

Tech Stack

Project Structure

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

Deployment

Railway / Render / Fly.io

  1. Push your code to GitHub
  2. Connect your repository to your hosting platform
  3. Set the BOT_TOKEN environment variable
  4. Deploy!

VPS / Always-On Server

Use a process manager like PM2:

npm install -g pm2
pm2 start index.js --name sharkpulse-bot
pm2 save

License

MIT License - feel free to use and modify!


Built for the SharkLabs Special Quest 🦈

Data powered by SharkPool & SharkLabs

About

A Telegram bot that delivers SharkPool metrics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors