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
Future Roadmap: Help Us Shape It
What's Live Today
Open-source CLI and hosted API with 13 protocol playbooks across 6 chains (Ethereum, Arbitrum, Base, Optimism, Polygon, Sepolia). Deterministic transaction building, conversational agent, API key auth with rate limiting.
Where This Could Go
These are directions we're exploring. Community input will shape what comes next:
- Expanded multi-chain coverage beyond the current 6 supported networks
- Community-contributed playbooks with a verification pipeline
- Smarter agent layer with protocol search and live on-chain data
- SDK for frontend integrations
Build With Us
defi-skills is open source. Add a new protocol by writing a JSON playbook. Propose new directions via GitHub issues. The roadmap is yours to shape.