← Back to StreamPay App

⚡ Accrual Curve API Docs

OpenAPI 3.1Raw openapi.json ↗

Continuous on-the-fly accrual curves computed directly from contract state with ETag caching, honest staleness indicators, and shared RPC rate budgeting.

1. Computed, Never Stored

Curve points are derived in real-time using the contract’s exact pure math:streamed(t) = deposit × elapsed / durationZero points are persisted in databases or files.

2. State Hash & ETag Caching

Response includes exact X-State-Hash computed as SHA-256 of on-chain state. ETag is derived from hash:id:from:to:step. Clients sendingIf-None-Match receive 304 Not Modified with zero payload.

3. Honest Staleness Headers

Every response discloses exact freshness: X-As-Of-Ledger,X-As-Of-Timestamp, and Age. If indexer lag exceeds threshold (>60s), an explicitWarning: 199 header is emitted.

4. Shared RPC Budget Manager (#56)

Calls draw from a unified rate budget protecting both node RPC quotas and per-client budgets. Exhaustion triggers 429 Too Many Requests with a standardRetry-After header, serving stale cache when safe.

Loading interactive OpenAPI schema viewer...