Say Hello to Eventra.

Eventra AI is a lightweight, AI-powered SDK Agent designed to monitor the Solana blockchain. It allows developers to track real-time events like token transfers, contract calls, and stake updates while sending actionable alerts through a Telegram bot. Build eventra today and customize it anyway you like. Simple code, multiple use cases.

FRXpPj5VZfjBgt36TJc4ucfDBojYuY6cHuXh1Nwfpump

Real-Time Monitoring: Stay updated on the latest Solana blockchain activities.

Introduction.

# Solana Event Watcher with Telegram Bot
This project is an AI-based event watcher for the Solana blockchain that notifies users of blockchain events via a Telegram bot.
---
## Features- Real-time tracking of Solana events (token transfers, contract calls, stake updates).- AI-based filtering of events to prioritize actionable updates.- Telegram bot for managing subscriptions and receiving notifications.
---
## Installation
### Prerequisites- Python 3.8 or higher- PostgreSQL database
### Setup1. Clone this repository: ```bash git clone https://github.com/your-repo/solana-event-watcher.git cd solana-event-watcher ```
2. Install dependencies: ```bash pip install -r requirements.txt ```
3. Configure the bot and backend: - Update `bot/config.py` with your Telegram bot token, Solana RPC URL, and database credentials.
4. Set up the database: ```bash psql -U postgres -c "CREATE DATABASE solana_event_watcher;" ```
---
## Usage
### Start the Telegram BotRun the Telegram bot:```bashpython bot/bot.py```
### Monitor EventsRun the event listener:```bashpython backend/event_listener.py```
---
## Commands- `/start` – Display welcome message.- `/subscribe <wallet>` – Subscribe to a wallet address.- `/events` – Fetch recent events.
---
## Future Enhancements- Add user-defined filters for notifications.- Premium features for advanced filtering and historical data access.

Requirements

python-telegram-bot==20.3

solana==0.22.0

numpy==1.25.0

scikit-learn==1.3.0

psycopg2-binary==2.9.6

sqlalchemy==2.0.9

ai processor

import numpy as npfrom sklearn.ensemble import IsolationForest
def process_events(events): data = np.array(events) model = IsolationForest(n_estimators=100, contamination=0.1) predictions = model.fit_predict(data) return [event for i, event in enumerate(events) if predictions[i] == 1]

Database

from sqlalchemy import create_engine, Column, Integer, String, Table, MetaDatafrom sqlalchemy.orm import sessionmaker
# Database ConfigurationDATABASE_URL = "postgresql://username:password@localhost:5432/solana_event_watcher"engine = create_engine(DATABASE_URL)SessionLocal = sessionmaker(bind=engine)
# Define tablesmetadata = MetaData()subscriptions = Table( "subscriptions", metadata, Column("id", Integer, primary_key=True), Column("chat_id", String, nullable=False), Column("wallet_address", String, nullable=False),)
# Create tables if they don't existmetadata.create_all(engine)
# Helper functiondef add_subscription(chat_id, wallet_address): with engine.connect() as conn: conn.execute(subscriptions.insert().values(chat_id=chat_id, wallet_address=wallet_address))

Event Listener

from solana.rpc.async_api import AsyncClientfrom solana.publickey import PublicKeyimport asyncio
async def monitor_wallet(wallet_address, callback): client = AsyncClient("https://api.mainnet-beta.solana.com") public_key = PublicKey(wallet_address)
async for log in client.logs_subscribe(public_key): await callback(log.result)
async def main(callback): # Add wallets to monitor wallets_to_monitor = ["YOUR_WALLET_ADDRESS_HERE"] tasks = [monitor_wallet(wallet, callback) for wallet in wallets_to_monitor] await asyncio.gather(*tasks)

Telegram bot (bot.py)

from telegram.ext import Updater, CommandHandlerfrom backend.database import add_subscription
# Load Bot Tokenfrom config import TELEGRAM_BOT_TOKEN
def start(update, context): update.message.reply_text("Welcome! Use /subscribe <wallet> to start monitoring events.")
def subscribe(update, context): if len(context.args) < 1: update.message.reply_text("Usage: /subscribe <wallet_address>") return
wallet = context.args[0] chat_id = update.effective_chat.id
# Save to database add_subscription(chat_id, wallet) update.message.reply_text(f"Subscribed to wallet: {wallet}")
def run_bot(): updater = Updater(TELEGRAM_BOT_TOKEN) dispatcher = updater.dispatcher
dispatcher.add_handler(CommandHandler("start", start)) dispatcher.add_handler(CommandHandler("subscribe", subscribe))
updater.start_polling() updater.idle()
if __name__ == "__main__": run_bot()

Telegram bot (config.py)

TELEGRAM_BOT_TOKEN = "YOUR_TELEGRAM_BOT_TOKEN"DATABASE_URL = "postgresql://username:password@localhost:5432/solana_event_watcher"SOLANA_RPC_URL = "https://api.mainnet-beta.solana.com"

Customize Eventra.

Your code and ideas here….