Repository: https://github.com/chirindaopensource/cooperative_transaction_cost_mitigation
Owner: 2026 Craig Chirinda (Open Source Projects)
This repository contains an independent, professional-grade Python implementation of the research methodology from the 2026 paper entitled "A Distributed Method for Cooperative Transaction Cost Mitigation" by:
- Nikhil Devanathan
- Logan Bell
- Dylan Rueter
- Stephen Boyd
The project provides a complete, end-to-end computational framework for replicating the paper's findings. It delivers a modular, highly optimized pipeline that executes the entire research workflow: from the ingestion and cleansing of raw market data to the econometric simulation of synthetic alpha signals, culminating in the rigorous execution of a privacy-preserving, distributed convex optimization protocol that mitigates institutional market impact.
- Introduction
- Theoretical Background
- Features
- Methodology Implemented
- Core Components (Notebook Structure)
- Key Callable:
run_distributed_cooperative_optimization_pipeline - Prerequisites
- Installation
- Input Data Structure
- Usage
- Output Structure
- Project Structure
- Customization
- Contributing
- Recommended Extensions
- License
- Citation
- Acknowledgments
This project provides a Python implementation of the analytical framework presented in Devanathan, Bell, Rueter, and Boyd (2026). The core of this repository is the iPython Notebook cooperative_transaction_cost_mitigation_draft.ipynb, which contains a comprehensive suite of 35+ orchestrated tasks to replicate the paper's findings.
The pipeline addresses a critical "tragedy of the commons" in multi-manager quantitative hedge funds: individual Portfolio Managers (PMs) optimize their sleeves independently, but their aggregated trades incur non-linear market impact costs that erode firm-wide returns. Solving this centrally requires PMs to divulge their proprietary alpha models and constraints, which violates institutional privacy firewalls.
The codebase operationalizes the proposed solution:
- Simulates a realistic market environment using a low-rank factor risk model and a VAR(1) noise process calibrated to specific Information Coefficients (IC).
- Models execution friction using a rigorous 3/2-power transaction cost function.
- Coordinates autonomous PMs using the Alternating Direction Method of Multipliers (ADMM), broadcasting a synthetic "tax/subsidy" signal that internalizes the firm's marginal execution costs.
- Evaluates the protocol via a 25-year walk-forward backtest, demonstrating that just 5 iterations of ADMM can capture ~75% of the savings of a fully centralized (but privacy-violating) joint optimization.
The implemented methods combine techniques from Distributed Convex Optimization, Market Microstructure, and Financial Econometrics.
1. The Joint Firm Problem:
The theoretical optimum minimizes the NAV-weighted sum of PM objectives plus the aggregate transaction costs on the net trade
2. Non-Linear Transaction Cost Modeling:
The pipeline implements the 3/2-power model, accounting for both fixed bid-ask spreads and temporary market impact scaled by volatility
3. The ADMM Protocol (Algorithm 1):
To decouple the joint problem, the Central Planner broadcasts a sharing signal
4. Econometric Simulation (VAR(1) Alpha): To test the protocol, synthetic alphas are generated using a stationary Vector Autoregressive process, calibrated via the discrete-time Lyapunov equation: $$ E_t = \Phi E_{t-1} + U_t \quad \text{where} \quad \Sigma_E = \Phi \Sigma_E \Phi^T + \Sigma_U $$
Below is a diagram which summarizes the proposed approach:
The provided iPython Notebook (cooperative_transaction_cost_mitigation_draft.ipynb) implements the full research pipeline, including:
-
Disciplined Convex Programming: Utilizes
CVXPYto construct and solve complex PM local objectives featuring leverage, concentration, shorting, and turnover constraints. -
Factored Risk Constraints: Implements the risk constraint $|\Sigma^{1/2}w|2 \le \sigma{\text{target}}$ using a highly optimized stacked vector approach
$y = [F^T w; \text{diag}(\sqrt{D^{\text{idio}}}) w]$ to avoid forming dense$N \times N$ covariance matrices. -
Configuration-Driven Design: All study parameters (hyperparameters, institutional limits, econometric targets) are managed in an external, cryptographically hashed
config.yamlfile. - Rigorous State Isolation: Employs deep-copying and strict object immutability to ensure that the endogenous state trajectories of the four compared protocols (Independent, Cooperative, ADMM-2, ADMM-5) never contaminate each other during the walk-forward simulation.
-
Cryptographic Archival: Automatically serializes all artifacts (Parquet, JSON, NPZ) and generates an immutable
.tar.gztarball with a master SHA-256 fingerprint for absolute reproducibility.
The core analytical steps directly implement the methodology from the paper:
-
Data Engineering (Tasks 1-14): Ingests raw market data, applies structural filters, forward-fills missing prices, constructs the
$N=434$ asset universe based on end-of-sample market cap, and computes daily dollar volumes and forward returns. -
Risk & Alpha Modeling (Tasks 15-21): Estimates a
$J=15$ low-rank factor covariance matrix, solves the Lyapunov equation using Kronecker properties, and simulates VAR(1) noise paths to generate synthetic alphas calibrated to specific IC targets. -
Parameterization (Tasks 22-23): Dynamically computes the endogenous market impact coefficients
$\kappa_{\text{impact},t}$ and the ADMM scaling matrix$D_t^{\text{scale}}$ at each time step. - Optimization Solvers (Tasks 24-29): Defines the CVXPY closures for the independent PM problem, the massive centralized cooperative problem, and the iterative ADMM distributed updates.
- Walk-Forward Simulation (Tasks 30-32): Executes the daily rebalancing loop, rigorously accounting for post-trade weight drift, cash returns, and transaction cost attribution.
- Evaluation & Archival (Tasks 33-35): Computes annualized performance metrics, verifies the manuscript's qualitative claims regarding PM-level outcomes, and freezes the research archive.
The notebook is structured as a logical pipeline with modular orchestrator functions for each of the 35 major tasks. All functions are self-contained, fully documented with type hints and docstrings, and designed for professional-grade execution.
The project is designed around a single, top-level user-facing interface function:
run_distributed_cooperative_optimization_pipeline: This master orchestrator function runs the entire automated research pipeline from end-to-end. A single call to this function reproduces the entire computational portion of the project, managing data validation, econometric simulation, convex optimization, and deterministic state reconstruction.
- Python 3.9+
- Core dependencies:
pandas,numpy,scipy,cvxpy,pyyaml. - Recommended Solver:
mosek(requires license) orscs/ecos(open-source alternatives supported via config).
-
Clone the repository:
git clone https://github.com/chirindaopensource/cooperative_transaction_cost_mitigation.git cd cooperative_transaction_cost_mitigation -
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Python dependencies:
pip install pandas numpy scipy cvxpy pyyaml
The pipeline requires four primary data structures, strictly validated at runtime:
raw_market_df(pd.DataFrame): A MultiIndex["date", "asset_id"]panel containingadjusted_trade_price,adjusted_bid_price,adjusted_ask_price,share_volume, andmarket_cap_usd.risk_free_rate_series(pd.Series): A DatetimeIndex series containing the 3-month U.S. Treasury Bill rate.master_trading_calendar(pd.DatetimeIndex): The canonical sequence of valid business days.asset_identifier_map(pd.DataFrame): A mapping table linking internalasset_ids to vendor tickers.
Note: The pipeline includes a synthetic data generator for testing purposes if access to proprietary LSEG/CRSP data is unavailable.
The notebook provides a complete, step-by-step guide. The primary workflow is to execute the final cell, which demonstrates how to load the configuration, generate synthetic data, and use the top-level orchestrator:
import os
import yaml
import pandas as pd
import numpy as np
# 1. Load the master configuration from the YAML file.
# (Assumes config.yaml is in the working directory)
with open("config.yaml", "r") as f:
study_config = yaml.safe_load(f)
# 2. Load raw datasets (Example using synthetic generator provided in the notebook)
# In production, load from Parquet: pd.read_parquet("lseg_market_data.parquet")
(
raw_market_df,
risk_free_rate_series,
master_trading_calendar,
asset_identifier_map
) = generate_synthetic_market_environment()
# 3. Execute the entire replication study.
pipeline_summary = run_distributed_cooperative_optimization_pipeline(
raw_market_df=raw_market_df,
risk_free_rate_series=risk_free_rate_series,
master_trading_calendar=master_trading_calendar,
asset_identifier_map=asset_identifier_map,
study_config=study_config,
output_base_dir="./institutional_research_archive"
)
# 4. Access results
if pipeline_summary.get("status") == "SUCCESS":
print("\n[*] Final Reproduction Fidelity:")
print(f" Classification: {pipeline_summary['fidelity_classification']}")
print("\n[*] Firm-Level Performance Metrics:")
firm_table = pipeline_summary["reproduction_package"]["performance_metrics"]["firm_table"]
print(firm_table.to_string())
print(f"\n[*] Archive frozen at: {pipeline_summary['archive_path']}")The pipeline returns a master dictionary containing:
manifest: The cryptographic provenance record, including environment versions, random seeds, input hashes, and all manuscript-unspecified placeholder assumptions.exogenous_artifacts: The cleansed market panel, frozen universe IDs, risk models, and synthetic alpha vectors.protocol_results: The raw historical trajectories (NAVs, trades, costs) and ADMM convergence traces for each of the four protocols.performance_metrics: The finalized firm-level and PM-level tables (Return, Volatility, Sharpe) and cumulative paths.evaluation_summary: The formal verification of the manuscript's qualitative claims regarding PM-level outcomes.
cooperative_transaction_cost_mitigation/
│
├── cooperative_transaction_cost_mitigation_draft.ipynb # Main implementation notebook
├── config.yaml # Master configuration file
├── requirements.txt # Python package dependencies
│
├── LICENSE # MIT Project License File
└── README.md # This file
The pipeline is highly customizable via the config.yaml file. Users can modify study parameters such as:
-
Institutional Constraints: Adjust leverage (
$L$ ), concentration ($C$ ), and turnover ($T$ ) limits to reflect different fund mandates. -
ADMM Hyperparameters: Tune the penalty parameter
$\rho$ or test different iteration counts ($K$ ). - Econometrics: Alter the target Information Coefficient (IC) range or the VAR(1) temporal autocorrelation to simulate different market regimes.
Contributions are welcome. Please fork the repository, create a feature branch, and submit a pull request with a clear description of your changes. Adherence to PEP 8, strict type hinting, and comprehensive docstrings is required.
Future extensions could include:
- Alternative Cost Models: Replacing the 3/2-power model with piecewise-affine or quadratic transaction cost models.
- Asynchronous ADMM: Implementing asynchronous updates where PMs solve their local problems at different frequencies.
- Live Execution Integration: Adapting the state-transition layer to ingest real-time FIX execution reports rather than simulated walk-forward accounting.
This project is licensed under the MIT License. See the LICENSE file for details.
If you use this code or the methodology in your research, please cite the original paper:
@article{devanathan2026distributed,
title={A Distributed Method for Cooperative Transaction Cost Mitigation},
author={Devanathan, Nikhil and Bell, Logan and Rueter, Dylan and Boyd, Stephen},
journal={arXiv preprint arXiv:2603.07881},
year={2026}
}For the implementation itself, you may cite this repository:
Chirinda, C. (2026). A Distributed Method for Cooperative Transaction Cost Mitigation: An Open Source Implementation.
GitHub repository: https://github.com/chirindaopensource/cooperative_transaction_cost_mitigation
- Credit to Nikhil Devanathan, Logan Bell, Dylan Rueter, and Stephen Boyd for the foundational research that forms the entire basis for this computational replication.
- This project is built upon the exceptional tools provided by the open-source community. Sincere thanks to the developers of the scientific Python ecosystem, particularly the CVXPY contributors for enabling robust Disciplined Convex Programming.
--
This README was generated based on the structure and content of the cooperative_transaction_cost_mitigation_draft.ipynb notebook and follows best practices for research software documentation.
