# DeFi Yield Preview (Base)

> DeFi Yield Preview (Base) is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Returns expected shares/assets and safety flags for a yield deposit or redeem on Base without building full calldata — a cheap pre-flight check for Aave v3, Compound v3, or ERC-4626 vaults.

## Facts

- Endpoint: GET https://payai.agentstools.dev/yield/preview
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-yield-preview-base-b8a5eb88
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wHT4Fs3lBMtXOO2pvIvVx

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 defi-yield-preview-base-b8a5eb88
```

Example prompt: Before I build the transaction, preview a deposit of 1000000000 USDC (raw units) into Aave v3 on Base — show me the expected shares and any safety flags like paused, frozen, or cap reached.

## When to prefer this

Use this endpoint before calling defiexec-build when you want to estimate output amounts and check safety flags cheaply ($0.01) without constructing or paying for full calldata. Prefer this over defiexec-build for read-only simulations, risk checks, or UX previews where no transaction will be submitted yet.

## Known failure modes

- Unsupported protocol value returns validation error
- Asset symbol not recognized for the selected protocol returns error
- Vault address not resolvable on-chain returns not-found error
- Amount of zero or invalid format returns bad-request error
- Vault is empty and inflation risk flag is raised as a warning
- Network or RPC timeout returns 503

## How this service works

Lightweight yield preview for Base without calldata: give protocol, asset or vault, raw amount and action and get the expected shares or assets and the safety flags (paused/frozen/cap, empty-vault inflation risk). A cheap check before you build the full transaction.

## Output

Returns the expected shares (for deposit) or expected assets (for redeem) in raw atomic units, plus a set of boolean safety flags: paused, frozen, cap reached, and empty-vault inflation risk. No transaction is built or submitted.

## 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"
     ],
     "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."
      }
     }
    }
   },
   "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/defi-yield-preview-base-b8a5eb88/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)
