Architecture
Two entry points. One deterministic engine. Every intent flows through the same pipeline regardless of whether it arrives via CLI, API, or chat.
Pipeline
Iterates payload_args from the playbook in order. Dispatches each to a resolver by its source field. Resolvers convert human-readable values to on-chain values.
- token_address (symbol to checksum address)
- amount (human to Wei with decimals)
- ens_or_hex (ENS name to address)
- fee_tier (auto-detect from pair)
- deadline (timestamp + buffer)
- amount_or_balance ("max" to balanceOf)
- Uniswap quotes + tick ranges
- Balancer pool IDs + swap limits
- Curve min amounts + pool math
- EigenLayer strategies + deposits
- Lido withdrawal requests + hints
- Aave reward asset discovery
Loads ABI by function selector. Maps resolved values to ABI parameters via param_mapping. Coerces types (address, uint256, bytes). Encodes calldata via eth_abi.encode.
[approval txs] then [action tx]. Unsigned. EIP-55 checksummed. Never signs.
Data layer
All local. No runtime fetches to populate. The engine reads these at init and uses them during resolution.
fetch_abis.External services
Called only during resolution, not at init. All optional depending on the action.
Agent layer (optional)
The chat command and API sessions add an LLM agent on top. The agent uses tool calling to discover actions, check parameters, and invoke the deterministic engine. It never touches the engine internals.
list_actions-- discover protocolsaction_info-- check parametersbuild_transaction-- invoke engine
- User sends intent in natural language
- Agent identifies action, calls action_info
- Agent calls build_transaction with correct args
- Returns unsigned tx to user
Roadmap
Phase 1: CLI + Bundled API
Open-source CLI with deterministic build and chat commands. Hosted API bundles both the agent and engine. API key auth with rate limiting (free: 50/day).
Phase 2: Agent Layer (Planning + Search)
Structured protocol registry with live data from DeFiLlama. Search tools replace LLM knowledge for protocol discovery. Agent becomes a search interface over curated data, not an advisor. Benchmarkable at every step.
Phase 3: Multi-Chain + Community Playbooks
L2 support (Arbitrum, Optimism, Base). Community-contributed playbooks with verification pipeline. TypeScript SDK. Portfolio awareness and position management.