Skip to content

calculateEffectiveRate

calculateEffectiveRate(params): OutputType

Defined in: packages/synapse-core/src/warm-storage/calculate-effective-rate.ts:65

Mirror the contract’s _calculateStorageRate with floor pricing.

Returns two rates for different use cases:

  • ratePerEpoch — matches the on-chain rail rate (use for lockup math)
  • ratePerMonth — higher precision, linearly scalable (use for display)

The contract multiplies totalBytes * pricePerTiBPerMonth before dividing by TiB * EPOCHS_PER_MONTH in a single step, so ratePerEpoch depends on the total size and cannot be scaled to estimate other sizes. ratePerMonth avoids the epoch division, preserving that scalability.

On-chain reference:

ParameterTypeDescription
paramsParamsTypecalculateEffectiveRate.ParamsType

OutputType

calculateEffectiveRate.OutputType