https://github.com/otwieracz/portfel-rs
portfel-rs is a Rust command-line tool built for managing a simple, long-term investment portfolio. Given a set of positions with target allocation percentages, it computes the optimal amounts to invest in each position so that the portfolio stays balanced. The portfolio is defined in a YAML file that the user edits by hand, keeping the workflow transparent and the data fully under the user’s control.
The core feature is the invest command, which simulates how a given amount of new capital should be distributed across positions to bring the portfolio as close to its target allocation as possible. It does not modify the portfolio file; it simply shows what to buy and how much per position and per investment group. The show command displays the current state of the portfolio, including each position’s actual vs. target weight.
portfel-rs integrates with the XTB broker API, allowing it to automatically fetch current position values instead of requiring manual entry. Positions held in XTB-linked groups have their amounts pulled directly from the broker. For positions outside XTB, values are maintained manually in the YAML file. The tool handles multiple currencies across groups, making it practical for portfolios spread across different brokers and accounts.