# defiexec-build

> defiexec-build is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-11).

Generates ready-to-sign transaction calldata for depositing into or redeeming from Base DeFi yield protocols (Aave v3, Compound v3, ERC-4626) without custody of user funds

## Facts

- Endpoint: GET https://payai.agentstools.dev/yield/build?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defiexec-build-9e7d928b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4O4741AC_hkkYcUDv1Kaf

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability defiexec-build-9e7d928b
```

Example prompt: Build me the deposit calldata to supply 1000000000 raw USDC into Aave v3 on Base — the recipient wallet is 0xAbC123... — I need the approval calldata and expected shares too so I can sign and broadcast it myself.

## When to prefer this

Use this endpoint when you need actual ready-to-sign transaction calldata to execute a yield deposit or redeem on Base, not just a preview of rates. Choose this over defiexec-preview when you are ready to broadcast a transaction. Prefer this over manual ABI encoding when you need correct calldata including approval steps without implementing protocol-specific logic. Ideal for non-custodial agent workflows where the agent prepares the transaction but the user signs with their own wallet.

## Known failure modes

- Invalid or unsupported asset symbol returns an error indicating asset not found
- Vault address not resolvable on-chain returns a resolution failure
- Amount of 'max' used with deposit action (only valid for redeem) returns validation error
- Unsupported protocol enum value returns a 400-style validation error
- On-chain RPC failure or network congestion may cause timeout or stale state error
- Compound v3 asset that is not the base asset returns unsupported asset error
- Malformed recipient address returns address validation error

## How this service works

Non-custodial yield deposit/redeem calldata for Base: give protocol (aave-v3, compound-v3 or erc4626), asset or vault, raw amount, action and recipient; we read the protocol on-chain state and return ready-to-sign transaction calldata plus the ERC-20 approval (deposit only) and the expected shares or assets. You sign with your own wallet — we never hold or move funds.

## Output

Returns ready-to-sign transaction calldata for the yield action, an ERC-20 approval object (for deposits), and the expected number of shares (on deposit) or underlying assets (on redeem) based on live on-chain protocol state.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "protocol",
      "amount",
      "recipient"
     ],
     "properties": {
      "asset": {
       "type": "string",
       "description": "For aave-v3/compound-v3: the asset symbol (USDC, WETH, ...) or a 0x ERC-20 address. Compound III earns only on its base asset."
      },
      "vault": {
       "type": "string",
       "description": "For erc4626: the vault 0x address (ANY Base ERC-4626) or a seed slug. Resolved on-chain."
      },
      "action": {
       "enum": [
        "deposit",
        "redeem"
       ],
       "type": "string",
       "description": "deposit (supply) or redeem (withdraw). Default deposit."
      },
      "amount": {
       "type": "string",
       "description": "Raw atomic units. deposit: underlying assets. redeem: aave/comet = underlying (or 'max'); erc4626 = shares (or 'max')."
      },
      "protocol": {
       "enum": [
        "aave-v3",
        "compound-v3",
        "erc4626"
       ],
       "type": "string",
       "description": "Yield protocol: aave-v3, compound-v3 or erc4626."
      },
      "recipient": {
       "type": "string",
       "description": "0x address that supplies/receives (baked into calldata)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defiexec-build-9e7d928b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
