Get the FREE Ultimate OpenClaw Setup Guide →

defi-portfolio-tracker

npx machina-cli add skill auralshin/agent-skills/defi-portfolio-tracker --openclaw
Files (1)
SKILL.md
2.5 KB

DeFi Portfolio Tracker

Purpose

Build a complete snapshot of wallet exposure across spot assets, LPs, staking, vaults, and debt positions.

Use this skill when

  • The user provides a wallet address / ENS / list of wallets.
  • The task is portfolio decomposition, debt health, or exposure review.
  • The user asks for net worth, PnL proxy, or risk hot spots.

Do not use this skill when

  • The task is protocol-level risk scoring (use defi-risk-evaluator).
  • The task is transaction construction/signing.

Workflow

  1. Resolve identity inputs (address/ENS) and target chains.
  2. Collect balances and position data from preferred portfolio providers.
  3. Normalize positions using references/position-schema.md.
  4. Calculate totals:
    • Gross assets
    • Gross debt
    • Net worth (assets - debt)
  5. Compute risk indicators:
    • Concentration by token and protocol
    • Leverage ratio
    • Borrow health factor buckets (from references/risk-thresholds.md)
  6. Return structured output and explicit caveats.

Rules

  • Treat all valuation as timestamped snapshots.
  • Separate wallet-native spot holdings from DeFi positions.
  • Never assume historical PnL unless transaction history is explicitly available.
  • Report unknown pricing or illiquid assets separately.

Required output format

{
  "wallet": "string",
  "snapshot_time": "ISO-8601",
  "by_chain": [
    {
      "chain": "string",
      "assets_usd": 0,
      "debt_usd": 0,
      "net_worth_usd": 0,
      "positions": [
        {
          "protocol": "string",
          "position_type": "spot|lp|staking|lending_supply|lending_borrow|vault",
          "asset": "string",
          "amount": 0,
          "value_usd": 0,
          "debt_usd": 0,
          "health_factor": 0
        }
      ]
    }
  ],
  "portfolio_totals": {
    "assets_usd": 0,
    "debt_usd": 0,
    "net_worth_usd": 0,
    "leverage_ratio": 0
  },
  "risk_flags": ["string"],
  "summary": "2-4 sentence summary"
}

Bundled resources

  • references/position-schema.md: Canonical position schema.
  • references/risk-thresholds.md: Health factor and concentration thresholds.
  • scripts/portfolio_summary.py: Deterministic net worth + risk aggregation from normalized position JSON.

Source

git clone https://github.com/auralshin/agent-skills/blob/main/skills/defi-portfolio-tracker/SKILL.mdView on GitHub

Overview

The DeFi Portfolio Tracker builds a complete snapshot of a wallet's exposure across spot assets, LPs, staking, vaults, and debt positions. It computes net worth and leverage, and flags liquidation risk or concentration hotspots. Positions are normalized to a canonical schema to enable cross-chain aggregation.

How This Skill Works

Resolve the wallet identity inputs (address/ENS) and target chains, then fetch balances and DeFi positions from preferred portfolio providers. Normalize all positions using the canonical position schema, then compute totals (assets, debt, net worth) and risk indicators (token/protocol concentration, leverage, health-factor buckets). Return a structured, timestamped output with caveats.

When to Use It

  • The user submits a wallet address, ENS, or list of wallets and wants a cross-chain portfolio decomposition.
  • The user asks for net worth, PnL proxy, or risk hotspots across DeFi positions.
  • The user needs a breakdown of exposure across spot assets, LPs, staking, vaults, and debt.
  • The user wants concentration analysis by token or by protocol to inform risk decisions.
  • The user requires a timestamped snapshot with explicit caveats rather than protocol-level risk scoring.

Quick Start

  1. Step 1: Resolve identity inputs (address/ENS) and target chains.
  2. Step 2: Collect balances and positions from preferred portfolio providers.
  3. Step 3: Normalize positions, compute totals and risk indicators, and return the structured output.

Best Practices

  • Treat valuations as timestamped snapshots and document the time of capture.
  • Separate wallet-native spot holdings from DeFi positions to avoid double counting.
  • Do not infer historical PnL unless transaction history is explicitly available.
  • Report unknown pricing or illiquid assets separately with clear caveats.
  • Validate inputs against references/position-schema.md and apply risk-threshold guidance from references/risk-thresholds.md.

Example Use Cases

  • A wallet on Ethereum holds ETH, USDC, UNI liquidity, and Aave debt; the tool computes net worth, highlights top concentration, and flags liquidation risk.
  • A cross-chain wallet across Ethereum and Polygon with staking and vault positions; returns net worth plus concentration by token and protocol.
  • Detects high leverage borrow and weak health factor buckets to surface risk hotspots for proactive management.
  • Reveals over-exposure to a single protocol across multiple chains, enabling diversification decisions.
  • Generates a timestamped portfolio snapshot suitable for auditing and ongoing monitoring.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers