Skip to content

docs: explain why balances are interpolated - #379

Merged
Glittersup merged 3 commits into
TricklePay:mainfrom
Yungmon22:fix/issue-334-document-why-balances-are-interpolated-rather
Oct 4, 2026
Merged

Glittersup merged 3 commits into
TricklePay:mainfrom
Yungmon22:fix/issue-334-document-why-balances-are-interpolated-rather

Conversation

@Yungmon22

Copy link
Copy Markdown
Contributor

Overview

This PR documents why account balances are interpolated locally between fetches instead of being polled from the API every second, and records the trade-off between accuracy and load that motivates the approach. It also notes how often authoritative data is fetched and clarifies that the ledger clock is the source of truth.

Related Issue

Changes

📝 Balance Interpolation Documentation

  • [MODIFY] docs/README.md

    • Adds a section explaining that balances advance locally between fetches rather than being polled every second, and why this deliberate trade-off between accuracy and load was chosen.
    • States how often authoritative balance data is fetched.
    • Notes that the ledger clock is the source of truth for balance progression.
  • [MODIFY] hooks/use-accrual.ts

    • Adds inline comments documenting the interpolation behavior and its rationale, so the reasoning is recorded alongside the implementation.
  • [MODIFY] lib/api.ts

    • Adds inline comments clarifying the fetch cadence for authoritative data and the ledger clock as the source of truth.

Verification Results

npm run lint
✅ passed

npm run typecheck
✅ passed

npm test
✅ passed

npm run build
✅ passed
Acceptance Criteria Status
The documentation explains why balances are interpolated locally. ✅ Documented in docs/README.md and inline comments
It states how often authoritative data is fetched. ✅ Fetch cadence documented
It notes the ledger clock is the source of truth. ✅ Noted in docs and code comments

Closes #334

@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@Yungmon22 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

@Glittersup

Copy link
Copy Markdown
Contributor

Please resolve conflicts @Yungmon22

@Glittersup
Glittersup merged commit 3f1cae9 into TricklePay:main Oct 4, 2026
1 check failed
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.

Document why balances are interpolated rather than polled

2 participants