https://github.com/jialuechen/deepfolio
Diffusion-Transformer for Joint Portfolio Construction & Execution Optimization
https://github.com/jialuechen/deepfolio
attention-mechanism diffusion-models event-driven execution market-making portfolio-optimization quant-finance transformer
Last synced: 4 months ago
JSON representation
Diffusion-Transformer for Joint Portfolio Construction & Execution Optimization
- Host: GitHub
- URL: https://github.com/jialuechen/deepfolio
- Owner: jialuechen
- License: bsd-2-clause
- Created: 2024-05-24T18:30:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-23T00:01:28.000Z (5 months ago)
- Last Synced: 2025-03-09T05:12:20.651Z (4 months ago)
- Topics: attention-mechanism, diffusion-models, event-driven, execution, market-making, portfolio-optimization, quant-finance, transformer
- Language: Python
- Homepage: https://jialuechen.github.io/deepfolio/
- Size: 4.03 MB
- Stars: 103
- Watchers: 5
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![]()
[](https://tensorflow.org/)

[](https://opensource.org/licenses/BSD-2-Clause)

# **DeepFolio | Diffusion-Transformer (DiT) for Portfolio & Execution Optimization**
DeepFolio is an **OpenAI Sora-inspired Diffusion-Transformer (DiT) framework** for **joint portfolio optimization and best execution**, designed to **maximize Sharpe ratio without explicit return forecasts**. It leverages:
- **Transformer** to capture asset dependencies and encode market conditions.
- **Diffusion Models** to filter market noise and generate both **robust allocation weights** and **optimized trading trajectories**.
- **End-to-End Strategy Execution** to reduce information loss between **strategy design and execution implementation**, ensuring optimal real-world performance.---
## **🚀 Key Features**
✅ **Unified Portfolio & Execution Optimization** – Bridges the gap between portfolio construction and trade execution.
✅ **Diffusion-Based Portfolio Generation** – Generates **adaptive, robust asset allocations** without relying on explicit return forecasts.
✅ **Market-Aware Execution Path Modeling** – Uses **Diffusion Models** to optimize **execution trajectories**, reducing slippage and market impact.
✅ **Scenario-Based Adaptation** – Dynamically adjusts strategies for **high/low volatility regimes, liquidity shifts, and market anomalies**.
✅ **Transaction Cost-Aware Optimization** – Integrates **TCA (Transaction Cost Analysis)** into optimization, minimizing execution costs.---
## **📜 Architecture**
DeepFolio consists of **two core modules**:### **1️⃣ Portfolio Optimization** (Transformer + Diffusion)
- **Transformer Encoder** extracts asset relationships, learning market structure.
- **Diffusion Model** generates optimal portfolio weights, ensuring robustness under different conditions.### **2️⃣ Execution Optimization** (Trade Path Diffusion)
- **Transformer encodes market microstructure (LOB, liquidity, volatility).**
- **Diffusion Model optimizes execution paths** to minimize market impact and transaction costs.📌 **Pipeline Overview**:
## Documentation
For detailed documentation, please visit our [documentation site](https://diffopt-portfolio.readthedocs.io).
## Contributing
We welcome contributions! Please see our [contributing guidelines](CONTRIBUTING.md) for more details.
## License
This project is licensed under the BSD-2-Clause License- see the [LICENSE](LICENSE) file for details.
## Reference
[1]
Damian Kisiel, Denise Gorse (2022).
Portfolio Transformer for Attention-Based Asset Allocation
arXiv:2206.03246 [q-fin.PM]## Acknowledgments
- This package leverages the power of TensorFlow for efficient portfolio optimization.
- Thanks to the financial machine learning community for inspiring many of the implemented methods.