Portfolio

DeFi Holdings API tracks active positions across DeFi protocols.

Get Portfolio DeFi Holdings Data

post

Get simplified DeFi holdings for a wallet address with aggregated tokens and protocol summaries in a user-friendly format.

Authorizations
Body

Request model for portfolio DeFi holdings endpoint.

wallet_addressstringRequired

Wallet address to get DeFi holdings for

Example: 0x4062b997279de7213731dbe00485722a26718892
Responses
200

Portfolio DeFi holdings data

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

{
  "wallet_address": "0x4062b997279de7213731dbe00485722a26718892"
}
{
  "summary": {
    "total_value_usd": 1,
    "total_assets_usd": 1,
    "total_debts_usd": 1,
    "total_rewards_usd": 1,
    "token_count": 1,
    "protocol_count": 1
  },
  "protocols": [
    {
      "protocol_name": "text",
      "chain": "text",
      "total_value_usd": 1,
      "total_assets_usd": 1,
      "total_debts_usd": 1,
      "total_rewards_usd": 1,
      "tokens": [
        {
          "address": "text",
          "symbol": "text",
          "amount": 1,
          "value_usd": 1,
          "position_type": "text"
        }
      ]
    }
  ]
}

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?