Skip to content

feat(stellar): cache transaction fee estimates - #2138

Open
code-0-stella wants to merge 1 commit into
EarnQuestOne:mainfrom
code-0-stella:feat/1980-cache-fee-estimates
Open

feat(stellar): cache transaction fee estimates#2138
code-0-stella wants to merge 1 commit into
EarnQuestOne:mainfrom
code-0-stella:feat/1980-cache-fee-estimates

Conversation

@code-0-stella

Copy link
Copy Markdown

feat(stellar): cache transaction fee estimates

Summary

This change reduces the latency of the Stellar payout hot path by caching network fee estimates and reusing them across repeated submissions.

What changed

  • Added a short-lived in-memory cache for transaction fee estimates.
  • Reused the cached estimate in both the Soroban approval flow and payment submission flow.
  • Added regression coverage to verify repeated payments reuse the cached fee.
  • Added a lightweight benchmark script and documentation for the change.

Why

Fee estimation was being queried repeatedly during payout-related transaction submission, adding avoidable overhead to the hot path. Caching the latest network fee estimate lowers that cost while still allowing refreshes on a short TTL.

Verification

  • Targeted Stellar unit tests passed:
    • npx jest src/modules/stellar/stellar.service.spec.ts --runInBand
  • Benchmark output showed:
    • Approximately 12.5% lower elapsed time
    • Approximately 1.24x higher throughput for the cached path

Closes: #1980

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@code-0-stella 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

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

kindly resolve conflict

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.

Precompute and cache transaction fee estimates

3 participants