SteppedRate

data class SteppedRate(val initialRate: BigDecimal, val steps: List<SteppedRate.Step>)

A piecewise fee rate over a USD amount — Splice's Splice.Fees.SteppedRate.

Semantics (from chargeSteppedRate in splice's daml/splice-amulet/daml/Splice/Fees.daml): the rate applies per tranche, like tax brackets. Step boundaries are absolute amounts, not tranche widths: SteppedRate(0.01, [(100, 0.001), (1000, 0.0001), (1000000, 0.00001)]) charges 1% on the first 100, 0.1% between 100 and 1000, 0.01% between 1000 and 1000000, and 0.001% above that.

Constructors

Link copied to clipboard
constructor(initialRate: BigDecimal, steps: List<SteppedRate.Step>)

Types

Link copied to clipboard
data class Step(val boundary: BigDecimal, val rate: BigDecimal)

One step: rate applies to the amount above boundary (up to the next boundary).

Properties

Link copied to clipboard

The rate charged on the amount below the first step boundary.

Link copied to clipboard

Steps in ascending boundary order (validated on-ledger).

Functions

Link copied to clipboard

The fee this schedule charges on amount, per Splice's chargeSteppedRate: each tranche's width times its rate, summed. Amounts <= 0 charge zero. Every tranche product is rounded to 10 decimal places half-even, mirroring Daml Decimal arithmetic.