Skip to main content

Multi-chain blockchain transaction execution framework

Project description

ON1Builder

Multi-Chain MEV Transaction Execution Framework

⚠️ Warning: This project is in alpha development phase and undergoing rapid iteration. Expect breaking changes and incomplete features.

license python docs

Asynchronous, production-ready engine for scanning mempools, analyzing on-chain & market data, and dispatching profitable MEV trades across any EVM chain – with first-class safety-nets, RL-powered strategy selection, pluggable ABIs and a fully async SQL persistence layer.

Key Features

Category Highlights
Multi-Chain MultiChainCore spawns a worker per chain with shared safety & metrics.
MEV Strategies Front-run, back-run, sandwich (+ flash-loan variants) – auto-selected by StrategyNet (ε-greedy with reward shaping).
Robust Safety SafetyNet enforces balance, gas, value, slippage, duplicate-tx & dynamic congestion checks – activates circuit-breaker + alerting.
Mempool & Markets TxpoolMonitor filters pending txs; MarketMonitor streams price / volume / volatility; both feed the RL agent.
Nonce-safe NonceCore guarantees sequential, thread-safe nonces even under high concurrency.
Dynamic ABIs Hot-loads JSON ABIs, validates required functions, maps 4-byte selectors.
Persistence DatabaseManager (SQLAlchemy async) records every tx & profit for dashboards (Grafana/Prometheus configs shipped).
Pluggable Ultra-light DI Container for circular deps, plus clean module boundaries.

Project Layout


src/on1builder/               ← main Python package
├── cli/                      ← Typer & argparse entrypoints
├── config/                   ← Configuration helpers (YAML + .env)
├── core/                     ← Main/MultiChain/Nonce/Transaction cores
├── engines/                  ← SafetyNet, ChainWorker, StrategyNet …
├── integrations/             ← ABI registry + external adapters
├── monitoring/               ← Txpool & market monitors
├── persistence/              ← DatabaseManager (async SQLAlchemy)
└── utils/                    ← Logger, notifications, DI container, …
resources/                    ← ABIs, Solidity contracts, tokens, ML data
configs/                      ← Example YAMLs, Grafana & Prometheus bundles
docs/                         ← Sphinx docs (rendered at gh-pages)
setup_dev.sh                  ← one-liner dev bootstrap
setup.py                      ← setup 
README.md                     ← you-are-here
pyproject.toml                ← Poetry build / deps
requirements.txt              ← slim runtime-only requirements


Quick Start

# 1. clone & enter
git clone https://github.com/john0n1/ON1Builder.git && cd ON1Builder

# 2. bootstrap (installs Poetry + venv + deps + .env)
./scripts/setup_dev.sh

# 3. dry-run on a single chain
on1builder run -c configs/chains/config.yaml --dry-run

# 4. go multi-chain (reads chains:[] list in YAML)
on1builder run --multi-chain

# 5. mempool / market monitor only
on1builder monitor --chain ethereum

Configuration lives in YAML (configs/chains/*.yaml) + .env. Generate a template with:

on1builder config init > my_chain.yaml

Validate before boot:

on1builder config validate my_chain.yaml

CLI Usage

Command Purpose
on1builder run … start the full bot (default single chain)
on1builder run --multi-chain read multiple chains and launch workers
on1builder monitor … run only Market + Txpool monitors
on1builder config validate file.yaml static YAML sanity-check

See on1builder --help for all flags.


Developer Guide

1 · Environment

  • Python ≥ 3.12 (async-friendly).

  • Install extras for lint/test:

    poetry install --with dev
    

2 · Pre-Commit

pre-commit install   # black, isort, flake8, mypy on every commit

3 · Tests

pytest -q  # async-aware tests live in tests/

4 · Docs Live-Reload

cd docs
make livehtml  # → http://127.0.0.1:8000

5 · Docker Compose (Node + Prometheus + Grafana)

docker compose up -d

Connect Grafana → http://localhost:3000 (dashboard config shipped at configs/grafana/).

6 · VS Code

.vscode/settings.json already points to Poetry venv, sets python.analysis.typeCheckingMode to strict.


Security & Support

  • Production keys: always load via .env; never commit secrets.
  • Bug / security issue? Email security@on1.no (GPG key in SECURITY.md).
  • Join the Discord: https://discord.gg/on1builder – channels #dev and #mev-strategies.

License

MIT © 2025 John0n1/ON1Builder – contributions welcome! See LICENSE for full text.

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

on1builder-2.1.0.tar.gz (430.7 kB view details)

Uploaded Source

Built Distribution

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

on1builder-2.1.0-py3-none-any.whl (66.4 kB view details)

Uploaded Python 3

File details

Details for the file on1builder-2.1.0.tar.gz.

File metadata

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

File hashes

Hashes for on1builder-2.1.0.tar.gz
Algorithm Hash digest
SHA256 acf8317368675153d72ff7811695432f51a3a3e37b0c4e51fc4799646e125b6f
MD5 e97722bf5e5665df4b175d3c02880dcc
BLAKE2b-256 869bfa0b91beee12e0b482c987e55f7c04921d2eeeda5047cb70441f1870ab39

See more details on using hashes here.

File details

Details for the file on1builder-2.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for on1builder-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b19b8c5017e6bac0a8c59403ebb4573ec8a19fc42ab3e91f094b773d26d20a89
MD5 839a1f937c40216db49cc02f508d2edf
BLAKE2b-256 bceccbbecd6d9316ae145909b5ff38589b20af4159900d91370d491ddbf7929e

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