Skip to main content

FeeDistributor

Multi-token fee distribution for veYB holders.

FeeDistributor.vy receives admin-fee tokens from YieldBasis markets and distributes them to veYB voters by weekly epochs. New balances are smoothed over four future weeks (OVER_WEEKS = 4) to avoid concentrating a large fee arrival into one claim window.

Main flows

FunctionUse
fill_epochs()Reads newly arrived balances for the current token set and allocates them across the next four weekly epochs.
preview_distribution(week_shift)Returns the token amounts scheduled for a given week.
preview_claim(receiver, epoch_count, use_vest)Simulates claimable tokens for a receiver. The source notes this must be exposed as a view call in ABI tooling.
claim(receiver, epoch_count, use_vest)Claims epoch allocations for the receiver.
add_token_set(token_set)Owner-only update that expands the tokens tracked for future distributions.
kill_toggle(is_killed)Owner-only kill switch for epoch filling.

Claim basis

For each epoch, the contract reads historical voting power from VotingEscrow:

  • VE.getPastVotes(user, epoch)
  • VE.getPastTotalSupply(epoch)

Each token allocation is epoch_token_amount * user_votes / total_votes.

Vesting escrows

Claims can route through cliff escrows when use_vest = True. If a receiver might be a cliff-style escrow and is not the caller, the contract can revert with Might be a vest; use the vest-aware claim path for cliff recipients.