Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/badger-finance/badger-rewards
https://github.com/badger-finance/badger-rewards
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/badger-finance/badger-rewards
- Owner: Badger-Finance
- License: mit
- Created: 2021-08-04T13:01:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T19:14:41.000Z (6 months ago)
- Last Synced: 2024-05-22T20:31:03.097Z (6 months ago)
- Language: Python
- Size: 52.2 MB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
![Badger Logo](./images/badger-logo.png)
### Test coverage:
[![codecov](https://codecov.io/gh/Badger-Finance/badger-rewards/branch/development/graph/badge.svg?token=0JIZAA720B)](https://codecov.io/gh/Badger-Finance/badger-rewards)
# Badger RewardsBadger Rewards hosts scripts directly related to the Badger Rewards system, including:
- calculating Badger Boost
- proposing roots for rewards distribution
- approving roots for rewards distributionVisit our [GitBook](https://app.gitbook.com/@badger-finance/s/badger-tech/) for more detailed documentation.
# Current deployed bots
### Boost Bot
```
Chain: Ethereum
Cadence: Every 10m
```## Rewards deployment
In order to deploy on an EVM chain, the following is required- RPC endpoint for specific chain
- Subgraph for tracking user balances (api subgraph)
- Subgraph for tracking tree distribution events
- Subgraph for tracking tokens
- Gas estimation api for that chain
- Badger Tree + Rewards Logger contracts
- AWS bucket for storing merkle trees and initial empty tree file# Development
### Releasing a feature
When not sure if feature can break something, consider using feature flags functionality
to disable the code that could potentially cause issues.First, add new feature flag to `FeatureFlags.FLAGS` dictionary:
```python
class FeatureFlags:
FLAGS: Dict[str, bool] = {
NEW_FLAG: True
}
```
Then use new flag to wrap potentially dangerous code:
```python
from rewards.feature_flags import flagsdef some_func():
if flags.flag_enabled(NEW_FLAG):
new_functionality()
else:
old_functionality()
```After succesful release consider removing `NEW_FLAG`, as well as the wrapper and old functionality.