Developer docs

Build with bounded execution, not broad wallet authority.

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.

Production statusPre-audit mainnet fund creation is intentionally disabled.

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.

Quickstart

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
  }'

Policy schema

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.

authorityModel

deposit, intent, Safe/ERC-1271, or future session-key mode.

recipient

The only address allowed to receive tracked output assets.

amount / maxSpend / frequency

Spend and cadence ceilings. No unlimited looping.

adapter

A governed, allowlisted adapter. No arbitrary target plus calldata.

allowedSubmitters

Hermes, owner self-submit, or explicitly named relayers.

postconditions

Balance deltas, allowance reset, recipient, and tracked-asset assertions.

Simulation API

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
}

Policy templates

Recurring DCA

A user pre-commits spend, frequency, recipient, slippage, relayer fee cap, and private submission for recurring ERC-20 buys.

Status: ready preview

Launch pool deposit

A bounded deposit policy for CliqueClaw or pool.fans launch pools, with a fixed recipient vault and no arbitrary calldata.

Status: requires review

Claim and compound

A repeatable fee-claim policy for audited reward sources, exact approvals, and balance-delta postconditions.

Status: requires review

Guarded exit

A protective policy for liquidity or oracle-risk exits. This is deliberately blocked in v1 until protective-zap review is complete.

Status: deferred

Execution lifecycle

1

Draft policy

Select a template, authority model, spend ceiling, cadence, adapter, recipient, submitter, and postconditions.

2

Simulate

Run deterministic checks before any wallet prompt. Blocked policies cannot proceed; warned policies require review.

3

Review signature

Bind chain, owner, recipient, nonce, deadline, policy hash, min-out, relayer fee cap, and postconditions.

4

Submit privately

Hermes re-simulates on the latest block and submits through the selected private path when price sensitive.

5

Monitor and revoke

Receipts, allowance checks, balance deltas, alerts, and owner revoke paths stay attached to the capsule.

SDK surface

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.