Skip to main content

Quant-Grade Dynamic Ethereum Grid Trading and Intelligent Portfolio Rebalancing Engine with Live Dashboard Monitoring and Resilient Execution

Project description

Quant-GridBot

Build Status


Quant-Grade Dynamic Ethereum Grid Trading and Intelligent Portfolio Management Engine


img


Features

  • Direct Ethereum RPC Trading (Native transaction building — No web3.py dependency)
  • Dynamic Adaptive Grid Trading Strategy (Real-time volatility clustering and repositioning)
  • Dual-Cluster Volatility Detection (Automatic spread adjustments based on live market conditions)
  • Live Token Volatility Scoring (Automatic best token selection across ERC20 assets)
  • Real Ethereum Transaction Signing (ECDSA + RLP encoding for lightweight direct signing)
  • Safe Retry-Protected Data Fetching (gas, price, nonce, balance, with backoff handling)
  • Thread-Safe Persistent SQLite Trade Logging (live storage of execution history)
  • Interactive Rich Dashboard (live thread health monitoring and wallet status)
  • Heartbeat Thread Detection and Auto-Restart (grid and rebalance bots self-heal)
  • Secondary RPC Endpoint Fallback Support
  • Fully Modular Extensible Architecture (Core, Grid, Rebalance, Wallet, Executor, Scorer, Database, Utilities)
  • CLI Launchable (quantgridbot)
  • Supports Simulation Mode (simulate=true) and Full Real Trading
  • Graceful Safe Shutdown (SIGINT/SIGTERM trapping without data corruption)
  • Production-Grade, Open Source (BSD 3-Clause License)

Installation

Clone and install locally:

git clone https://github.com/LoQiseaking69/qgbot.git
cd qgbot
pip install .

Or build a wheel package:

python -m build
pip install dist/qgbot-*.whl

Configuration

Before running, create a config.json file in the project root.

Required fields:

  • rpc_url : Main Ethereum RPC endpoint (Infura, Alchemy, or custom)
  • secondary_rpc_url : Optional secondary RPC endpoint (fallback)
  • wallet_address : Public Ethereum address
  • private_key : Private key for transaction signing (keep safe)
  • simulate : true for dry-run mode, false for live execution
  • trade_volume : ETH amount to allocate per trade
  • grid_lower_pct, grid_upper_pct : Grid spread percentages
  • grid_size : Number of grid levels
  • target_tokens : ERC20 tokens to consider for trading
  • stablecoin_address : Stablecoin for rebalancing operations
  • min_tokens_out : Minimum token output safeguard
  • trade_cooldown : Minimum seconds between trade executions
  • refresh_interval : Price refresh interval for the GridBot
  • rebalance_threshold : % deviation from ETH balance target to trigger rebalance
  • slippage_pct : Max allowed slippage when swapping

A ready-to-modify template is provided: config.example.json


Usage

After configuring:

quantgridbot

The system will:

  • Monitor Ethereum price feeds
  • Dynamically adapt grid levels
  • Detect high-volatility token opportunities
  • Execute secured transactions via Uniswap Router
  • Rebalance ETH/token holdings automatically
  • Persist all trade activity into a local SQLite database
  • Provide a live Rich-based dashboard with thread health and wallet status

Project Structure

Path Description
src/qgbot/core.py Master system orchestrator (wallet, bots, dashboard)
src/qgbot/grid.py Adaptive dynamic grid trading bot
src/qgbot/rebalance.py Live ETH/token ratio portfolio balancing bot
src/qgbot/executor.py Ethereum transaction builder and RPC sender
src/qgbot/wallet.py Wallet and live token portfolio fetcher
src/qgbot/scorer.py Token volatility scorer and selector
src/qgbot/db.py Persistent, thread-safe SQLite database for trade records
src/qgbot/utils.py Ethereum RPC utilities, RLP encoders, signing helpers

License


BSD 3-Clause License.
See LICENSE for details.


Quant-GridBot — Engineered for real-world, high-efficiency Ethereum trading automation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qgbot-2.2.1.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qgbot-2.2.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file qgbot-2.2.1.tar.gz.

File metadata

  • Download URL: qgbot-2.2.1.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for qgbot-2.2.1.tar.gz
Algorithm Hash digest
SHA256 0ee39badf14b94220bcdc6dc6a14a061495789ee6e8e8fde141be04776af3c9c
MD5 8f3e8c23b8ce5d51eadebbafa9443baa
BLAKE2b-256 4a0cc2a28b4f266e6bfbda376a22cd441a8051a948f861dac19a7a99064c400b

See more details on using hashes here.

File details

Details for the file qgbot-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: qgbot-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for qgbot-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab326ebd52b076555fc45d6518f8d773f651401e36eb4424bbbab317fe70ce54
MD5 a67d6f37ac48934281fafd697a882bef
BLAKE2b-256 fb5df9f7c0208d1c041b14c43f2ea9d41d7dc41beb9de47587d85a289ed0b26b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page