fix(cache): register insider-trading/search so per-symbol harvests cache - #17
Merged
Conversation
`latest_insider_trades` is a GLOBAL feed. A caller harvesting a universe symbol by symbol reaches for `search_insider_trades` instead, and with no registry entry every one of those calls bypassed the cache entirely -- silently, since CachedClient passes unregistered methods straight through. Measured on a real harvest: ~5,900 symbols x ~12 pages x 60KB is about 4.3GB a night, against a plan that meters bytes on a rolling 20GB window. The cache was enabled and appeared to be working; it simply had no entry for the endpoint that accounted for 96% of the traffic. Registered as PAGE_WALK sharded on `symbol`, mirroring the global entry above it. `walk_date_field` is `filingDate` rather than `transactionDate`: Form 4 allows two business days to file, so the transaction date runs behind the feed order and would make the walk look out of sequence.
codemug
force-pushed
the
fix/cache-insider-trades-search
branch
from
August 19, 2026 09:12
b4a50a7 to
3e14337
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
CachedClientpasses unregistered methods straight through to the live API — silently.insider_trades.latest_insider_tradesis registered, butsearch_insider_tradeswas not, so any caller harvesting a universe symbol by symbol bypassed the cache entirely while appearing to use it.Found while investigating why a project with caching enabled was still burning its FMP quota.
Measured impact
Against the live API, on a real nightly harvest of ~5,900 symbols:
insider-trading/searchgrades-historicalanalyst-estimatesprofileThe starter plan meters bytes on a rolling 20 GB window. This one unregistered endpoint was 96% of the traffic.
The change
Registers
search_insider_tradesasPAGE_WALKsharded onsymbol, mirroring the globallatest_insider_tradesentry directly above it.walk_date_fieldisfilingDate, nottransactionDate: Form 4 allows two business days to file, so the transaction date runs behind the feed's own ordering and would make the walk look out of sequence.Tests
Adds
test_insider_trades_search_registered, alongside the existing entry's test. Fulltests/test_cachedclient/suite passes (105 passed).🤖 Generated with Claude Code