{
  "id": 3361443,
  "title": "Modeling three markets (BR / US / Crypto) with one rebalancing engine",
  "url": "https://urgent.news/2026/08/25/modeling-three-markets-br-us-crypto-with-one-rebalancing-engine",
  "topic": "finance",
  "section": "Finance & Markets",
  "published": "2026-08-25T22:01:13.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/diegocard117/modeling-three-markets-br-us-crypto-with-one-rebalancing-engine-4jkd"
  },
  "original_language": "en",
  "account": "The Balance portfolio rebalancing app, developed by a single developer, unifies three distinct markets - Brazil, the US, and cryptocurrencies - using a single rebalancing engine. The app simplifies the development process by sharing most of its domain logic across all markets.\n\nThe core of the application lies in a single field: `market`. This field determines all market-specific variations. The rebalancing engine remains untouched, while price fetching, form validation, quantity precision, and display renderings adapt based on the selected market.\n\nThe three markets differ primarily in four areas: price source, currency symbol, tax rules, and quantity precision. The price fetching varies depending on the market, utilizing BRAPI, Yahoo, or Binance for cryptocurrency prices. Currency symbols are R$ for Brazil, $ for the US, and none for crypto. Tax rules and quantity precision differ between markets as well.\n\nThe rebalancing engine checks the market only when handling whole-share assumptions in cryptocurrency trading. The rest of the engine operates uniformly, ensuring that all markets share the same rebalancing logic.\n\nIn short, Balance's multi-market functionality arises from a single variable, `market`, which controls price routing, market-aware forms, quantity precision, and display rendering. The rebalancing engine, however, remains a consistent, shared component across all markets.",
  "summary": "Part of a series on building Balance , a portfolio rebalancing app, as a solo developer. Balance started as a Brazilian-only app: B3 tickers, prices in reais, Brazilian income tax. Then came US stocks. Then crypto. The naïve path would have been three apps glued together — three price fetchers, three sets of forms, three rebalancing engines. Instead, the whole thing pivots on a single field:…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}