HSP Sandbox Mode— Settlement flows are simulated. On-chain payroll is fully functional.
← Docs
How money flows

Cadence

AdaptiveCadence.sol

Cadence is the primitive that decides how settled funds are delivered to a recipient. Employer funds the escrow once; each recipient picks their mode independently (within employer-permitted bounds).

Modes

  • Batch — full cycle amount delivered at executeCycle.
  • Stream — committed balance ticks per-second; recipient claims anytime.
  • Pull — cycles accumulate; recipient claims on-demand.
  • Hybrid — split payout: configurable bps streams, remainder batches.

Math

streamRate = amountPerCycle / cyclePeriod
accrued(t) = min(
  (t - lastClaimTime) * streamRate,
  committedBalance - alreadyClaimed
)

Key functions

setCadencePolicy(payrollId, recipient, mode, canSwitch, hybridBps)
setRecipientCadence(payrollId, mode) // if canSwitch
claim(payrollId) returns (uint256)
accruedFor(payrollId, recipient) view returns (uint256)

Guarantees

  • Accrued never exceeds committed.
  • Mode switch preserves accrued balance.
  • Reentrancy-guarded claim.