Skip to content

feat(stellar, bot): squad pool verification and /events command (Closes #475) (Closes #476) - #718

Open
CollinsKRO wants to merge 3 commits into
mimir-stellar:mainfrom
CollinsKRO:feat/issues-475-476
Open

CollinsKRO wants to merge 3 commits into
mimir-stellar:mainfrom
CollinsKRO:feat/issues-475-476

Conversation

@CollinsKRO

Copy link
Copy Markdown

Implements upstream issues #475 and #476.

#475 — feat(stellar): reconstruct squad pools and verify resolved totals

  • Adds src/stellar/squad-pools.ts: a pure, bounded reducer tracking per-market, per-side pool balances from deposited/withdrawn events.
  • On resolved, compares reconstructed pools with poolA/poolB and emits a mismatch record (market id + expected/observed values) when they differ.
  • Markets whose creation was never observed are marked unverifiable instead of mismatched.
  • tests/squad-pools.test.mjs covers matching, mismatching, partially observed markets, and bounded eviction.

#476 — feat(bot): add an /events command listing recent notifications

  • Adds src/notifications/recent.ts: a bounded ring buffer of delivered events fed by one call after successful sends.
  • Adds src/commands/events.ts: /events command rendering the last N (default 10, max 30) as one-line summaries with explorer links, supporting /events market|squad filtering and chat allowlist; output split via splitTelegramMessage.
  • Wires /events into the command registry and records delivered events in the poller after successful sends.
  • tests/events-command.test.mjs covers buffer eviction, filtering, and rendering.

Verification

  • tsc --noEmit (typecheck): clean
  • tsc (build): clean
  • New + bot-area tests: 67/67 passing
  • lockfile:check: ok
  • scan:secrets: no findings in new files (the single pre-existing finding in tests/pre-commit-scan.test.mjs predates this branch)

Closes #475
Closes #476

mimir-stellar#475) (Closes mimir-stellar#476)

Add a bounded squad-pool reducer (src/stellar/squad-pools.ts) that
reconstructs per-market, per-side pool balances from deposited/withdrawn
events and verifies them against the poolA/poolB reported by resolved
events, flagging mismatches and marking unobserved markets unverifiable.

Add a bounded recent-events ring buffer (src/notifications/recent.ts)
fed after successful sends, and an /events command
(src/commands/events.ts) rendering the last N notifications as one-line
summaries with explorer links, supporting market|squad filtering and
chat allowlist, with output split via splitTelegramMessage.

Wires /events into the command registry and records delivered events in
the poller after successful sends. Includes tests for both features.
@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@CollinsKRO Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@enliven17

Copy link
Copy Markdown
Contributor

Hi @CollinsKRO, thank you for your contribution.

This PR is not currently in a mergeable state on GitHub, and its mergeability cannot be confirmed after recent repository updates, so I cannot merge it as-is.

Please recreate or rebase your branch from the current main branch and push an updated branch so we can review it again.

This is a mergeability/update note, not a malware finding. Once the branch is updated, we will review it again.

Thank you!

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.

feat(bot): add an /events command listing recent notifications feat(stellar): reconstruct squad pools and verify resolved totals

2 participants