Recurring DCA
A user pre-commits spend, frequency, recipient, slippage, relayer fee cap, and private submission for recurring ERC-20 buys.
Status: ready preview
OpenZaps are policy capsules for agent-triggered DeFi. The current interface exposes a deterministic simulation API and review artifacts; onchain creation remains gated until the external audit and adapter governance process clears.
The contracts are deployed as a reference implementation on Base, but production use with real funds requires external audit, formal checks, adapter governance, testnet soak, and live wallet review.
Use the policy console for a visual flow, or call the local simulation API from an agent, backend, or Farcaster Mini App. Simulation never broadcasts a transaction and never asks for wallet authority.
curl -X POST https://openzaps.vercel.app/api/policies/simulate \
-H "content-type: application/json" \
-d '{
"templateId": "recurring-dca",
"authorityModel": "deposit",
"tokenIn": "USDC",
"tokenOut": "WETH",
"amount": "250",
"maxSpend": "1000",
"frequency": "weekly",
"slippageBps": 50,
"privateSubmission": true,
"humanApproval": false
}'The signed object is deliberately boring. Every field that could expand execution authority is present in the user-visible policy before a relayer can act.
deposit, intent, Safe/ERC-1271, or future session-key mode.
The only address allowed to receive tracked output assets.
Spend and cadence ceilings. No unlimited looping.
A governed, allowlisted adapter. No arbitrary target plus calldata.
Hermes, owner self-submit, or explicitly named relayers.
Balance deltas, allowance reset, recipient, and tracked-asset assertions.
The API returns the normalized policy, policy hash, check status, deterministic quote estimate, relayer fee cap, gas envelope, and broadcast flag. The route is suitable for CI, docs, and agent preflight checks.
type SimulationResponse = {
policy: PolicyDraft
simulation: {
status: "pass" | "warn" | "block"
policyHash: string
estimatedOut: string
relayerFee: string
gasEstimate: string
checks: Array<{
label: string
detail: string
status: "pass" | "warn" | "block"
}>
}
broadcast: false
}A user pre-commits spend, frequency, recipient, slippage, relayer fee cap, and private submission for recurring ERC-20 buys.
Status: ready preview
A bounded deposit policy for CliqueClaw or pool.fans launch pools, with a fixed recipient vault and no arbitrary calldata.
Status: requires review
A repeatable fee-claim policy for audited reward sources, exact approvals, and balance-delta postconditions.
Status: requires review
A protective policy for liquidity or oracle-risk exits. This is deliberately blocked in v1 until protective-zap review is complete.
Status: deferred
Select a template, authority model, spend ceiling, cadence, adapter, recipient, submitter, and postconditions.
Run deterministic checks before any wallet prompt. Blocked policies cannot proceed; warned policies require review.
Bind chain, owner, recipient, nonce, deadline, policy hash, min-out, relayer fee cap, and postconditions.
Hermes re-simulates on the latest block and submits through the selected private path when price sensitive.
Receipts, allowance checks, balance deltas, alerts, and owner revoke paths stay attached to the capsule.
The eventual SDK should stay small: normalize policy input, simulate, prepare EIP-712 typed data, submit through an approved channel, and monitor receipts. Current local functions are already split so they can graduate into a package.
import { buildPolicyDraft, simulatePolicy } from "@openzaps/sdk"
const policy = buildPolicyDraft({
templateId: "recurring-dca",
tokenIn: "USDC",
tokenOut: "WETH",
amount: "250",
maxSpend: "1000",
})
const review = simulatePolicy(policy)
if (review.status === "block") throw new Error("policy blocked")Until the package is published, see the source repo and the live console for the reference behavior. 0xZAPS is not required to simulate or inspect policies.