Skip to main content
skill CX Codex

nansen-defi-positions — Claude Code skill: wallet DeFi positions

Breaks a wallet's DeFi positions down by protocol and chain: assets, debts, rewards. Useful when you need to see what the address actually holds.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add nansen-ai/nansen-cli --skill nansen-defi-positions -a claude-code
Open on GitHub

What nansen-defi-positions does

The skill answers what DeFi positions a wallet has and splits them protocol by protocol. Running nansen research portfolio defi --wallet $ADDR returns protocol name, chain, total value in USD, assets, debts and rewards, plus the token list. Spot balances come from a separate call: nansen research profiler balance --address $ADDR --chain ethereum gives token symbol, name, amount and value. Put the two together and you get the full on-chain exposure.

Under the hood it wraps the nansen CLI, installed from the nansen-cli npm package. Auth runs through NANSEN_API_KEY or a nansen:api browser session with the same permissions; the key wins when both are present. nansen auth status checks the selection offline. Browser login ships in CLI 2.0.0 and only within the macOS arm64 preview scope.

When auth breaks, the skill stops instead of falling back to anonymous x402 payment. Browser login grants no wallet signing and no persistent MCP key. One thing to expect: portfolio defi comes back empty for wallets with no tracked DeFi positions, so an empty result is not a failure.

What it helps with

  • find which protocols a wallet is exposed to
  • total up debts and rewards per position
  • compare exposure on Ethereum and Base
  • pair DeFi positions with spot balances
  • check whether an address has tracked DeFi positions

Example prompts for the agent

  • Show the DeFi positions for wallet 0x... across all protocols
  • Break down assets, debts and rewards by protocol for this address
  • Compare DeFi positions and spot balances for the wallet on Ethereum and Base

How to install nansen-defi-positions

1Skills CLI (Vercel)

npx skills add nansen-ai/nansen-cli --skill nansen-defi-positions -a claude-code

2Manually: put the files in place

~/.claude/skills/nansen-defi-positions/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/nansen-defi-positions/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about nansen-defi-positions

How do I install nansen-defi-positions in Claude?

Run npx skills add nansen-ai/nansen-cli --skill nansen-defi-positions -a claude-code. The skill file then lives at ~/.claude/skills/nansen-defi-positions/SKILL.md.

What does nansen-defi-positions do?

It lists a wallet's DeFi positions by protocol with assets, debts, rewards and total USD value. It also pulls spot balances for a given chain.

What does the skill need to run?

The nansen binary from the nansen-cli package plus credentials: NANSEN_API_KEY or a nansen:api browser session. If auth fails, the skill stops and does not fall back to anonymous x402 payment.

Source text

SKILL.md · MIT
---
name: nansen-defi-positions
description: "What DeFi positions does a wallet hold? Protocol-by-protocol breakdown of assets, debts, and rewards across chains."
metadata:
  openclaw:
    requires:
      bins:
        - nansen
    primaryEnv: NANSEN_API_KEY
    install:
      - kind: node
        package: nansen-cli
        bins: [nansen]
allowed-tools: Bash(nansen:*)
---
## Authentication

Nansen account API calls accept a selected `nansen:api` browser session or conventional API key with the same permissions. `NANSEN_API_KEY` takes precedence; optional `primaryEnv` preserves configured-key injection. Run `nansen auth status` for offline selection. Cached access expiry alone permits automatic renewal during an authorized task. Stop on anonymous selection, invalid state, blocked/uncertain renewal or actual auth failure; never drop a credential or fall back to anonymous x402 payment. Browser login does not grant wallet signing, privileged service identity or a persistent MCP integration key. Preserve all confirmation, signing, sanctions and geographic checks below. Browser login is available in CLI 2.0.0 within the [macOS arm64 preview scope](https://github.com/nansen-ai/nansen-cli/blob/main/docs/browser-login.md#preview-platform-scope).



# DeFi Exposure

**Answers:** "What DeFi positions does this wallet have across protocols?"

```bash
ADDR=<address>

nansen research portfolio defi --wallet $ADDR
# → protocol_name, chain, total_value_usd, total_assets_usd, total_debts_usd, total_rewards_usd, tokens

nansen research profiler balance --address $ADDR --chain ethereum
# → token_symbol, token_name, token_amount, value_usd per holding

nansen research profiler balance --address $ADDR --chain base
```

Combine DeFi positions (lending, LPs, staking) with spot balances for a complete picture of on-chain exposure.

Note: portfolio defi may return empty for wallets with no tracked DeFi positions.

© nansen-ai · MIT · nansen-ai/nansen-cli

Similar skills

Everything for Finance and business →

From the same set8

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor