Portfolio

From sd0xdev/sd0x-harness · View interactive version

Portfolio is an AI agent skill from the GitHub repository sd0xdev/sd0x-harness. 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.

How to use this skill

Skill file

Portfolio Skill

Trigger

When NOT to Use

Core Files

| Type | File | Purpose |

| ---------- | -------------------------------------------------- | ----------------------- |

| Controller | src/entity/portfolio/portfolio.controller.ts | REST API |

| Router | src/service/portfolio/source-router/*.service.ts | Routing orchestration |

| Client | src/service/portfolio/providers/{provider}/*.ts | {PRIMARY_PROVIDER} integration |

| Aggregator | src/service/portfolio/aggregation/*.service.ts | Aggregation computation |

| DTO | src/dto/portfolio/position.types.ts | Position model |

API Overview

Base: /onchain/v1/portfolio

| Endpoint | Method | Purpose |

| ------------ | ------ | --------------------- |

| /positions | POST | Get portfolio positions |

| /chains | GET | Supported chains list |

| /protocols | GET | Supported protocols list |

Output

Verification

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

Tests

| Type | Location |

| ----------- | ------------------------------ |

| Unit | test/unit/service/portfolio/ |

| Integration | test/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
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.