Skip to content
pCwOrMPublic

About

On-Chain AI Decision Oracle & Dynamic Fee Governor (EVM 32-Byte Slot Engine)

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

153 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WERRACLE

Zero-Storage On-Chain AI Decision Oracle & DeFi Risk Radar

License: BSL 1.1 Solidity: ^0.8.24 EVM Devnet: Chain ID 4242 Zenodo DOI arXiv Preprint Live Radar

A zero-storage, fixed-point procedural decision oracle that executes deterministic AI reflexes directly inside the Ethereum Virtual Machine (EVM)—enabling dynamic Uniswap v4 fee hooks, sub-block MEV defense, and real-time lending vault risk telemetry without off-chain trust assumptions.

Quickstart • Architecture • Smart Contracts • Empirical Results • Live Risk Radar • Ecosystem • Research Chronology • Türkçe Dokümantasyon


🏛️ The Paradigm

Decentralized finance (DeFi) protocols face a fundamental trilemma between oracle latency, gas overhead, and trust minimization:

  1. Traditional Push/Pull Oracles: Depend on off-chain multi-signatures, third-party node networks, or delayed price updates—exposing Automated Market Makers (AMMs) to Loss-Versus-Rebalancing (LVR) and toxic MEV arbitrage.
  2. Deep Neural Inference: Generative LLMs and multi-layer neural networks cannot be computed on-chain; evaluating gigabytes of float weights in EVM bytecode exceeds block gas limits by several orders of magnitude.

Werracle breaks this barrier by porting the WERR procedural fractal reflex engine into native EVM bytecode:

  • Zero-Storage Footprint: Requires 0 bytes of state storage for neural weights. Decision boundaries are geometric invariants computed on the fly.
  • Deterministic Q16.16 Fixed-Point Math: Employs fixed-point polynomial boundary escape dynamics ($z_{n+1} = z_n^2 + c$) implemented in optimized Solidity assembly.
  • Sub-Block Execution Latency: Computes full reflex verification in $< 42,000$ gas on Ethereum L1 and sub-cent transaction costs on Base / Arbitrum L2s.
       Incoming Trade / Liquidation Transaction
                          │
                          ▼
       ┌──────────────────────────────────────┐
       │     Uniswap v4 Pool / Morpho Vault   │
       └──────────────────┬───────────────────┘
                          │ Call beforeSwap() / liquidate()
                          ▼
       ┌──────────────────────────────────────┐
       │       WerracleCore (On-Chain)        │
       │   Q16.16 Fixed-Point Fractal Engine  │  ◄── Zero Storage Weights
       │          Gas: ~38,500 units          │
       └──────────────────┬───────────────────┘
                          │
             ┌────────────┴────────────┐
             ▼                         ▼
   [Dynamic Swap Fee]        [Reflex Protection]
  Recaptures LVR/MEV        Halts bad-debt cascades

⚡ Quickstart & Deployment

Contract Installation (Foundry)

forge install pCwOrM/werracle

Or install via npm/yarn:

npm install @werracle/contracts

Basic Contract Integration

// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import {IWerracleOracle} from "@werracle/contracts/interfaces/IWerracleOracle.sol";

contract SafeVault {
    IWerracleOracle public immutable oracle;

    constructor(address _oracle) {
        oracle = IWerracleOracle(_oracle);
    }

    function executeProtectedAction(bytes32 poolId, uint256 volatility) external {
        // Query the zero-storage reflex oracle
        // Returns: 0 = Allow / Normal, 1 = Caution / Elevated Fee, 2 = Emergency Gate
        uint8 decision = oracle.evaluateRisk(poolId, volatility);
        
        require(decision != 2, "Werracle: Emergency volatility reflex triggered");
        
        // Execute state transition...
    }
}

📐 Smart Contract Suite

The repository contains audited Solidity implementations for EVM execution:

Contract Purpose Gas Profile Target Networks
WerracleCore.sol Canonical on-chain reflex oracle with Q16.16 escape math ~38,500 gas Ethereum L1, Base, Arbitrum
WerracleUniswapV4Hook.sol beforeSwap dynamic fee hook mitigating toxic LVR ~41,200 gas Base L2, Uniswap v4 Deployments
WerracleMorphoSVR.sol MetaMorpho vault health monitoring & SVR recapture ~32,000 gas Ethereum L1 / Base L2
FixedPointFractal.sol Math library computing iterative complex orbital escape Pure library EVM Bytecode compatible

📊 Empirical Benchmarks & SVR Telemetry

Werracle's Smart Value Recapture (SVR) and dynamic fee hooks have undergone extensive stress simulations and live testnet benchmarks:

  • Smart Value Recapture (SVR): Achieved 94.38% value recapture on volatile arbitrage events compared to static 30 bps Uniswap pools.
  • FastLane Atlas Solver Benchmarks: Demonstrated microsecond-level reflex arbitration across adversarial backrunning bundles.
  • MetaMorpho Lending Resilience: Successfully prevented bad-debt cascade triggers across synthetic liquidation shocks.

Detailed simulation scripts, Monte Carlo runs, and contract gas profiler logs are available in RESEARCH_CHRONOLOGY.md.


📡 Werracle Risk Radar

Werracle powers an enterprise-grade live risk intelligence dashboard accessible at:

🔗 https://radar.werracle.com

  • Live MetaMorpho Vault Telemetry: Real-time collateralization monitoring, supply/borrow APY volatility, and bad debt exposure metrics.
  • Base L2 Execution Feeds: Real-time streaming of on-chain reflex transactions, dynamic swap fee adjustments, and MEV protection events.
  • Institutional DaaS API: Low-latency REST & WebSocket feeds for quantitative market makers and decentralized protocols.

🌐 The WERR Ecosystem

Werracle represents the decentralized execution tier of the WERR foundational architecture:

                          ┌─────────────────────────────┐
                          │            WERR             │
                          │   Core Mathematical Engine  │
                          │  Zero-Memory System-1 Reflex │
                          └──────────────┬──────────────┘
                                         │
                 ┌───────────────────────┴───────────────────────┐
                 ▼                                               ▼
  ┌─────────────────────────────┐                 ┌─────────────────────────────┐
  │          Werracle           │                 │           answerr           │
  │   On-Chain Decision Oracle  │                 │  Dual-Cognition Workspace   │
  │  DeFi Risk Radar & DaaS     │                 │ Natural Language Gating API │
  │   https://radar.werracle.com│                 │     https://answerr.me      │
  └─────────────────────────────┘                 └─────────────────────────────┘
  • werr: The core zero-memory fractal reflex engine and Lean 4 formally verified mathematical proofs.
  • werracle: On-chain Solidity implementations, Uniswap v4 hooks, and decentralized risk radar.
  • answerr: Natural language dual-cognition workspace connecting System-2 deliberation to deterministic reflex execution.

📄 Academic Citation & Archival References

If you cite or replicate this research in scientific publications, please use the following metadata:

@article{dagli2026werracle,
  author       = {Dağlı, Volkan and Dağlı, Zerrin and Dağlı, Dağhan},
  title        = {{Werracle: Zero-Storage On-Chain AI Decision Oracle via Procedural Fractal Dynamics}},
  journal      = {arXiv preprint arXiv:2609.30719},
  year         = {2026},
  doi          = {10.48550/arXiv.2609.30719},
  publisher    = {Zenodo},
  version      = {v1.0.0},
  note         = {Zenodo DOI: 10.5281/zenodo.22942598}
}

⚖️ License & Intellectual Property

  • Open-Science, Educational & Evaluation Use: The Licensed Work is free to run, inspect, benchmark, test, fork, and replicate for all non-commercial academic research, personal evaluations, and public testnet deployments under the Business Source License 1.1 (BSL 1.1).
  • Commercial Operations & Production Licensing: Any commercial mainnet deployment, integration into fee-generating DeFi protocols, or proprietary SaaS/DaaS operation requires a written Commercial License from the Licensor:
    • Licensor: ITOUCH BİLİŞİM SİSTEMLERİ MÜHENDİSLİK DANIŞMANLIK SANAYİ VE TİCARET LİMİTED ŞİRKETİ (ITouch Systems · Cukurova University Science Park, Adana, Türkiye).
    • Scientific Co-Authors & Inventors: Volkan Dağlı (Anadolu University), Dr. Zerrin Dağlı (Mersin University — Academic Advisor, Co-Author & Co-Inventor), Dağhan Dağlı (Toros University — Co-Author & Co-Inventor).
    • Chain of Title & Assignment: The scientific co-authors have irrevocably assigned administrative and IP management authority to Volkan Dağlı, who has transferred exclusive global commercial licensing and operational rights to ITouch Systems.
    • Trademarks: WERR™, Werracle™, answerr™, and WerrSoma™ are trademarks owned exclusively by ITouch Systems.
    • Patent Applications: TÜRKPATENT TR 2026/016285 & TR 2026/016633.
    • Inquiries: contact@werracle.com · info@itouch.com.tr

Developed by ITouch Systems · Cukurova University Science Park, Adana, Turkey
Copyright © 2026 ITouch Bilişim Sistemleri Ltd. Şti. All rights reserved.

About

On-Chain AI Decision Oracle & Dynamic Fee Governor (EVM 32-Byte Slot Engine)

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages