Founder · solo build (API + Web) · 6 months. My first product - the engineering foundation and lessons I carried straight into Batameta. Retail investors rebalance by feel, miss dividend dates and have no clear read on real performance. Finlog is the copilot: it tells you exactly what to buy to get back to your target allocation, when and how much you'll receive in dividends, and how your portfolio is actually doing. The interesting engineering isn't the dashboard - it's the resilience layer that keeps the numbers trustworthy when the upstream market-data APIs misbehave.
What it solves
Most retail investors can't answer three basic questions with confidence: am I still aligned with my target allocation, when and how much will I receive in dividends, and is my portfolio actually performing? Finlog answers all three and turns the first into an action - 'to get back to target with the money you have, buy this.'
The rebalancing engine
A strategy-based engine (threshold, calendar or hybrid) takes your current positions and your target allocation - including nested allocations (a class that splits into sub-allocations that split into individual assets) - and computes exactly what to do. It's contribution-aware: given the cash you have to deploy, it prioritizes buys by cost-benefit, respects tradeable lot sizes, and can factor in transaction fees and tax impact.
The hard part: trusting other people's APIs
A finance product is only as trustworthy as its market data, and that data comes from third-party APIs that rate-limit, go down and occasionally return malformed garbage in production. Finlog pulls from three sources: BRAPI and HG Brasil for quotes and dividends, and the Banco Central (BCB) directly for the CDI, SELIC and IPCA series that underpin all Brazilian fixed-income math.
Never letting flakiness reach the user
Circuit breakers per series, rate and concurrency limiters in front of the Central Bank calls, automatic fallback to a secondary endpoint with exponential backoff, and three-layer caching: in-memory for the slow-moving BCB series, Redis for quotes and dividends, and a PostgreSQL table that persists historical Central Bank series so the same data is never fetched twice. A response sanitizer guards against known bad payloads. When an upstream hiccups, the user sees yesterday's correct number, not today's wrong one.
Dividend forecasting
A daily cron publishes a job per wallet onto RabbitMQ; consumers reconcile dividend history from the providers against each user's actual positions and generate income records. Fixed-income instruments get full cashflow projections driven by the BCB SELIC/CDI series, so the user sees not just what they hold but when and how much it pays.
- Why three data sources instead of one?Redundant providersSingle-sourcing market data is a single point of failure for a product whose whole value is correct numbers. When one provider fails or disagrees, the others keep the figures honest.
- Why pull the Central Bank directly?BCB SGS at the sourceCDI, SELIC and IPCA are the backbone of Brazilian fixed-income math. Going to the source beats trusting a reseller, and the series rarely change - which is exactly what makes them safe to cache hard.
- Why a three-layer cache + persisted BCB series?Memory + Redis + PostgreSQLOfficial series rarely change, so persisting them makes the app fast and resilient and cuts upstream API load to near zero. Quotes get a short Redis TTL; the slow-moving central-bank data gets persisted once and reused.
- Why circuit breakers + fallback?Resilience over raw freshnessThe resilience layer is what separates a finance product people trust from a dashboard that shows wrong numbers the moment an upstream hiccups. A stale-but-correct number always beats a fresh-but-wrong one.
A solo build, live (my first product, six months end-to-end): a rebalancing engine with nested allocations, dividend forecasting driven by the Central Bank rate series, and a resilience layer (circuit breakers, fallback, three-layer cache) over three market-data sources - so the numbers stay trustworthy even when the upstream doesn't.