# defiexec-build

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

Generates ready-to-sign EVM calldata for depositing into or redeeming from Aave v3, Compound v3, or any ERC-4626 vault on Base, including ERC-20 approval calldata and expected output amounts.

## Facts

- Endpoint: GET https://api.agentstools.dev/yield/build
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defiexec-build-cf526250
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hHadsgM9YHrldL7nBL8PX

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-cf526250
```

Example prompt: Build me the deposit calldata to supply 1000000000 USDC (raw units) into Aave v3 on Base for my wallet 0xAbC123...def456 — I need the approval tx and the expected aTokens too.

## When to prefer this

Use this endpoint when you need non-custodial, ready-to-sign calldata for Base yield protocols (Aave v3, Compound v3, or any ERC-4626 vault) without connecting to a wallet SDK or writing contract interaction code. Ideal for AI agents that need to automate DeFi yield strategies while keeping the user in full custody of their funds.

## Known failure modes

- Unsupported protocol specified — only aave-v3, compound-v3, erc4626 accepted
- Invalid or unrecognized asset symbol for the specified protocol
- Vault address not resolvable on-chain for erc4626
- Amount of zero or malformed raw amount string
- Invalid recipient address format
- Compound III requested with non-base asset — only base asset earns yield
- On-chain state read failure or RPC timeout
- Payment not received — x402 payment required before response

## 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 deposit or redeem action, an ERC-20 approval calldata object (for deposits), and the expected number of shares (on deposit) or underlying assets (on redeem) based on current 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-cf526250/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
