WARNING: Code is NOT AUDITED - DO NOT USE IN PROD
https://github.com/GalloDaSballo/badger-onchain-rewards
RewardsManager is a permissionless (no governance) smart contract that allows, vaults, protocols and people to set up and distribute weekly rewards based on usage.
https://mint-salesman-909.notion.site/RewardsManager-Dust-Math-eec10f8810974931b1581927b2d8eaf8
BadgerDAO offers a set of Yield Farming Vaults with a twist, we call them “Partner First”, this means that instead of selling the tokens that the vault farm, we emit them via the BadgerTree for depositors to claim.
The BadgerTree is a Merkle proof system, which is not trustless and requires maintenance for generating new proofs and calculating rewards for each user.
With the goal of fully decentralizing our systems, BadgerRewards is meant to allow to accept any token we emit, and fairly distribute rewards to vault depositors.
The idea of fair distribution is an open issue for Yield Farming Vaults as most system allow a last-second depositor to front-run an harvest, gaining a higher portion of the collective yield gain than what their vested deposit should entitle them to.