RewardsBeam lets a facilitator multisig re-rate the vesting stream that funds a treasury-funded
farm, within boundaries set by Sky governance. It is the on-chain equivalent of the
TreasuryFundedFarmingInit.updateFarmVest
routine that governance spells run today.
set() rolls over an existing stream; it never creates the first one. Governance must have created
the initial stream and pointed dist at it (dist.vestId() != 0), otherwise the call reverts.
One call performs the whole rollover atomically:
- flush whatever the outgoing stream still owes the farm (
dist.distribute()), - retire it (
vest.yank), - create the replacement stream, beginning now, and restrict it (
vest.create+vest.restrict), - point the distribution contract at it (
dist.file("vestId", …)).
Every call restarts the stream for a full vestTau and resets the cooldown, even if vestTot is
unchanged.
There is normally a delay before the new rate fully applies, as the old remaining distribution is spread together with the new rewards.
Governance files each knob. A freshly deployed beam is inert: maxVestTot defaults to 0, so
nothing can be executed until governance files it.
| Param | Unit | Description |
|---|---|---|
maxVestTot |
token decimals precision | max total of a new stream |
vestTau |
s | duration of a new stream; between 1 second and 20 years |
tau |
s | cooldown between set() calls |
toc |
unix ts | last set() timestamp |
The facilitator sets one number: how much to stream. vestTau is governance-only, so the rate a
facilitator can reach is bounded by maxVestTot / vestTau, both ends governance-owned. Lowering
vestTot is unbounded: at worst it starves the farm, which governance can revive, and the funds
simply stay in the treasury.
The beam is not the treasury and cannot approve on its behalf, so — unlike the spell routine — it
does not adjust the treasury's gem allowance to vest. It does not check it either. A pre-flight
check would be worth little:
- The allowance is a bookkeeping figure the treasury balance does not necessarily back.
DssVestdrawsunpaidprogressively overvestTau, nevervestTotat once, so requiring up-front coverage is stricter than the system needs.- The token already caps cumulative transfers at the allowance, on every distribution, with or without the beam looking.
The funding check that matters comes for free: set() flushes the outgoing stream first, which moves
real tokens, so the call reverts if the treasury cannot cover what is currently due. Keeping the
stream payable from there on is governance's job, exactly as it is when the balance runs low. The
beam's own boundary is maxVestTot.
vest.cap() is a second, independent governance-owned rate ceiling that vest.create enforces. The beam is deliberately not a cap filer — raising cap would affect every stream of the vest, not just this farm's.
The farm's rewardsDuration is deliberately out of scope: re-rating the notification window is a structural decision for the full governance process.
A governance yank of the current stream does not, by itself, stop the beam: the next set() would
create a fresh stream and reactivate the farm. When governance retires the stream, it should disable
the beam in the same spell, by any of:
dissevery facilitator, so no one can callset();file("maxVestTot", 0), so no non-zero stream fits (andvest.createrejects a zero one);file("tau", type(uint64).max)orfile("toc", type(uint128).max)filing an unreachable cooldowndenythe beam onvestor ondist, so the rollover reverts.
RewardsBeamMom does both without the governance delay: stop() files tau to type(uint64).max,
an unreachable cooldown, and yanks the current stream. Reviving the beam is a matter of filing tau
back. What has accrued until then stays claimable, so the farm still receives it.