Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/rewards abci #3430

Merged
merged 15 commits into from
Dec 2, 2023
Merged

Feat/rewards abci #3430

merged 15 commits into from
Dec 2, 2023

Conversation

snobbee
Copy link
Contributor

@snobbee snobbee commented Nov 15, 2023

  • introduce new module epochs to manage time-based scheduled tasks for daily reward distribution
  • create CLP hook for distribution of available rewards in reward buckets
  • calculation of reward share for eligible lps
  • eligible lp is an LP that locked liquidity in a pool for at least lockPeriod
  • introduced new lockedPeriod reward params (set by default at 14 days)
  • calculation of absolute reward amount to distribute for each eligible lp
  • distribute reward amount to lp and substract the amount from reward bucket
  • updated CLP cil to update reward params that includes both lockPeriod and epochIdentifier
  • add rewardsDistribute param (default to false)
  • if rewardsDistribute is false then the rewards get added to liquidity pool and eligible LP pool units get re-calculated and increased.
  • keep track of all the rewards distributed or added to liquidity provider pool share at both LP and pool level

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Merging #3430 (67870b6) into master (0c63583) will increase coverage by 0.11%.
Report is 9 commits behind head on master.
The diff coverage is 38.60%.

❗ Current head 67870b6 differs from pull request most recent head bc8ab48. Consider uploading reports for the commit bc8ab48 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3430      +/-   ##
==========================================
+ Coverage   43.35%   43.46%   +0.11%     
==========================================
  Files         166      175       +9     
  Lines       15895    16328     +433     
==========================================
+ Hits         6891     7097     +206     
- Misses       8591     8807     +216     
- Partials      413      424      +11     
Files Coverage Δ
app/app.go 94.08% <100.00%> (+3.97%) ⬆️
cmd/sifnoded/cmd/ibc-diag.go 15.74% <ø> (ø)
x/clp/types/codec.go 100.00% <100.00%> (ø)
x/clp/types/key_rewards_bucket.go 100.00% <100.00%> (ø)
x/clp/types/keys.go 84.21% <100.00%> (+0.87%) ⬆️
x/clp/types/querier.go 100.00% <ø> (ø)
x/dispensation/types/types.go 100.00% <100.00%> (ø)
x/ibctransfer/helpers/conversion_helper.go 37.19% <ø> (ø)
x/ibctransfer/keeper/msg_server.go 86.95% <ø> (ø)
app/setup_handlers.go 10.52% <0.00%> (+1.83%) ⬆️
... and 14 more

... and 2 files with indirect coverage changes

x/clp/keeper/liquidityprovider.go Outdated Show resolved Hide resolved
x/clp/keeper/liquidityprovider.go Show resolved Hide resolved
pgoos
pgoos previously approved these changes Nov 27, 2023
Copy link
Contributor

@pgoos pgoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@snobbee snobbee merged commit cbe2453 into master Dec 2, 2023
17 checks passed
@snobbee snobbee deleted the feat/rewards-abci branch December 2, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants