AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Portfolio Report

skill-oh-rid-claude-code-plugin-ib-portfolio-report · by oh-rid

Generate a concise portfolio snapshot with P&L, allocation, and key metrics from live IB data. Triggers on "portfolio report", "portfolio summary", "how's my portfolio", "show me my positions", "portfolio snapshot", "account overview", "what am I holding", or "P&L report".

No reviews yet
0 installs
9 views
0.0% view→install

Install

$ agentstack add skill-oh-rid-claude-code-plugin-ib-portfolio-report

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-oh-rid-claude-code-plugin-ib-portfolio-report)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

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 →
Are you the author of Portfolio Report? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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

  1. Did the session authenticate? Stop early if not.
  2. Is NLV > 0? If account is empty, say so and stop.
  3. Does sum of position mktValues + cash approximately equal NLV? Flag discrepancy > 5%.
  4. ALL arithmetic via python3 -c. Every percentage, every sum.
  5. Are positions sorted by mktValue descending (largest first)?
  6. If > 20 positions, show top 15 and summarize the rest as "X smaller positions totaling $Y".
  7. Is output under 1 page? If not, compress the positions table.
  8. Every number comes from the API response. Never fabricate. If a field is missing, say "N/A".
  9. 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.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.