Recipe System
Deterministic TX templates stored in tx.db. The self-healing loop learns new recipes from on-chain transactions when calldata fails — infinite retry with 30-error stuck detection.
The Pipeline Overview introduced three routing paths: Express, Recipe, and Discovery. This page dives into how recipes work, how they accumulate, and how the self-healing loop creates new ones from chain data.
What is a recipe
A recipe is a deterministic template for building transaction calldata. It maps a user intent (protocol + action + parameters) to a specific contract call with argument patterns.
{
"protocol": "euler",
"action": "deposit",
"chain": "ethereum",
"contract": "0x...",
"selector": "deposit(uint256,address)",
"args_pattern": [
{"name": "amount", "source": "intent.amount", "transform": "to_wei(6)"},
{"name": "receiver", "source": "intent.wallet_address"}
]
}
Recipes live in tx.db. Once a recipe exists for a protocol + action combination,
all future transactions use the deterministic path — no LLM, no API calls, pure SQL lookup
and parameter binding.
Self-healing loop
When a transaction fails, the pipeline doesn't give up. It enters an infinite retry loop that learns from each failure:
Discovery path in detail
When no recipe exists and templates can't handle the action:
raw.db.args_pattern mapping intent fields to contract args.tx.db for all future use.Recipes accumulate with use. More interactions = more deterministic paths, fewer LLM calls.
Once a recipe produces calldata, it goes through simulation — a full dry run on an Anvil fork before any real funds are at risk.