# OnchainExpat DeFi Positions API

> OnchainExpat DeFi Positions API is a paid API for AI agents from x402.onchainexpat.com, paid per call via x402, $0.08/call, status unknown (last checked 2026-09-13).

Fetches DeFi portfolio positions and holdings for a given wallet or address across decentralized finance protocols

## Facts

- Endpoint: POST https://x402.onchainexpat.com/api/x402-crypto/defi-positions
- Price: $0.08/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchainexpat-defi-positions-api-68340cbd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VXTQt_fL_qUw3tUeK8tV6

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 onchainexpat-defi-positions-api-68340cbd -d '<json body>'
```

Example prompt: Can you pull up all the DeFi positions for my wallet 0xAbc123...def456 — I want to see what liquidity pools, yield farms, and token holdings I have across protocols?

## When to prefer this

Use this endpoint when you need to look up on-chain DeFi positions for a specific wallet address and are willing to pay per request via the x402 micropayment protocol. Best suited for agents that need real-time DeFi portfolio data without managing API keys or subscriptions.

## Known failure modes

- Invalid or malformed wallet address returns an error response
- Unsupported blockchain network or protocol returns empty or partial results
- Payment not fulfilled via x402 protocol results in 402 Payment Required response
- Rate limiting or network timeout may return a 5xx error
- Wallet with no DeFi activity returns empty positions array

## How this service works

Pay-per-request AI, crypto, proxy, and utility APIs using x402 protocol

## Output

A JSON object containing the DeFi positions associated with the queried wallet, including protocol names, token pairs, liquidity pool shares, staked amounts, and estimated portfolio values across DeFi protocols.

## Example request

```json
{
 "address": "0x1234567890123456789012345678901234567890"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "address"
 ],
 "properties": {
  "chain": {
   "type": "string",
   "description": "Blockchain (default: all)"
  },
  "address": {
   "type": "string",
   "description": "EVM wallet address (0x + 40 hex chars) or ENS name (e.g. 'vitalik.eth')"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "object",
   "properties": {
    "chain": {
     "type": "string"
    },
    "address": {
     "type": "string"
    },
    "positions": {
     "type": "array",
     "description": "List of DeFi positions by protocol"
    },
    "protocols": {
     "type": "array",
     "description": "Protocols with active positions"
    },
    "ai_analysis": {
     "type": "object",
     "description": "AI-powered strategy insights and recommendations"
    },
    "total_value_usd": {
     "type": "number",
     "description": "Total value of all DeFi positions"
    }
   }
  },
  "success": {
   "type": "boolean"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchainexpat-defi-positions-api-68340cbd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.onchainexpat.com](https://www.zero.xyz/host/x402.onchainexpat.com/llms.txt)
