Koan: Safety-Validated Intent Compilation for DeFi Workflow Orchestration
Abstract
Abstract We introduce Koan, a system for compiling natural language DeFi requests into executable safety-validated directed acyclic graphs (DAGs). Assembling correct multi-step DeFi workflows requires sequencing irrevocable on-chain transactions across heterogeneous protocols, demanding flexible intent understanding and strict execution discipline simultaneously - a combination no existing tool provides. Koan addresses this in two phases. Phase 1 translates user intent into a typed graph via an LLM with deterministic fallback heuristics. Phase 2 validates that graph, injects missing safety nodes, and executes with dependency-aware scheduling. We evaluated on 1,000 prompts across 9 DeFi categories. Intent-to-workflow correctness reached 82.4%; DAG validity 93.6%. The Safety Injector raised price-impact check coverage from 41.2% to 98.4%, and 7.3% of all workflows were aborted by injected checks identifying excessive risk. Workflow authoring averaged 2.4 min versus 46.8 min for manual scripting (a 20x speedup), and compiled flows achieved 97% execution success with 18% gas savings on matched DEX routes under testnet conditions. Keywords Blockchain systems, decentralized finance, intent compilation, large language models, workflow orchestration.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.