Overview
Smart Portfolio Allocator is an interactive planning tool designed to take the manual calculation out of monthly Dollar Cost Averaging (DCA). It allows users to choose from preset strategies or create custom mixes with up to 10 holdings.
Under the hood, I built a custom allocation engine that handles real-time USD to CAD conversions, debounced live quote resolution, and precise purchase calculations.
To maximize capital efficiency, the algorithm utilizes an initial floor allocation followed by a greedy fill strategy with priority rebalancing. It explicitly shows users how many shares to buy (supporting both whole and fractional shares) and exactly how much cash remains.
What I built
Intelligent Allocation Engine
Calculates exact share quantities using a greedy fill algorithm and priority rebalancing, ensuring every dollar is put to work.
Whole & Fractional Shares
Flexible calculation modes that support both whole share constraints and fractional share purchasing.
Live Quotes & FX Polling
Integrates debounced ticker resolution and automated 5-minute polling for real-time USD/CAD exchange rates.
Preset & Custom Strategies
Enables users to quickly apply curated portfolio mixes or build custom allocations with up to 10 distinct holdings.
Results
- Engineered a custom greedy-fill allocation algorithm that optimizes leftover cash and handles cross-border (USD/CAD) pricing.
- Optimized API usage by implementing debounced quote resolution and isolated 5-minute background polling for FX rates.
