Skill

portfolio

Install
1
Install the plugin
$
npx claudepluginhub sd0xdev/sd0x-dev-flow --plugin sd0x-dev-flow

Want just this skill?

Add to a custom plugin, then install with one command.

Description

Portfolio system knowledge base. Use when: position queries, routing strategy questions, provider integration. Not for: general code exploration (use code-explore), code review (use codex-code-review). Output: domain-specific analysis + recommendations.

Tool Access

This skill is limited to using the following tools:

ReadGrepGlob
Supporting Assets
View in Repository
references/api.md
references/architecture.md
Skill Content

Portfolio Skill

Trigger

  • Keywords: Portfolio, portfolio, position, {PRIMARY_PROVIDER}, protocol, lending, staking, liquidity

When NOT to Use

  • General token queries (not Portfolio positions)
  • Transaction building (use corresponding provider)
  • Non-portfolio related API issues

Core Files

TypeFilePurpose
Controllersrc/entity/portfolio/portfolio.controller.tsREST API
Routersrc/service/portfolio/source-router/*.service.tsRouting orchestration
Clientsrc/service/portfolio/providers/{provider}/*.ts{PRIMARY_PROVIDER} integration
Aggregatorsrc/service/portfolio/aggregation/*.service.tsAggregation computation
DTOsrc/dto/portfolio/position.types.tsPosition model

API Overview

Base: /onchain/v1/portfolio

EndpointMethodPurpose
/positionsPOSTGet portfolio positions
/chainsGETSupported chains list
/protocolsGETSupported protocols list

Output

  • Domain-specific query results with code references
  • Analysis and recommendations based on current architecture

Verification

  • Position data correctly normalized
  • Cache hit/miss working properly
  • Aggregation calculations accurate

Development Guide

Add Protocol Support

  1. Check if {PRIMARY_PROVIDER} supports it
  2. If custom build needed: implement PortfolioPositionExtractor + register + configure routing

Add Data Source

  1. Implement ProviderClient + Adapter
  2. Register with SourceRouter
  3. Configure routing strategy

Debug

redis-cli keys "portfolio:{provider}:*"
redis-cli get "portfolio:{provider}:positions:0x...:v2:..."
curl -X POST /positions -d '{"isForceRefresh": true, ...}'

References

  • references/architecture.md - System architecture + cache strategy
  • references/api.md - API reference + data models
  • @docs/features/portfolio/ - Detailed documentation

Tests

TypeLocation
Unittest/unit/service/portfolio/
Integrationtest/integration/portfolio/

Examples

Input: How to query portfolio positions?
Action: Explain POST /positions API + routing strategy
Input: How does {PRIMARY_PROVIDER} integration work?
Action: Explain {PRIMARY_PROVIDER}Client + {PRIMARY_PROVIDER}Adapter flow
Stats
Stars90
Forks12
Last CommitMar 5, 2026
Actions

Similar Skills