Researchers have developed a benchmarking framework to assess whether artificial intelligence (AI) can generate decentralised finance (DeFi) smart contracts that are efficient and cost-effective, lowering computational costs, known jargonistically as “gas”. The work might address a key problem seen in blockchain-based financial systems.
Decentralised finance (DeFi) is a blockchain-based financial system that provides services such as lending, trading, and asset management without the need for conventional intermediaries such as banks. It uses smart contracts, which are self-executing programs that automatically enforce agreed rules, to allow financial applications to operate on decentralised networks. There is a computational cost associated with transactions, the gas. Reducing gas consumption is the key to lowering costs for users.
The study in the International Journal of Agile Systems and Management looked at Code Llama and Code Llama–Python. These two large language models (LLMs) can generate computer code across three DeFi applications: digital tokens, tokenised vaults, and flash loans.
Rather than comparing AI directly with human developers, the researchers examined gas-saving patterns in AI-generated contracts and created a benchmark that can be applied to both human- and machine-produced code. The results showed that improving gas efficiency is not a simple process, with different contract types requiring different optimisation approaches.
The researchers suggest that AI-assisted contract development could reduce development time, improve accessibility for non-specialists, and help smaller projects build decentralised applications. However, further work is needed to reduce “gas” costs.
Pratama, A.N.W. and Wicaksana, A. (2026) ‘Benchmarking gas-saving patterns in AI-generated DeFi smart contract’, Int. J. Agile Systems and Management, Vol. 19, No. 5, pp.1–26.
News media may use this press release as source material, in whole or in part, provided the content is not materially misrepresented. A link back to the original article is appreciated.