agentsclimarketplace

Ib positions overview

Skill luyangkk/ib-suite/skills/ib-suite/ib-positions-overview

Read-only Interactive Brokers (IBKR) diagnostics as portable AI-agent skills: account health, positions, daily P&L, trade history, dividends, options Greeks, and a P0–P3 graded portfolio report. Never places orders.

Install
npx -y skills add luyangkk/ib-suite --skill ib-positions-overview

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 17 days oldThe repository was created 17 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Read-only positions overview from Interactive Brokers. Use when the user asks to list every open position with its symbol, name, asset type, quantity, long/short, average cost, current price, market value, unrealized P&L and return, account weight, industry, market/country, and currency, or to rank positions by market value, profit, loss, or account weight and flag the most concentrated name. Reads position state only — never account cash detail, never orders.

SKILL.md

4.6 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

ib-positions-overview

Read-only positions overview for the IB analyst toolchain. Answers "what do I hold right now, and where is my capital and risk?" in one call: every open position enriched into a full line, then ranked four ways with the single most concentrated name flagged. This skill connects with readonly=True and only reads; it NEVER places, modifies, or cancels an order.

Prerequisites

Config and the shared venv are owned by the ib-suite index skill (see its first-run setup). Start IB Gateway (paper on 4002 / live on 4001) with API access, and tick Read-Only API in Gateway settings as an extra guard.

Commands

/ib-positions-overview — read-only enriched positions overview

{baseDir}/../.venv/bin/python {baseDir}/scripts/positions_overview.py --config .ib-suite/config.yaml

Prints one JSON object to stdout (parseable). It reads position state live and does not write to the data lake — nothing is persisted.

What each position carries (the 14 requested fields)

#Report fieldJSON keySource
1Symbolsymbolcontract.symbol
2Instrument namenamereqContractDetails().longName
3Asset typesec_typecontract.secType (STK/OPT/…)
4Quantityquantityportfolio().position
5Long / shortsidederived: sign of quantity (LONG/SHORT/FLAT)
6Average costavg_costportfolio().averageCost
7Current pricemarket_priceportfolio().marketPrice
8Market valuemarket_valueportfolio().marketValue (multiplier-correct)
9Unrealized P&Lunrealized_pnlportfolio().unrealizedPNL
10Unrealized returnunrealized_returnderived: `pnl /
11Account weightweightderived: base_value / NetLiquidation
12IndustryindustryreqContractDetails().industry
13Market / countrymarket / countrycontract.primaryExchange → country map
14Currencycurrencycontract.currency

Value (8) and P&L (9) come straight from IB's portfolio(), so options are already multiplier-correct — this skill never recomputes qty × price.

Rankings and concentration (computed in the script, deterministic)

The output also carries rankings (symbol lists) and top_concentration, so you present them verbatim without re-deriving any order:

ViewJSON keyOrder
By market valuerankings.by_market_valuebase market_value, high → low
By profitrankings.by_profitbase unrealized_pnl, high → low
By lossrankings.by_lossbase unrealized_pnl, most negative first
By account weightrankings.by_weightsigned weight, high → low
Most concentratedtop_concentrationsingle position with the largest `

Present all four rankings, then state the top_concentration name and its weight as the concentration conclusion.

Multi-currency

Each position keeps its own quote currency; fx_rate (from IB's $LEDGER-ExchangeRate ledger, local → base) yields base_value / base_unrealized_pnl. All ranking and weighting use these base-currency values — summing raw market_value across currencies would misstate the book. Rates are taken verbatim from IB, so figures reconcile with the account and work without a live market-data subscription.

Notes

  • weight and every ranking are normalized against NetLiquidation; weight is signed, so shorts carry a negative weight but are still surfaced by top_concentration via absolute value.
  • country is mapped from the listing exchange; venues outside the built-in map (or the SMART router) leave country blank rather than guessing.
  • Same clientId allows only one active Gateway connection — the shared config.yaml id is reused; close other sessions if the connect stalls.
  • Read-only guarantee: the entry script imports no order API and connects with readonly=True. Do not add a write path here.

What ships with it: 3 files

17.3 KB alongside SKILL.md, 2 of them executable

scripts/

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.