Skip to content

Add DDO payment token low-balance warnings#656

Merged
parkan merged 1 commit intomainfrom
feat/ddo-low-balance-warnings
Apr 2, 2026
Merged

Add DDO payment token low-balance warnings#656
parkan merged 1 commit intomainfrom
feat/ddo-low-balance-warnings

Conversation

@anjor
Copy link
Copy Markdown
Collaborator

@anjor anjor commented Apr 1, 2026

Summary

  • Adds CheckBalance method to DDODealManager interface that queries native FIL balance (for gas), payment token (USDFC) balance, and payments contract account status
  • DDO scheduler now logs wallet balance state at the start of each schedule run with structured fields (nativeFIL, paymentToken, deposited, available)
  • Emits WARN when native FIL is below 0.1 FIL (gas risk) or when both token balance and deposited funds are zero (EnsurePayments will fail)
  • Milestone 2 requirement: "provide error notifications if the balance is low or if a user attempts to make a paid deal without enough FIL"

Test plan

  • Existing DDO unit tests pass (go test ./service/dealpusher/ -run DDO)
  • Existing DDO integration tests pass (with anvil)
  • Full project go vet ./... clean
  • Manual: run deal-pusher with --ddo-contract flag and observe balance log lines

Add CheckBalance to DDODealManager interface that queries native FIL
and payment token (USDFC) balances plus payments contract account
status before DDO deal scheduling begins.

The scheduler now logs wallet balance state at the start of each DDO
schedule run, and emits warnings when:
- Native FIL is below 0.1 FIL (may not cover gas)
- Payment token balance and deposited funds are both zero
@anjor anjor requested a review from parkan April 1, 2026 14:36
@parkan
Copy link
Copy Markdown
Collaborator

parkan commented Apr 2, 2026

as much as I hate adding this to core singularity I think it's fine

@parkan parkan merged commit 0218d03 into main Apr 2, 2026
1 check passed
@parkan parkan deleted the feat/ddo-low-balance-warnings branch April 2, 2026 11:10
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.

2 participants