Skip to content

fix: improve signal accuracy and optimize tweet ingestion#17

Open
Anniew31 wants to merge 1 commit into
MusashiBot:mainfrom
Anniew31:fix/signal-logics
Open

fix: improve signal accuracy and optimize tweet ingestion#17
Anniew31 wants to merge 1 commit into
MusashiBot:mainfrom
Anniew31:fix/signal-logics

Conversation

@Anniew31
Copy link
Copy Markdown

Changes:
Bug A — sentiment-analyzer.ts:18 — keywords 'will happen' and 'going to' were in BULLISH_KEYWORDS but the analyzer tokenizes text word-by-word. Can't be matched to so got rid of a word to make exactly one word long
Bug B — sentiment-analyzer.ts:56 — negation skips through modifiers. "not very bullish" → prevWord of "bullish" is "very" so the "not" two positions back was invisible and the phrase scored as bullish. Fixed to scan 2 words back, skipping modifiers when determining negation.
Bug C — signal-generator.ts:175 — HOLD threshold out of sync with bot cofig generateSuggestedAction returned HOLD for edge < 0.10, while the bot's
default BOT_MIN_EDGE=0.05 and computeUrgency labelled 0.05–0.10 as
"medium urgency" Lowered threshold to 0.05 to match.
Bug D — kalshi-client.ts:168 — all-time volume as 24h fallback
volume24h: km.volume_24h ?? km.volume ?? 0 fell back to km.volume, which
is Kalshi's total lifetime volume. Changed to use 0 when volume_24h is absent.
Bug E — api/cron/collect-tweets.ts — sequential KV writes
storeTweet was called with await inside a for...of loop, blocking on each write before processing the next tweet. Changed to collect AnalyzedTweet objects into an array first, then fire all writes in parallel with Promise.allSettled(tweetsToStore.map(storeTweet)).
Bug G — src/analysis/keyword-matcher.ts — emojis double-counted so a single emoji like 🚀 contributes 2 to emojiCount. That meant the threshold was triggered at 8 emojis. Fixed by replacing the regex with [...text].filter(c => (c.codePointAt(0) ?? 0) > 0xFFFF).length which made each emoji count as 1. Also Adjusted the threshold to 8 to keep behavior same

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

@Anniew31 is attempting to deploy a commit to the Victor's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant