DeFiFlowBench: Benchmarking and Improving Safe Executability in Natural-Language DeFi Workflow Synthesis
Abhinav Rajeev Kumar, Harshit Arora, Varun Singh, Manikandan Nanjappan
Abstract
A structurally valid DeFi workflow can still authorize a costly trade. We introduce DeFiFlowBench, a benchmark of 207 team-authored prompts for natural-language DeFi workflow synthesis. It measures graph coverage, configuration completeness, and declared safety predicates, then tests supported trade configurations on a local EVM. Direct, constrained, and few-shot prompting produce 14-19 unsafe held-out executions per configuration under a fixed 5% price-impact cap. A slippage bound derived from a quote does not prevent the price impact of the order itself. We propose Koan-Safe, which combines a prompt-only intent parser, a replaceable generator, and structural repair with default safety parameters. On 75 held-out workflow prompts, its hybrid variant scores 0.67 on the static safety proxy, compared with 0.33 for the best baseline. Koan-Safe records no unsafe executions on the saved benchmark outputs. A matched-candidate ablation produces 14-17 unsafe executions when enforcement is disabled. Additional tests expose the limits of default injection: permissive existing thresholds can still authorize unsafe trades. A separately evaluated policy cap addresses this failure on a 36-case diagnostic grid. These results support explicit trade protections and execution-based evaluation, while distinguishing declared safety from a general guarantee.
Create a lesson
Metadata
- Categories
- cs.LG, cs.SE
- Comments
- Code and benchmark: https://github.com/Varun-2538/Koan
Related papers
Does Reasoning Improve Psychological Depth in Large Language Models? It Depends on Who's Judging
Shared title terminologycs.LGRuichen Zheng, Yihe Wang, Fabrice Y Harel-Canada et al.
Sampling via Decision-Flow: Training-Free Extraction of Improved Latent Reasoning Paths in Large Language Models
Shared title terminologycs.LGZhendong Mi, Shaoyi Huang
LinearSpec: Drafting from the Target's Memory for Long-Context Speculative Decoding in Hybrid Vision-Language Models
Shared title terminologycs.LGHaiyu Wang, Sai Qian Zhang, Steven Li
Predicting End-to-End Fine-Tuning Time for Generative Language Models
Shared title terminologycs.LGBreno Beleza, Felipe Lima, Isis Carvalho et al.
Benchmarking Graph Self-Supervised Learning for Node-Level Tasks: Insights and a Strong Baseline
Shared title terminologycs.LGDmitry Eremeev, Gleb Bazhenov, Oleg Platonov et al.
Looking Back to Forget: Self-Anchored Unlearning Along the Generation Trajectory of Diffusion Language Models
Shared title terminologycs.LGRuihao Pan, Suhang Wang