Skip to content

feat(#547): add LedgerCloseEstimator with rolling-average calibration - #596

Merged
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
Ebuka042-pixel:feature/547-ledger-close-estimator
Jul 30, 2026
Merged

feat(#547): add LedgerCloseEstimator with rolling-average calibration#596
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
Ebuka042-pixel:feature/547-ledger-close-estimator

Conversation

@Ebuka042-pixel

Copy link
Copy Markdown
Contributor
  • Add src/ledgerCloseEstimator.ts with LedgerCloseEstimator class
    • calibrate(sampleSize) fetches last N ledgers from Horizon
    • computes rolling-average close interval in ms
    • estimateCloseTime(targetLedger) returns projected Date
    • estimateLedgerAtTime(targetTime) returns projected ledger seq
    • auto-recalibrates every calibrationIntervalMs (default 5 min)
  • Integrate into src/deadlineEngine.ts: estimateDeadlineFromLedger()
  • Integrate into src/txBuilder.ts: setLedgerEstimator() + expiresAtFromLedger()
  • Export from src/index.ts
  • Add unit tests in test/ledgerCloseEstimator.test.ts

closes #547
closes #548
closes #549
closes #550

…e calibration

- Add src/ledgerCloseEstimator.ts with LedgerCloseEstimator class
  - calibrate(sampleSize) fetches last N ledgers from Horizon
  - computes rolling-average close interval in ms
  - estimateCloseTime(targetLedger) returns projected Date
  - estimateLedgerAtTime(targetTime) returns projected ledger seq
  - auto-recalibrates every calibrationIntervalMs (default 5 min)
- Integrate into src/deadlineEngine.ts: estimateDeadlineFromLedger()
- Integrate into src/txBuilder.ts: setLedgerEstimator() + expiresAtFromLedger()
- Export from src/index.ts
- Add unit tests in test/ledgerCloseEstimator.test.ts
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Ebuka042-pixel 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

@Kingsman-99
Kingsman-99 merged commit 797a8fb into Stellar-split:main Jul 30, 2026
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.

Invoice Version History Diff Tracker Escrow Vault Payment Manager Token-Gated Invoice Access Controller Ledger Close Time Estimator

2 participants