Skip to content

fix: check the platform wallet can pay before building a payout batch - #185

Merged
Benzilla merged 1 commit into
mainfrom
fix/payout-wallet-checks
Nov 24, 2026
Merged

Benzilla merged 1 commit into
mainfrom
fix/payout-wallet-checks

Conversation

@Benzilla

Copy link
Copy Markdown
Contributor

Description

Building a batch now refuses, with a clear error and the payouts left pending, when the platform wallet:

  • is itself a payout destination
  • holds less USDC than the batch total (402 insufficient_funds)
  • has too little SOL for the fee plus rent for new token accounts

The sender's wallet and USDC account are read in the same getMultipleAccountsInfo call as the recipients, so this adds no RPC requests. Previously these batches were signed, rejected by Solana's preflight, and recorded as failed payouts.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation

How Was This Tested?

  • Unit tests
  • Integration tests
  • Manual testing

Checklist

  • Self-reviewed my code
  • No new warnings
  • Existing tests still pass
  • Breaking changes are documented above

Building a batch now refuses, with a clear error and the payouts left
pending, when the platform wallet:

- is itself a payout destination
- holds less USDC than the batch total (402 insufficient_funds)
- has too little SOL for the fee plus rent for new token accounts

The sender's wallet and USDC account are read in the same
getMultipleAccountsInfo call as the recipients, so this adds no RPC
requests. Previously these batches were signed, rejected by Solana's
preflight, and recorded as failed payouts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Benzilla
Benzilla merged commit 735c5bf into main Nov 24, 2026
5 checks passed
@Benzilla
Benzilla deleted the fix/payout-wallet-checks branch November 24, 2026 16:37
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