# DeFi Yield Preview (Base)

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

Returns expected shares/assets and safety flags for a proposed yield deposit or redeem on Base, without building the full transaction calldata.

## Facts

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

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-6c3b4676
```

Example prompt: Before I deposit 1000000 USDC (in raw atomic units) into Aave v3 on Base, can you preview how many shares I'd get and check whether the pool is paused or frozen?

## When to prefer this

Use this endpoint as a cheap read-only preflight step before calling defiexec-build to construct the actual calldata. It is ideal when you need to verify expected output amounts, check safety flags, or confirm a vault is not paused/frozen/at-cap before committing to a transaction. Prefer it over directly building a transaction when you want to surface risks (e.g. ERC-4626 inflation attacks on empty vaults) without spending gas or exposing private keys. It covers Aave v3, Compound v3, and any Base ERC-4626 vault.

## Known failure modes

- Unknown or unsupported asset symbol returns an error
- Invalid vault address that cannot be resolved on-chain
- Amount of zero or non-numeric amount string
- Protocol enum value not one of aave-v3, compound-v3, erc4626
- Vault is resolvable but empty, triggering inflation risk flag rather than a hard error
- Network or RPC timeout when fetching on-chain state
- Payment failure (x402) if USDC payment not included

## 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 output amount (shares for a deposit, or underlying assets for a redeem) in raw atomic units, along with safety flags indicating whether the protocol or vault is paused, frozen, at capacity, or at risk of share inflation (for empty ERC-4626 vaults). This is a read-only simulation — 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-6c3b4676/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)
