Skip to main content
Glama
ofm-rebalancing-flow

ofm-rebalancing-flow

by fmadzharov

Rebalancing Flow — Public API Client, Agent Skills & Read-Only MCP Server

fmadzharov/ofmcapital-rebalancing-flow-public MCP server

Public developer kit for Rebalancing Flow by OFM Capital (OFM Capital Partners, Sofia, Bulgaria · founded 2012 · LEI 2549009QAP6LUK11FL26), built by founder and portfolio manager Filip Madzharov, CAIA and the OFM Capital desk.

Rebalancing Flow tracks day-by-day reported holdings changes across 15 US-listed preferred-stock ETFs (PFF, PGX, FPE, PFFA, PFFD, PFXF, VRP, PGF, PFFV, SPFF, FPEI, PSK, PREF, PFFR, EPRF), exposing a free, read-only, no-API-key JSON API (https://rebalancingflow.ofmcapital.com/openapi.json).

Scope of this repository: This repository contains public client code, agent instructions (AGENTS.md, CLAUDE.md, GEMINI.md, SKILL.md), a read-only MCP server wrapper, a Google Colab notebook, OpenAPI specs, and an OFM-derived summary sample CSV (tickers and OFM IDs only, no CUSIPs/ISINs). It does not contain private infrastructure, scrapers, or trading strategies.


5 Questions You Can Answer in 10 Seconds

Note on User-Agent, compression & rate limits: Always send an identifying User-Agent header (e.g., OFM-RebalancingFlow-Client/1.0) and Accept-Encoding: gzip. Default Python-urllib user-agents receive HTTP 403 (edge code 1010) on HTML pages (/, /etfs/*, /instruments/*, /how-it-works), whereas JSON API endpoints (/api/desk/*) enforce burst throttling (429 with Retry-After) and return 503 with Retry-After while a publication refreshes. The bundled Python client and MCP server handle gzip decompression and Retry-After backoff automatically.

1. Which preferred-stock ETFs are tracked and what is their latest holdings date?

curl -sS -A "OFM-RebalancingFlow-Client/1.0" \
  "https://rebalancingflow.ofmcapital.com/api/desk/meta" | jq '.etfs[] | {symbol, issuer, latest: .dates[0]}'

2. What changed in PFF on the most recent holdings date?

curl -sS -A "OFM-RebalancingFlow-Client/1.0" \
  "https://rebalancingflow.ofmcapital.com/api/desk/activity?etf=PFF&limit=10"

3. Which preferred-stock ETFs currently hold a specific preferred stock (e.g. BAC series)?

curl -sS -A "OFM-RebalancingFlow-Client/1.0" \
  "https://rebalancingflow.ofmcapital.com/api/desk/instruments?q=BAC&limit=10"

4. What were the largest estimated flow-adjusted net increases and decreases over a period (example: Nov 2026)?

curl -sS --compressed -A "OFM-RebalancingFlow-Client/1.0" \
  "https://rebalancingflow.ofmcapital.com/api/desk/period?start=2026-11-01&end=2026-11-27"

(Period rankings report OFM's flow-adjusted choice estimates for exchange-listed securities separately from $1,000-par otc changes.)

5. What is today's cross-ETF daily brief across all 15 funds?

curl -sS -A "OFM-RebalancingFlow-Client/1.0" \
  "https://rebalancingflow.ofmcapital.com/api/desk/brief"

Related MCP server: pequod-mcp

Python Quickstart (Zero External Dependencies)

from examples.rebalancing_flow_client import RebalancingFlowClient

client = RebalancingFlowClient()
meta = client.meta()
print("Revision:", meta["revision"], "| Expected date:", meta["expected_date"])

brief = client.brief()
print("Latest cross-ETF brief day:", brief["day"], "| Funds compared:", brief["funds_compared"])
print("Brief cite:", client.brief_citation_url(brief["day"]))

pff = client.activity(etf="PFF", limit=5)
print("PFF day:", pff["day"], "| Decreases:", pff["decrease_count"], "| Increases:", pff["increase_count"])
print("Cite:", client.etf_citation_url("PFF", pff["day"]))  # includes &tab=changes

Run the built-in CLI demo:

python examples/rebalancing_flow_client.py

Use with AI Coding & Research Agents

Ecosystem

How to connect

File in this repo

OpenAI Codex

Clone repo or copy skill into .agents/skills/

AGENTS.md, .agents/skills/ofm-rebalancing-flow/SKILL.md

Claude Code / Claude Desktop

Copy skill into .claude/skills/ or register MCP server

CLAUDE.md, .claude/skills/ofm-rebalancing-flow/SKILL.md

Google Antigravity & Gemini CLI

gemini extensions install <repo-url> or register MCP server

GEMINI.md, gemini-extension.json

Any MCP Client

Run python mcp-server/ofm_rebalancing_flow_mcp.py (stdio)

mcp-server/ofm_rebalancing_flow_mcp.py, mcp-server/server.json

Read-Only MCP Server (Zero Dependencies)

This repository includes .mcp.json for project-local MCP discovery (configured with python for Windows/cross-platform portability; use python3 on macOS/Linux if python is not on your PATH) and replace /ABS/PATH/TO/ofmcapital-rebalancing-flow-public with your local clone path for global configs.

Claude Desktop / Cursor / Antigravity (JSON):

{
  "mcpServers": {
    "ofm-rebalancing-flow": {
      "command": "python",
      "args": ["/ABS/PATH/TO/ofmcapital-rebalancing-flow-public/mcp-server/ofm_rebalancing_flow_mcp.py"]
    }
  }
}

OpenAI Codex (~/.codex/config.toml):

[mcp_servers.ofm-rebalancing-flow]
command = "python"
args = ["/ABS/PATH/TO/ofmcapital-rebalancing-flow-public/mcp-server/ofm_rebalancing_flow_mcp.py"]

Tools exposed (100% read-only, User-Agent OFM-RebalancingFlow-MCP/1.1, strict public field allowlists — zero CUSIPs/ISINs/SEDOLs):

  • list_etfs — Lists all 15 tracked preferred-stock ETFs, issuers, latest dates, date verification, freshness status, and full publication revision.

  • get_etf_changes — Daily reported holdings increases, decreases, additions, removals, and coverage (on_selected_date, latest_available_date, prior_date, date_verification, freshness_status) with an explicit no_filing_on_requested_date warning when no filing exists on the requested date.

  • find_instrument — Search preferred stocks and baby bonds by ticker or issuer and inspect compact cross-ETF holdings (OFM IDs, vetted tickers, OpenFIGI where available).

  • get_period_summary — Multi-day/monthly flow_adjusted_choice_estimate rankings, separate $1,000-par otc summary, investor flows, exits, and date-verification notes.

  • get_daily_brief — Cross-ETF daily summary across all 15 preferred-stock ETFs (citing /?date=YYYY-MM-DD).

Every MCP tool response (including errors) embeds an explicit citation_url (/?date=... for daily briefs, /etfs/<SYM>?date=...&tab=changes for ETF changes) and methodology caveat.


Interactive Notebook & OFM-Derived Sample CSV

  • Jupyter / Google Colab Notebook: notebooks/pff_vs_pgx_overlap.ipynb — Compares PFF vs PGX holdings overlap on their latest common holdings date and lists top current-month flow-adjusted choice estimates using the live API with gzip and Retry-After handling.

  • OFM-Derived Sample CSV: data/sample_derived_changes_2026_11.csv — Derived top November 2026 flow-adjusted choice estimates pinned to a recorded dataset_revision, compared_through_date, date_verification, and metric_basis using OFM instrument_id and ticker labels only (zero third-party CUSIPs, ISINs, SEDOLs, or raw issuer holdings files).


Methodology, Licensing & Disclaimers

  • Holdings diffs, not trade records: A change in a holding is the difference between two published issuer holdings files, not proof of an executed market trade. Holdings also change from ETF share creations/redemptions, issuer redemptions/calls, corporate actions, or issuer file corrections.

  • Keep data-quality flags: Always preserve date_basis, date_verification, date_notes, quantity_unit, and null (which means unavailable, never zero) when quoting Rebalancing Flow data.

  • Not investment advice: Published strictly for factual market-structure research. Nothing here or on Rebalancing Flow is investment advice, a recommendation, or an offer of any kind.

  • Licensing:

    • Client code, MCP server, notebook, and skills in this repository: MIT License (LICENSE).

    • OFM Capital's derived analysis, methodology text, and derived summary tables: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Issuer raw holdings files belong to their respective fund issuers.

  • Citation: OFM Capital, Rebalancing Flow, https://rebalancingflow.ofmcapital.com/ (see CITATION.cff).


About OFM Capital

OFM Capital (legal name OFM Capital Partners, LEI 2549009QAP6LUK11FL26) is an independent proprietary trading desk in Sofia, Bulgaria, trading US fixed income (preferred stocks, baby bonds, perpetuals, corporate bonds, Treasuries) and US equities (including CEFs, BDCs, and mREITs) exclusively with its own capital since 2012.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server providing complete US ETF holdings from SEC EDGAR N-PORT filings and identifier crosswalk tools (ticker, CUSIP, FIGI) for AI agents.
      5
      Apache 2.0
    • A
      license
      A
      quality
      A
      maintenance
      Correlation, ETF holdings overlap, beta, volatility and diversifiers for 4,700+ US stocks and ETFs, any of 11.3M pairs. Free API, no key, read-only.
      6
      559 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying SEC Form N-PORT data to find which mutual funds and ETFs hold a given security, view a fund's reported portfolio positions, and check data coverage and scope.
      61 npm
      MIT