mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 16:25:21 +00:00
e1ad9569a7
* add interest rate models to params * move interest rate models to money market param * add interest rate models to store * update store interest rate models from params * refactor money market init function, update tests * use cmp package for optimized comparison * implement equal function, remove gocmp dep * delete unseen interest rate model param from store
17 lines
512 B
Go
17 lines
512 B
Go
package harvest
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
// BeginBlocker applies rewards to liquidity providers and delegators according to params
|
|
func BeginBlocker(ctx sdk.Context, k Keeper) {
|
|
k.ApplyDepositRewards(ctx)
|
|
if k.ShouldDistributeValidatorRewards(ctx, k.BondDenom(ctx)) {
|
|
k.ApplyDelegationRewards(ctx, k.BondDenom(ctx))
|
|
k.SetPreviousDelegationDistribution(ctx, ctx.BlockTime(), k.BondDenom(ctx))
|
|
}
|
|
k.ApplyInterestRateUpdates(ctx)
|
|
k.SetPreviousBlockTime(ctx, ctx.BlockTime())
|
|
}
|