Your new experience awaits. Try the new design now and help us make it even better

ORIGINAL RESEARCH article

Front. Blockchain

Sec. Smart Contracts

Hyper-Heuristic Driven Smart Contracts for DeFi: A Framework for Dynamic Rule Optimization and Adaptive Executions

Provisionally accepted
Kassem  DanachKassem Danach1Hassan  RkeinHassan Rkein1Ahmad  FarroukhAhmad Farroukh1Ziad  BalaaZiad Balaa2Samir  HaddadSamir Haddad3*
  • 1Al Maaref University, Beirut, Lebanon
  • 2Universite Libanaise, Beirut, Lebanon
  • 3University of Balamand Faculty of Arts and Sciences, Koura, Lebanon

The final, formatted version of the article will be published soon.

The static and hard-coded logic of smart contracts in Decentralized Finance (DeFi) platforms significantly limits their adaptability in dynamic and volatile market environments. To address this challenge, we propose a novel hyper-heuristic driven framework that enables real-time rule optimization within smart contracts, thereby enhancing responsiveness, gas efficiency, and operational robustness. The framework features a two-layer architecture: a reinforcement learning-based high-level controller selects appropriate low-level rule heuristics from a domain-specific library based on evolving transaction contexts and on-chain data. Implemented and evaluated on Uniswap v2 and Aave v3 protocols, the system dynamically optimizes parameters such as slippage tolerance, gas usage thresholds, and loan-to-value ratios. Experimental results on real-world datasets show significant performance improvements, including a 45.6% increase in transaction success rate, 28.3% reduction in average gas consumption, and 38.4% drop in liquidation events under market stress scenarios. This research demonstrates the feasibility and advantages of embedding intelligent, adaptive decision-making mechanisms within DeFi smart contracts, opening new pathways toward autonomous, resilient, and regulation-aligned blockchain systems.

Keywords: Decentralized Finance (DeFi), Smart contracts, Hyper-heuristics, Dynamic Rule Optimization, reinforcement learning, Solidity, GasEfficiency, Blockchain Adaptability

Received: 22 Oct 2025; Accepted: 25 Nov 2025.

Copyright: © 2025 Danach, Rkein, Farroukh, Balaa and Haddad. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

* Correspondence: Samir Haddad

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.