Portfolio

DeFi Holdings API tracks active positions across DeFi protocols.

portfolio/defi-holdings

post

Enhanced Portfolio DeFi holdings endpoint - combines DeFi protocol usage and holdings data

Authorizations
Body
Responses
200

Successful response

application/json
post
POST /api/beta/portfolio/defi-holdings HTTP/1.1
Host: api.nansen.ai
apiKey: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 122

{
  "parameters": {
    "walletAddress": "0x28c6c06298d514db089934071355e5743bf21d60"
  },
  "pagination": {
    "page": 1,
    "recordsPerPage": 100
  }
}
[
  {
    "protocolsUsed": {},
    "holdingsByProtocol": {},
    "success": true,
    "totalProtocols": 1,
    "totalResponses": 1
  }
]

Output Field Meanings

Top-Level Fields

Field

Description

protocolsUsed

Array of protocol names the wallet actively uses (e.g., "aave-v3-ethereum")

holdingsByProtocol

Detailed breakdown of positions per protocol

success

Boolean indicating API call success

totalProtocols

Count of protocols with detected activity

Position Types within holdingsByProtocol

Type

Description

deposits/lendings

Assets supplied to lending protocols (Aave, Compound), including amounts, value, and rewards

borrows

Borrowed assets with debt ratios and health factors

stakings

Tokens staked for rewards (liquid staking, governance tokens)

positions

Complex positions like LP tokens, derivatives, or structured products

locked

Time-locked or vested tokens (e.g., vote-escrowed tokens)

rewards

Claimable but unclaimed protocol rewards

farms

Yield farming positions with staked LP tokens

Position Detail Structure

Field

Description

type

Position category (e.g., "lending", "common", "locked")

summary

High-level metrics (asset value, rewards, debt)

detail

Granular breakdown including individual token balances, prices, and price changes

Supported Protocols

You can find the list of supported protocols on each supported chain by clicking here.

Usage Guide: Creating Complete Portfolio Overview

Use the following steps to create a complete Portfolio Overview:

Step 1: Fetch DeFi Positions Get active protocol positions, staking rewards, and lending activities. This shows how assets are being used in DeFi.

Step 2: Fetch Wallet Balances (Link Here) Retrieve all token holdings across chains, including idle tokens not actively deployed in protocols.

Step 3: Combine & Analyze

  • Total Portfolio Value = DeFi positions + wallet balances

  • Strategy Analysis: Compare liquid vs. staked vs. lending positions

  • Chain Distribution: Identify multi-chain allocation patterns

  • Risk Assessment: Analyze borrowing ratios, protocol concentration

Last updated

Was this helpful?