# DeFi Balances & Protocol Position Snapshot

> DeFi Balances & Protocol Position Snapshot is a paid API for AI agents from wallet-portfolio-history-mcp.mtree.workers.dev, paid per call via x402, $0.2/call, status unknown (last checked 2026-09-15).

Returns a DeFi balance and protocol-position snapshot for a wallet, including Aave/Compound receipt tokens, Aerodrome/Lido positions, protocol interaction hints, D1 history, freshness, and provenance.

## Facts

- Endpoint: POST https://wallet-portfolio-history-mcp.mtree.workers.dev/tools/defi_balances
- Price: $0.2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-balances-protocol-position-snapshot-d05f88be
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wU_F3hHShoriHJnba3VQx

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-balances-protocol-position-snapshot-d05f88be -d '<json body>'
```

Example prompt: Pull the full DeFi balance and protocol position snapshot for wallet 0x1234...abcd on Base — I need to see any Aave or Compound receipt tokens, Aerodrome and Lido positions, and provenance info for due diligence.

## When to prefer this

Choose this endpoint when you need a comprehensive DeFi protocol position breakdown for a wallet, specifically including receipt-token reads for Aave/Compound and coverage of Aerodrome/Lido — especially for wallet due diligence, risk assessment pipelines, or portfolio audits where protocol-level provenance and freshness metadata matter. Prefer this over generic balance endpoints when protocol-specific position context and D1 history are required.

## Known failure modes

- Invalid or malformed wallet address returns an error response
- Unsupported chain or non-Base address may yield empty or partial results
- Stale D1 snapshot may be returned if freshness threshold is exceeded
- Payment failure via x402 (insufficient USDC balance or wrong network) blocks the call
- Rate limiting or worker timeout on the Cloudflare edge may return a 5xx error

## How this service works

Hosted DeFi balance and protocol-position snapshot for wallet diligence: Aave/Compound receipt-token reads, Aerodrome/Lido coverage, protocol interaction hints, D1 history, freshness, and provenance. Price 0.20 USDC on Base via x402. Demo: https://wallet-portfolio-history-mcp.mtree.workers.dev/demo/tools/defi_balances. Contact: https://wallet-portfolio-history-mcp.mtree.workers.dev/contact.

## Output

A structured snapshot of the wallet's DeFi holdings including receipt token balances for Aave and Compound, protocol positions for Aerodrome and Lido, protocol interaction hints, cached D1 history, data freshness timestamps, and provenance information — enabling a complete picture of the wallet's DeFi exposure.

## Example request

```json
{
 "input": {
  "body": {
   "chain": "base",
   "limit": 10,
   "address": "0x1234567890123456789012345678901234567890"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "type": "string"
      },
      "limit": {
       "type": "integer",
       "maximum": 50,
       "minimum": 1
      },
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "refresh": {
       "type": "boolean"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "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-balances-protocol-position-snapshot-d05f88be/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from wallet-portfolio-history-mcp.mtree.workers.dev](https://www.zero.xyz/host/wallet-portfolio-history-mcp.mtree.workers.dev/llms.txt)
