Skip to content

Degenapetrader/TRUST-BOT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– TRUSTBOT - GUI Trading Bot for Base Network

๐Ÿš€ Overview

TRUSTBOT is a GUI trading bot built with Electron, designed for automated trading on the Base network (Layer 2). It features multiple trading strategies, real-time WebSocket monitoring, and a robust multi-provider RPC infrastructure for maximum reliability.

Key Features

  • ๐Ÿ–ฅ๏ธ Modern GUI Interface - Intuitive Electron-based desktop application
  • โšก Real-time Trading - WebSocket integration for instant market response
  • ๐Ÿ”„ Multi-Provider RPC - Alchemy, QuickNode, Infura + dynamic providers
  • ๐Ÿ›ก๏ธ Robust Architecture - Modular design with automatic failover
  • ๐Ÿ’Ž TRUSTSWAP Integration - Optimized 0.25% fee trading through TRUSTSWAP contract

๐ŸŽฏ Trading Bots

๐Ÿ’ฐ BuyBot

Automated token purchasing with advanced execution modes

  • Logic: Purchases tokens using VIRTUAL or other currencies
  • Methods: Direct purchase, TWAP (Time-Weighted Average Price)
  • RPC Usage: Multi-provider rotation for transaction execution
  • Features: Percentage-based amounts, loop execution, parallel wallet processing

๐Ÿ’ธ SellBot

Smart token selling with multiple execution strategies

  • Logic: Sells tokens for VIRTUAL or other currencies with optimized timing
  • Methods: Regular sell, TWAP mode, FSH (Flash Sell All)
  • RPC Usage: WebSocket balance monitoring + RPC transaction execution
  • Features: Multi-token support, automatic pool detection, blacklist protection

๐ŸŒพ FarmBot

Volume generation through automated buy-sell cycles

  • Logic: Creates trading volume by executing rapid buyโ†’sell cycles
  • Methods: Parallel execution with consecutive nonces (n, n+1)
  • RPC Usage: Real-time balance tracking with WebSocket optimization
  • Features: Amount randomization (ยฑ10%), timeout handling, performance tracking

๐Ÿ“Š MMBot (Market Maker)

Automated market making with dynamic range trading

  • Logic: Provides liquidity through strategic buy-low/sell-high operations
  • Methods: Range-based trading with configurable price thresholds
  • RPC Usage: WebSocket price monitoring + transaction execution
  • Features: Dynamic position tracking, profit optimization, risk management

๐Ÿ”ฅ JeetBot

Genesis contract monitoring and automated token acquisition

  • Logic: Monitors genesis contracts for new token deployments and auto-trades
  • Methods: WebSocket event detection โ†’ parallel approvals โ†’ immediate swapping
  • RPC Usage: Real-time WebSocket monitoring + RPC fallback
  • Features: Token blacklist protection, REBUY mode, multi-wallet parallel processing

๐Ÿ—๏ธ Technical Architecture

RPC Infrastructure

Primary Providers:
โ”œโ”€โ”€ Alchemy (Primary RPC + WebSocket)
โ”œโ”€โ”€ QuickNode/BlastAPI (Backup RPC)  
โ”œโ”€โ”€ Infura (WebSocket + RPC)
โ””โ”€โ”€ Dynamic RPCs (User configurable)

Failover Strategy:
Sequential provider rotation with health monitoring

WebSocket Integration

  • Real-time Balance Monitoring: Transfer event listeners
  • Transaction Confirmation: Block event monitoring
  • Price Tracking: Swap event detection
  • Approval Monitoring: ERC20 approval events
  • Provider Redundancy: Infura primary โ†’ Alchemy fallback

Trading Logic

Core Trading Flow:
1. Token Resolution (Database โ†’ API โ†’ RPC)
2. Balance Verification (WebSocket + RPC)
3. Approval Management (Unlimited approvals)
4. Transaction Execution (TRUSTSWAP primary + Pool fallback)
5. Confirmation Monitoring (WebSocket events)

โš™๏ธ Setup & Installation

Prerequisites

  • Node.js 16+
  • Windows/macOS/Linux
  • Base network RPC access

Installation

# Clone the repository
git clone <repository-url>
cd trust-bot

# Install dependencies
npm install

# Configure wallets (see Configuration section)
# Edit wallets.json with your settings

# Start the GUI application
npm start

RPC Configuration

Edit wallets.json to configure RPCS:

{
  "config": {
    "rpcUrl": "YOUR_ALCHEMY_RPC",
    "wsUrl": "YOUR_ALCHEMY_WEBSOCKET", 
    "rpcUrlQuickNode": "YOUR_QUICKNODE_RPC",
    "rpcUrlInfura": "YOUR_INFURA_RPC",
    "wsUrlInfura": "YOUR_INFURA_WEBSOCKET",
    "virtualTokenAddress": "0x0b3e328455c4059EEb9e3f84b5543F74E24e7E1b",
    "chainId": 8453
  }
}

๐ŸŽฎ Usage

GUI Interface

  1. Launch Application: npm start
  2. Select Trading Bot: Choose from sidebar (Buy/Sell/Farm/MM/Jeet)
  3. Configure Parameters: Set amounts, tokens, wallets via GUI
  4. Monitor Execution: Real-time console with detailed logging
  5. View Results: Transaction summaries and balance changes

Trading Workflows

BuyBot Example:

1. Select tokens โ†’ Set amounts โ†’ Choose wallets
2. Configure execution (parallel/sequential)
3. Set gas price and loops
4. Execute โ†’ Monitor real-time progress

SellBot Example:

1. Auto-detect tokens or manual selection
2. Set sell percentages or fixed amounts  
3. Choose currency (VIRTUAL/ETH/Custom)
4. Execute โ†’ Track VIRTUAL received

๐Ÿ”ง Development

Project Structure

trust-bot/
โ”œโ”€โ”€ main.js              # Electron main process
โ”œโ”€โ”€ renderer.js           # GUI frontend logic
โ”œโ”€โ”€ wallets.json          # Configuration file
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ bots/            # Trading bot implementations
โ”‚   โ”œโ”€โ”€ config/          # Configuration management
โ”‚   โ”œโ”€โ”€ providers/       # RPC provider management
โ”‚   โ”œโ”€โ”€ utils/           # Shared utilities
โ”‚   โ””โ”€โ”€ wallets/         # Wallet management
โ””โ”€โ”€ bots/                # Legacy bot files (compatibility)

Key Technologies

  • Frontend: HTML/CSS/JavaScript (Electron renderer)
  • Backend: Node.js with ethers.js v6
  • Blockchain: Base L2 (2-second blocks, no mempool)
  • Trading: TRUSTSWAP contract integration
  • Monitoring: WebSocket + RPC hybrid approach

Adding New Features

  1. Create service in src/bots/services/
  2. Implement bot logic in src/bots/
  3. Add GUI components in renderer.js
  4. Update configuration schema if needed

๐Ÿ›ก๏ธ Security Features

  • Private Key Management: Secure local storage in wallets.json
  • Token Blacklist: Hardcoded protection against selling critical tokens
  • Transaction Validation: Multiple confirmation layers
  • Provider Failover: Automatic switching on RPC failures
  • Amount Validation: Prevents dust transactions and over-spending

๐Ÿ“Š Performance Optimizations

  • WebSocket Events: Replace polling for 90% faster response times
  • Parallel Processing: Multi-wallet transactions in same block
  • Smart Caching: Balance caching with event-driven invalidation
  • Provider Load Balancing: Random selection across healthy providers
  • Gas Optimization: Dynamic gas pricing with escalation

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

Development Guidelines

  • Follow existing code structure in src/ directory
  • Maintain backward compatibility with GUI interface
  • Add comprehensive error handling
  • Update documentation for new features
  • Test with multiple RPC providers

โš ๏ธ Disclaimer

This software is for educational and research purposes. Users are responsible for compliance with applicable laws and regulations. Trading cryptocurrencies involves significant risk of loss.


About

Onchain trading bot, open source.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors