Skip to content

A velocity‑first sentiment trading engine that ingests multi‑platform social signals in real time, filters manipulation, applies risk, and executes trades via Yellow Network state channels for gas-less transaction.

Notifications You must be signed in to change notification settings

0xrupamp26/SentimentVelocityBot

Repository files navigation

SentimentVelocityBot

A Telegram-first, gasless, sub-100ms sentiment-trading assistant that executes orders via Yellow Network state-channels (ERC-7824/Nitrolite) and settles final channel state on-chain for verifiable outcomes.

🔗 Access the bot on Telegram

<<<<<<< HEAD License: MIT TypeScript Next.js Telegram

=======

29f24e545f96b1b734cdb23e53a1be619679437c

Overview

WinSurf delivers institutional-speed sentiment trading UX with end-to-end off-chain execution under one second and on-chain settlement on demand. It proves gasless, high-throughput trading by keeping order exchange off-chain in ERC-7824 channels and committing only the terminal state on-chain.

Architecture

  • Frontend: Next.js web dashboard for strategies, limits, latency/PnL telemetry
  • Bot Service: Node.js/TypeScript Telegram bot for wallet connection and trade execution
  • State Channels: ERC-7824/Nitrolite SDK for off-chain state management
  • Settlement: On-chain adjudicator contracts for final state verification

Key Features

  • Sub-100ms off-chain trade execution
  • Gasless trading via state channels
  • Telegram bot interface with wallet integration
  • Real-time sentiment-based triggers
  • Risk management and policy gates
  • Verifiable on-chain settlement

<<<<<<< HEAD

🚀 Quick Start

For Users

For Developers

  1. Clone and install dependencies

    git clone https://github.com/yourusername/SentimentVelocityBot.git
    cd SentimentVelocityBot
    npm install
  2. Setup Environment

    # Copy example environment file
    cp .env.example .env.local
    
    # Edit .env.local with your configuration
    # Required:
    # - TELEGRAM_BOT_TOKEN
    # - PRIVATE_KEY
    # - RPC_URL
  3. Run Development Servers

    # Terminal 1: Start Next.js frontend
    npm run dev
    
    # The app will be available at http://localhost:3000
  4. Set up Webhook (for production)

    # Set webhook URL (replace with your public URL)
    npm run setup-webhook -- --url https://your-domain.com/api/webhook

⚙️ Configuration

Required Environment Variables

Variable Description Example
TELEGRAM_BOT_TOKEN Your Telegram bot token from @BotFather 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
PRIVATE_KEY Ethereum wallet private key (for signing transactions) 0x123...abc
RPC_URL Ethereum JSON-RPC endpoint https://mainnet.infura.io/v3/your-project-id

Optional Variables

Variable Description Default
NEXT_PUBLIC_WEBAPP_URL Public URL for webhook callbacks http://localhost:3000
CHAIN_ID Ethereum chain ID 1 (Mainnet)
NODE_ENV Environment mode development

🤖 Bot Commands

Wallet Commands

  • /start - Initialize the bot and show welcome message
  • /connect - Connect your wallet
  • /balance - Check your wallet balance
  • /disconnect - Disconnect your wallet

Trading Commands

  • /trade [pair] [side] [amount] - Execute a trade Example: /trade ETH/USD long 100
  • /positions - View your open positions
  • /history - View trade history
  • /settings - Configure trading preferences

Admin Commands

  • /status - Check bot status
  • /help - Show help message

🛠 Technology Stack

Core

  • Next.js 14 - React framework for the web interface
  • TypeScript - Type-safe JavaScript
  • Ethers.js - Ethereum wallet and blockchain interaction
  • node-telegram-bot-api - Telegram Bot API implementation

Smart Contracts

  • ERC-20/ERC-721 - Token standards support
  • State Channels - Off-chain transaction processing
  • Smart Contracts - On-chain settlement

Infrastructure

  • Vercel - Hosting and serverless functions
  • Alchemy/Infura - Blockchain node providers
  • MongoDB - Database for user data and trade history

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙋‍♂️ Support

For support, please open an issue or contact us at [email protected]

🌟 Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

📜 Changelog

See CHANGELOG.md for version history and changes.

Quick Start

  1. For Users:

  2. For Developers:

    # Clone the repository
    git clone https://github.com/0xrupamp26/SentimentVelocityBot.git
    cd SentimentVelocityBot
    
    # Install dependencies
    npm install
    
    # Set up environment variables
    cp .env.example .env
    # Edit .env with your configuration
    
    # Start development servers
    # Terminal 1: Frontend
    npm run dev:frontend
    
    # Terminal 2: Bot service
    npm run dev:bot

Environment Variables

  • TELEGRAM_BOT_TOKEN: Your Telegram bot token
  • PRIVATE_KEY: Wallet private key for signing transactions
  • CLEARNODE_URL: ClearNode WebSocket endpoint
  • RPC_URL: Ethereum RPC endpoint
  • ADJUDICATOR_ADDRESS: ERC-7824 adjudicator contract address

Usage

  1. Start a chat with the Telegram bot
  2. Connect your wallet using /connect
  3. Set trading preferences with /settings
  4. Enable auto-trading with /auto on
  5. Monitor trades on the web dashboard

Technology Stack

  • ERC-7824: Chain-agnostic state-channel framework
  • Nitrolite SDK: TypeScript client for state channel management
  • ClearNode: High-throughput off-chain messaging broker
  • Yellow Network: Layer-3 state-channel mesh and smart clearing

License

MIT

29f24e545f96b1b734cdb23e53a1be619679437c

About

A velocity‑first sentiment trading engine that ingests multi‑platform social signals in real time, filters manipulation, applies risk, and executes trades via Yellow Network state channels for gas-less transaction.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published