Handle missing weekend stock prices in sync process #1242

Merged
zachgoll merged 4 commits from 1222-bug-investment-account-balances-should-handle-missing-stock-prices-for-weekends-and-holidays into main 2024-10-05 02:19:45 +08:00
zachgoll commented 2024-10-05 00:06:14 +08:00 (Migrated from github.com)

There are a few different areas that we could potentially solve this issue:

  1. At the provider level (not a good option since we can't always control what the provider returns)
  2. At the base model level (i.e. Security::Price.find_prices)
  3. At the sync model level (i.e. Account::Holding::Syncer)

To keep the gapfill logic isolated from the base model, I've added a Gapfiller class that operates on the fetched prices directly in the sync process.

There are a few different areas that we could potentially solve this issue: 1. At the provider level (not a good option since we can't always control what the provider returns) 2. At the base model level (i.e. `Security::Price.find_prices`) 3. At the sync model level (i.e. `Account::Holding::Syncer`) To keep the gapfill logic isolated from the base model, I've added a `Gapfiller` class that operates on the fetched prices directly in the sync process.
Sign in to join this conversation.