okx-defi-portfolio

2 commands for viewing DeFi positions and holdings across protocols and chains.

okx/onchainos-skillsUpdated Apr 8, 2026

Works with

Claude CodeCursorClineWindsurfCodexGooseGitHub CopilotZed

0

total installs

0

this week

188

GitHub stars

0

upvotes

Install Skill

Run in your terminal

$npx skills add https://github.com/okx/onchainos-skills --skill okx-defi-portfolio

0

installs

0

this week

188

stars

Installation Guide

How to use okx-defi-portfolio on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your machine
  • Node.js 16+ with npm — verify with node --version
  • Active project directory where you want to add okx-defi-portfolio
2

Run the install command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/okx/onchainos-skills --skill okx-defi-portfolio

Fetches okx-defi-portfolio from okx/onchainos-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI shows a list of agents. Use arrow keys and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ────────────────
│ · Cline · Codex · Goose · Windsurf
│ ●Cursor(selected)
│ · Cursor · Aider · Continue
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/okx-defi-portfolio

Restart Cursor to activate okx-defi-portfolio. Access via /okx-defi-portfolio in your agent's command palette.

Security Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.

Documentation

OKX DeFi Portfolio

2 commands for viewing DeFi positions and holdings across protocols and chains.

Skill Routing

  • For DeFi deposit/redeem/claim → use okx-defi-invest
  • For token price/chart → use okx-dex-market
  • For wallet token balances → use okx-wallet-portfolio
  • For DEX spot swap → use okx-dex-swap

Quickstart

# Get DeFi holdings overview across chains
onchainos defi positions \
  --address 0xYourWallet \
  --chains ethereum,bsc,solana

# Get detailed holdings for a specific protocol (analysisPlatformId from positions output)
onchainos defi position-detail \
  --address 0xYourWallet \
  --chain ethereum \
  --platform-id 67890

Command Index

# Command Description
1 onchainos defi support-chains Get supported chains for DeFi
2 onchainos defi support-platforms Get supported platforms for DeFi
3 onchainos defi positions --address <addr> --chains <chains> Get user DeFi holdings overview
4 onchainos defi position-detail --address <addr> --chain <chain> --platform-id <id> Get detailed holdings for a protocol

Chain Support

Chain Name / Aliases chainIndex
Ethereum ethereum, eth 1
BSC bsc, bnb 56
Polygon polygon, matic 137
Arbitrum arbitrum, arb 42161
Base base 8453
X Layer xlayer, okb 196
Avalanche avalanche, avax 43114
Optimism optimism, op 10
Fantom fantom, ftm 250
Sui sui 784
Tron tron, trx 195
TON ton 607
Linea linea 59144
Scroll scroll 534352
zkSync zksync 324
Solana solana, sol 501

Operation Flow

Step 0: Address Resolution

When the user does NOT provide a wallet address, resolve it automatically from the Agentic Wallet before running any defi command:

1. onchainos wallet status          → check if logged in, get active account
2. onchainos wallet addresses       → get addresses grouped by chain category:
                                       - XLayer addresses
                                       - EVM addresses (Ethereum, BSC, Polygon, etc.)
                                       - Solana addresses
3. Match address to target chain:
   - EVM chains → use EVM address
   - Solana     → use Solana address
   - XLayer     → use XLayer address

Rules:

  • If the user provides an explicit address, use it directly — skip this step
  • If wallet is not logged in, ask the user to log in first (→ okx-agentic-wallet) or provide an address manually
  • If the user says "check all accounts" or "all wallets", use wallet balance --all to get all account IDs, then wallet switch <id> + wallet addresses for each account, and query positions for each
  • Always confirm the resolved address with the user before proceeding if the account has multiple addresses of the same type

Step 1: Identify Intent

User says Action
View positions / portfolio / holdings onchainos defi positions
View detail for a protocol onchainos defi position-detail
Redeem / claim after viewing Suggest → use okx-defi-invest

Step 2: Collect Parameters

  • Missing wallet address → resolve via Step 0 (wallet status → wallet addresses), or ask user if not logged in
  • Missing chains → ask user which chains to query, or suggest common ones (ethereum, bsc, solana)
  • Missing platform-id → run defi positions first to get analysisPlatformId

Step 3: Display Results

Displaying Positions Results

When displaying defi positions output, you MUST use exactly these columns in this order — no substitutions, no omissions:

# Platform analysisPlatformId Chains Positions Value(USD)
1 Aave V3 12345 ETH,BSC 2 $120.00

Rules:

  • analysisPlatformId is MANDATORY in every row — users must copy this value to run position-detail
  • Never omit, hide, or replace analysisPlatformId with any other field
  • Never group platforms — show every platform as its own row regardless of value size
  • Raw JSON path: walletIdPlatformList[*].platformList[*] — each element is one platform row
    • platformName → Platform
    • analysisPlatformId → analysisPlatformId
    • networkBalanceList[*].network → Chains (join with comma)
    • investmentCount → Positions
    • currencyAmount → Value(USD)

Displaying Position Detail Results

Output shape: { "ok": true, "data": [ { "walletIdPlatformDetailList": [...] }, ... ] }data is an array. Never call .get() on data directly; iterate over it as a list.

When displaying defi position-detail output, render all tokens in a single flat table with these exact columns:

Type Asset Amount Value(USD) investmentId aggregateProductId Token Contract Rewards
Supply USDT 1.002285 $1.0025 127 71931 0x970223...7 0.000080 AVAX
Pending sAVAX 0.00000091 $0.000012 Platform reward

Rules:

  • Each token row is one row; merge in investmentId and aggregateProductId from its parent investment entry
  • investmentId is MANDATORY in every row — users need it for redeem/claim (via okx-defi-invest)
  • aggregateProductId — show if present, otherwise
  • Token Contract: show the full contract address without truncation; show if native/empty
  • Rewards: show pending reward amount + symbol if present, if none; for platform rewards show Platform reward
  • Type: map investType → Supply/Borrow/Stake/Farm/Pool etc; pending rewards row uses Pending
  • Health rate: show separately below the table with warning if healthRate < 1.5

investType Reference

investType Description
1 Save (savings/yield)
2 Pool (liquidity pool)
3 Farm (yield farming)
4 Vaults
5 Stake
6 Borrow
7 Staking
8 Locked
9 Deposit
10 Vesting

Post-execution Suggestions

Just completed Suggest
defi positions 1. View detail → defi position-detail 2. Redeem → okx-defi-invest 3. Claim rewards → okx-defi-invest
defi position-detail 1. Redeem position → use okx-defi-invest with investmentId from table 2. Claim rewards → use okx-defi-invest 3. Add more → use okx-defi-invest

Global Notes

  • CRITICAL — Address-chain compatibility: The --address and --chains parameters must be compatible. EVM addresses (0x…) can only query EVM chains; Solana addresses (base58) can only query solana. Never mix them in a single call — the API will return error 84019 (Address format error).
    • 0x… address → only pass EVM chains: ethereum,bsc,polygon,arbitrum,base,xlayer,avalanche,optimism,fantom,linea,scroll,zksync
    • base58 address → only pass solana
    • Sui address → only pass sui
    • Tron address (T…) → only pass tron
    • TON address → only pass ton
    • If the user wants positions across both EVM and Solana, make two separate calls with the respective addresses
  • defi positions uses --chains (plural, comma-separated, e.g. --chains ethereum,bsc) — do NOT use --chain
  • defi position-detail uses --chain (singular) — do NOT use --chains
  • The wallet address parameter is --address for both commands
  • position-detail requires analysisPlatformId from positions output as --platform-id
  • The CLI resolves chain names automatically (ethereum1, bsc56, solana501)

List & Monetize Your Skill

Submit your Claude Code skill and start earning

Get started →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Steps

  1. 1Install product management skill
  2. 2Start with user story generation for known feature
  3. 3Progress to competitive analysis: research 2-3 competitors
  4. 4Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5Draft stakeholder communications and refine based on feedback
  6. 6Build template library for recurring PM tasks
  7. 7Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use when

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid when

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Related Skills

Reviews

4.650 reviews
  • A
    Ava ThompsonDec 28, 2024

    Useful defaults in okx-defi-portfolio — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • L
    Lucas DixitDec 24, 2024

    I recommend okx-defi-portfolio for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • A
    Ama ShahDec 8, 2024

    okx-defi-portfolio fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • L
    Li KapoorDec 8, 2024

    okx-defi-portfolio is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • M
    Meera AbebeNov 27, 2024

    okx-defi-portfolio is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • M
    Meera OkaforNov 27, 2024

    okx-defi-portfolio fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Y
    Yash ThakkerNov 23, 2024

    okx-defi-portfolio reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • W
    William ChenNov 19, 2024

    I recommend okx-defi-portfolio for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • L
    Lucas KapoorNov 15, 2024

    Useful defaults in okx-defi-portfolio — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • N
    Naina SharmaOct 18, 2024

    Solid pick for teams standardizing on skills: okx-defi-portfolio is focused, and the summary matches what you get after install.

showing 1-10 of 50

1 / 5

Discussion

Comments — not star reviews
  • No comments yet — start the thread.