Skip to content

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • Remove 1-confirmation requirement from checkTransferCompletion() for Bitcoin
  • Exchange withdrawals (e.g., Binance) now complete as soon as TX is in mempool
  • Buy payouts can be created immediately, potentially in the same block

Why this works

All prerequisites are already in place:

  • getBalance() includes untrusted_pending (unconfirmed external UTXOs)
  • sendMany() uses include_unsafe: true for coin selection
  • CPFP fee multiplier is active when spending unconfirmed UTXOs

Expected improvement

~10-15 minutes faster buy payouts after exchange withdrawals.

Before: Withdrawal → wait for block → Pipeline Complete → next block → Payout
After: Withdrawal → Pipeline Complete → same block → Payout (CPFP effect)

Test plan

  • Monitor next Binance→Bitcoin withdrawal
  • Verify liquidity_management_order completes immediately (before block confirmation)
  • Verify buy payouts occur in same block as withdrawal on mempool.space

Remove the confirmation requirement from checkTransferCompletion().
Previously, Bitcoin withdrawals from exchanges (e.g., Binance) had to
wait for 1 blockchain confirmation before the liquidity pipeline could
continue and trigger buy payouts.

Now, as soon as the withdrawal TX is visible in the mempool, the
pipeline completes and buy payouts can be created immediately.

This works because:
- getBalance() already includes untrusted_pending (unconfirmed external)
- sendMany() already uses include_unsafe: true for coin selection
- CPFP fee multiplier is active for unconfirmed UTXOs

Expected improvement: Buy payouts can occur in the same block as the
exchange withdrawal instead of the next block (~10-15 min faster).
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

🤖 PR Review Bot

⚠️ Security: 0 critical, 67 high vulnerabilities


This is an automated review. Please address the issues above.

@TaprootFreak TaprootFreak merged commit ba2db42 into develop Jan 9, 2026
6 checks passed
@TaprootFreak TaprootFreak deleted the feature/bitcoin-0-conf-withdrawal-completion branch January 9, 2026 07:48
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.

3 participants