Security resolver and health checker #2281

Merged
zachgoll merged 7 commits from zachgoll/security-resolver into main 2025-05-23 00:43:24 +08:00
zachgoll commented 2025-05-22 22:45:41 +08:00 (Migrated from github.com)

The Maybe app has to import prices for thousands of unique market securities. This includes stocks, bonds, mutual funds, etfs, options, and more. Furthermore, these securities are being added to the Maybe app from multiple sources (users, market data provider, Plaid, etc.)

Due to the dynamic nature of marketable securities, this PR adds a "Resolver" and "Health Checker" to ensure that the security prices we're using for calculating historical account values is as accurate as possible.

There are three primary concepts in the Securities domain:

  1. Resolver - how we build and save unique securities in the Maybe DB (ultimately, a "cache layer")
  2. MarketDataImporter - a daily process that pulls in market prices for known securities
  3. HealthChecker - a daily process that checks the health of each security and marks securities as "offline" given a consecutive group of failures to fetch prices

These three concepts are complementary to each other. The Resolver and HealthChecker are responsible for improving securities data, while MarketDataImporter assumes the data is good and pulls in all the prices it can.

The Maybe app has to import prices for thousands of unique market securities. This includes stocks, bonds, mutual funds, etfs, options, and more. Furthermore, these securities are being added to the Maybe app from multiple sources (users, market data provider, Plaid, etc.) Due to the dynamic nature of marketable securities, this PR adds a "Resolver" and "Health Checker" to ensure that the security prices we're using for calculating historical account values is as accurate as possible. There are three primary concepts in the Securities domain: 1. `Resolver` - how we build and save unique securities in the Maybe DB (ultimately, a "cache layer") 2. `MarketDataImporter` - a daily process that pulls in market prices for known securities 3. `HealthChecker` - a daily process that checks the health of each security and marks securities as "offline" given a consecutive group of failures to fetch prices These three concepts are complementary to each other. The `Resolver` and `HealthChecker` are responsible for **improving securities data**, while `MarketDataImporter` assumes the data is good and pulls in all the prices it can.
Sign in to join this conversation.