Install
$ agentstack add skill-oh-rid-claude-code-plugin-ib-portfolio-report ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Portfolio Report — Solo Trader
Pull live IB account data and produce a one-page portfolio snapshot. Not a 10-page client report. A trader's dashboard in markdown.
Workflow
Step 0: Session check
curl -sk https://localhost:5000/v1/api/tickle
Step 1: Get account ID
curl -sk https://localhost:5000/v1/api/portfolio/accounts
Step 2: Account summary
curl -sk "https://localhost:5000/v1/api/portfolio/$ACCT/summary"
Extract:
- NLV (Net Liquidation Value)
- Buying power (available margin or cash)
- Gross position value
- Maintenance margin (if on margin)
- Cushion (excess liquidity / NLV — how far from margin call)
Step 3: Pull all positions
curl -sk "https://localhost:5000/v1/api/portfolio/$ACCT/positions/0"
For each position: ticker, assetClass, position (qty), mktValue, avgCost, avgPrice, unrealizedPnl, realizedPnl, currency.
Step 4: Currency breakdown
curl -sk "https://localhost:5000/v1/api/portfolio/$ACCT/ledger"
Shows cash balances per currency and settled/unsettled.
Step 5: Calculate derived metrics
All via python3 -c:
- Total unrealized P&L = sum of all unrealizedPnl
- Total realized P&L = sum of all realizedPnl
- Concentration = largest position mktValue / NLV (flag if > 25%)
- Position count = number of open positions
- Long/short split = sum of long mktValue vs short mktValue
- Asset class breakdown = aggregate mktValue by assetClass (STK, OPT, FUT, CASH, BOND)
Step 6: Identify notable positions
Flag:
- Biggest winner: position with highest unrealizedPnl
- Biggest loser: position with most negative unrealizedPnl
- Most concentrated: position with highest % of NLV
- Deep underwater: any position with > 20% loss
Output format
One markdown block, max 1 page:
## Portfolio Snapshot — {date} {time}
### Account: {account_id}
| Metric | Value |
|------------------|-----------|
| Net Liquidation | $XXX,XXX |
| Buying Power | $XX,XXX |
| Margin Used | $XX,XXX |
| Cushion | XX% |
| Unrealized P&L | +$X,XXX |
| Realized P&L | +$X,XXX |
| Open Positions | XX |
### Allocation
| Asset Class | Value | % of NLV |
|-------------|-----------|----------|
| Stocks | $XXX,XXX | XX% |
| Options | $X,XXX | X% |
| Cash | $XX,XXX | XX% |
### Positions (by size)
| Ticker | Qty | Mkt Value | Unreal P&L | % of NLV | % P&L |
|--------|------|-----------|------------|----------|--------|
| AAPL | 100 | $17,500 | +$1,200 | 12% | +7.4% |
| ... | | | | | |
### Notable
- Biggest winner: {ticker} (+${pnl}, +X%)
- Biggest loser: {ticker} (-${pnl}, -X%)
- Concentration: {ticker} at {X}% of NLV {warning if >25%}
### Cash by Currency
| Currency | Settled | Total |
|----------|----------|----------|
| USD | $XX,XXX | $XX,XXX |
Save output
Always save the portfolio snapshot to the research directory:
mkdir -p portfolio/ib
# Save to: portfolio/ib/{YYYY-MM-DD}_snapshot.md
This creates a historical record of portfolio state over time. Filenames are date-stamped — multiple snapshots per day overwrite (latest wins).
Self-validation checks
- Did the session authenticate? Stop early if not.
- Is NLV > 0? If account is empty, say so and stop.
- Does sum of position mktValues + cash approximately equal NLV? Flag discrepancy > 5%.
- ALL arithmetic via
python3 -c. Every percentage, every sum. - Are positions sorted by mktValue descending (largest first)?
- If > 20 positions, show top 15 and summarize the rest as "X smaller positions totaling $Y".
- Is output under 1 page? If not, compress the positions table.
- Every number comes from the API response. Never fabricate. If a field is missing, say "N/A".
- Currency: if multi-currency account, show the ledger breakdown. Don't hide FX exposure.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: oh-rid
- Source: oh-rid/claude-code-plugin-ib
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.