Skip to content

feat(treasury): add automated fee sweep service with daily cron and t… - #39

Merged
GoSTEAN merged 1 commit into
GruftNet:mainfrom
BernardOnuh:feat/treasury-sweep
Jun 20, 2026
Merged

feat(treasury): add automated fee sweep service with daily cron and t…#39
GoSTEAN merged 1 commit into
GruftNet:mainfrom
BernardOnuh:feat/treasury-sweep

Conversation

@BernardOnuh

Copy link
Copy Markdown
Contributor

Description

Implements automated Treasury fee sweep service for daily and threshold-based sweeps.

Related Issue

Closes #28

Changes

  • TreasuryService with retry logic (3 attempts, exponential backoff)
  • Daily cron at 02:00 UTC + 10-minute threshold checks
  • treasury_sweeps table for full audit trail
  • Sentry alerting on 3 consecutive failures
  • Idempotency checks to prevent duplicates

Type of Change

  • New feature

…hreshold trigger

Implements TreasuryService, treasury_sweeps table, exponential backoff
retry, and Sentry alerting on 3 consecutive failures.

- TreasuryService with getTreasuryBalance() and sweepTreasury() methods
- Daily cron (0 2 * * *) and 10-minute threshold balance checks
- Exponential backoff retry: 1s, 2s, 4s before alerting
- treasury_sweeps table for full audit trail
- Sentry captureException on 3 consecutive failures
- Idempotency check to prevent duplicate sweeps
- Complete unit test coverage with 20+ test cases

Closes GruftNet#28
@GoSTEAN
GoSTEAN merged commit c16e57d into GruftNet:main Jun 20, 2026
1 check failed
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