Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type Hooks
- func (h Hooks) AfterBorrowCreated(ctx sdk.Context, borrow jolttypes.Borrow)
- func (h Hooks) AfterBorrowModified(ctx sdk.Context, borrow jolttypes.Borrow)
- func (h Hooks) AfterCDPCreated(ctx sdk.Context, cdp cdptypes.CDP)
- func (h Hooks) AfterDepositCreated(ctx sdk.Context, deposit jolttypes.Deposit)
- func (h Hooks) AfterDepositModified(ctx sdk.Context, deposit jolttypes.Deposit)
- func (h Hooks) BeforeBorrowModified(ctx sdk.Context, borrow jolttypes.Borrow)
- func (h Hooks) BeforeCDPModified(ctx sdk.Context, cdp cdptypes.CDP)
- func (h Hooks) BeforeDepositModified(ctx sdk.Context, deposit jolttypes.Deposit)
- type Keeper
- func (k Keeper) AccumulateJoltBorrowRewards(ctx sdk.Context, rewardPeriod types.MultiRewardPeriod)
- func (k Keeper) AccumulateJoltSupplyRewards(ctx sdk.Context, rewardPeriod types.MultiRewardPeriod)
- func (k Keeper) CalculateRewards(oldIndexes, newIndexes types.RewardIndexes, sourceShares sdk.Dec) (sdk.Coins, error)
- func (k Keeper) CalculateSingleReward(oldIndex, newIndex, sourceShares sdk.Dec) (sdk.Int, error)
- func (k Keeper) ClaimJoltReward(ctx sdk.Context, owner, receiver sdk.AccAddress, denom string, ...) error
- func (k Keeper) DeleteDelegatorClaim(ctx sdk.Context, owner sdk.AccAddress)
- func (k Keeper) DeleteJoltLiquidityProviderClaim(ctx sdk.Context, owner sdk.AccAddress)
- func (k Keeper) DeleteSavingsClaim(ctx sdk.Context, owner sdk.AccAddress)
- func (k Keeper) DeleteSwapClaim(ctx sdk.Context, owner sdk.AccAddress)
- func (k Keeper) DeleteUSDXMintingClaim(ctx sdk.Context, owner sdk.AccAddress)
- func (k Keeper) GetAllDelegatorClaims(ctx sdk.Context) types.DelegatorClaims
- func (k Keeper) GetAllJoltLiquidityProviderClaims(ctx sdk.Context) types.JoltLiquidityProviderClaims
- func (k Keeper) GetAllSavingsClaims(ctx sdk.Context) types.SavingsClaims
- func (k Keeper) GetAllSwapClaims(ctx sdk.Context) types.SwapClaims
- func (k Keeper) GetAllUSDXMintingClaims(ctx sdk.Context) types.USDXMintingClaims
- func (k Keeper) GetClaimEnd(ctx sdk.Context) time.Time
- func (k Keeper) GetDelegatorClaim(ctx sdk.Context, addr sdk.AccAddress) (types.DelegatorClaim, bool)
- func (k Keeper) GetDelegatorRewardIndexes(ctx sdk.Context, denom string) (types.RewardIndexes, bool)
- func (k Keeper) GetDelegatorRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
- func (k Keeper) GetJoltBorrowRewardIndexes(ctx sdk.Context, denom string) (types.RewardIndexes, bool)
- func (k Keeper) GetJoltBorrowRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
- func (k Keeper) GetJoltLiquidityProviderClaim(ctx sdk.Context, addr sdk.AccAddress) (types.JoltLiquidityProviderClaim, bool)
- func (k Keeper) GetJoltSupplyRewardIndexes(ctx sdk.Context, denom string) (types.RewardIndexes, bool)
- func (k Keeper) GetJoltSupplyRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
- func (k Keeper) GetMultiplierByDenom(ctx sdk.Context, denom string, name string) (types.Multiplier, bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPeriodLength(blockTime time.Time, monthsLockup int64) int64
- func (k Keeper) GetPreviousDelegatorRewardAccrualTime(ctx sdk.Context, denom string) (blockTime time.Time, found bool)
- func (k Keeper) GetPreviousJoltBorrowRewardAccrualTime(ctx sdk.Context, denom string) (blockTime time.Time, found bool)
- func (k Keeper) GetPreviousJoltSupplyRewardAccrualTime(ctx sdk.Context, denom string) (blockTime time.Time, found bool)
- func (k Keeper) GetPreviousUSDXMintingAccrualTime(ctx sdk.Context, ctype string) (blockTime time.Time, found bool)
- func (k Keeper) GetSavingsClaim(ctx sdk.Context, addr sdk.AccAddress) (types.SavingsClaim, bool)
- func (k Keeper) GetSavingsRewardAccrualTime(ctx sdk.Context, poolID string) (blockTime time.Time, found bool)
- func (k Keeper) GetSavingsRewardIndexes(ctx sdk.Context, denom string) (types.RewardIndexes, bool)
- func (k Keeper) GetSavingsRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
- func (k Keeper) GetSwapClaim(ctx sdk.Context, addr sdk.AccAddress) (types.SwapClaim, bool)
- func (k Keeper) GetSwapRewardAccrualTime(ctx sdk.Context, poolID string) (blockTime time.Time, found bool)
- func (k Keeper) GetSwapRewardIndexes(ctx sdk.Context, poolID string) (types.RewardIndexes, bool)
- func (k Keeper) GetUSDXMintingClaim(ctx sdk.Context, addr sdk.AccAddress) (types.USDXMintingClaim, bool)
- func (k Keeper) GetUSDXMintingRewardFactor(ctx sdk.Context, ctype string) (factor sdk.Dec, found bool)
- func (k Keeper) GetUSDXMintingRewardPeriod(ctx sdk.Context, collateralType string) (types.RewardPeriod, bool)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitializeJoltBorrowReward(ctx sdk.Context, borrow jolttypes.Borrow)
- func (k Keeper) InitializeJoltSupplyReward(ctx sdk.Context, deposit hardtypes.Deposit)
- func (k Keeper) IterateDelegatorClaims(ctx sdk.Context, cb func(c types.DelegatorClaim) (stop bool))
- func (k Keeper) IterateDelegatorRewardAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
- func (k Keeper) IterateDelegatorRewardIndexes(ctx sdk.Context, ...)
- func (k Keeper) IterateJoltBorrowRewardAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
- func (k Keeper) IterateJoltBorrowRewardIndexes(ctx sdk.Context, ...)
- func (k Keeper) IterateJoltLiquidityProviderClaims(ctx sdk.Context, cb func(c types.JoltLiquidityProviderClaim) (stop bool))
- func (k Keeper) IterateJoltSupplyRewardAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
- func (k Keeper) IterateJoltSupplyRewardIndexes(ctx sdk.Context, ...)
- func (k Keeper) IterateSavingsClaims(ctx sdk.Context, cb func(c types.SavingsClaim) (stop bool))
- func (k Keeper) IterateSavingsRewardAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
- func (k Keeper) IterateSavingsRewardIndexes(ctx sdk.Context, ...)
- func (k Keeper) IterateSwapClaims(ctx sdk.Context, cb func(c types.SwapClaim) (stop bool))
- func (k Keeper) IterateSwapRewardAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
- func (k Keeper) IterateSwapRewardIndexes(ctx sdk.Context, ...)
- func (k Keeper) IterateUSDXMintingAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
- func (k Keeper) IterateUSDXMintingClaims(ctx sdk.Context, cb func(c types.USDXMintingClaim) (stop bool))
- func (k Keeper) IterateUSDXMintingRewardFactors(ctx sdk.Context, cb func(denom string, factor sdk.Dec) (stop bool))
- func (k Keeper) SendTimeLockedCoinsToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SendTimeLockedCoinsToBaseAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SendTimeLockedCoinsToPeriodicVestingAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SetDelegatorClaim(ctx sdk.Context, c types.DelegatorClaim)
- func (k Keeper) SetDelegatorRewardIndexes(ctx sdk.Context, denom string, indexes types.RewardIndexes)
- func (k Keeper) SetJoltBorrowRewardIndexes(ctx sdk.Context, denom string, indexes types.RewardIndexes)
- func (k Keeper) SetJoltLiquidityProviderClaim(ctx sdk.Context, c types.JoltLiquidityProviderClaim)
- func (k Keeper) SetJoltSupplyRewardIndexes(ctx sdk.Context, denom string, indexes types.RewardIndexes)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPreviousDelegatorRewardAccrualTime(ctx sdk.Context, denom string, blockTime time.Time)
- func (k Keeper) SetPreviousJoltBorrowRewardAccrualTime(ctx sdk.Context, denom string, blockTime time.Time)
- func (k Keeper) SetPreviousJoltSupplyRewardAccrualTime(ctx sdk.Context, denom string, blockTime time.Time)
- func (k Keeper) SetPreviousUSDXMintingAccrualTime(ctx sdk.Context, ctype string, blockTime time.Time)
- func (k Keeper) SetSavingsClaim(ctx sdk.Context, c types.SavingsClaim)
- func (k Keeper) SetSavingsRewardAccrualTime(ctx sdk.Context, poolID string, blockTime time.Time)
- func (k Keeper) SetSavingsRewardIndexes(ctx sdk.Context, denom string, indexes types.RewardIndexes)
- func (k Keeper) SetSwapClaim(ctx sdk.Context, c types.SwapClaim)
- func (k Keeper) SetSwapRewardAccrualTime(ctx sdk.Context, poolID string, blockTime time.Time)
- func (k Keeper) SetSwapRewardIndexes(ctx sdk.Context, poolID string, indexes types.RewardIndexes)
- func (k Keeper) SetUSDXMintingClaim(ctx sdk.Context, c types.USDXMintingClaim)
- func (k Keeper) SetUSDXMintingRewardFactor(ctx sdk.Context, ctype string, factor sdk.Dec)
- func (k Keeper) SimulateHardSynchronization(ctx sdk.Context, claim types.JoltLiquidityProviderClaim) types.JoltLiquidityProviderClaim
- func (k Keeper) SynchronizeJoltBorrowReward(ctx sdk.Context, borrow jolttypes.Borrow)
- func (k Keeper) SynchronizeJoltLiquidityProviderClaim(ctx sdk.Context, owner sdk.AccAddress)
- func (k Keeper) SynchronizeJoltSupplyReward(ctx sdk.Context, deposit hardtypes.Deposit)
- func (k Keeper) UpdateJoltBorrowIndexDenoms(ctx sdk.Context, borrow jolttypes.Borrow)
- func (k Keeper) UpdateJoltSupplyIndexDenoms(ctx sdk.Context, deposit hardtypes.Deposit)
Constants ¶
const ( // BeginningOfMonth harvest rewards that are claimed after the 15th at 14:00UTC of the month always vest on the first of the month BeginningOfMonth = 1 // MidMonth harvest rewards that are claimed before the 15th at 14:00UTC of the month always vest on the 15 of the month MidMonth = 15 // PaymentHour harvest rewards always vest at 14:00UTC PaymentHour = 14 )
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the incentive MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier is the module level router for state queries
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for hooks
func (Hooks) AfterBorrowCreated ¶
AfterBorrowCreated function that runs after a borrow is created
func (Hooks) AfterBorrowModified ¶
AfterBorrowModified function that runs after a borrow is modified
func (Hooks) AfterCDPCreated ¶
AfterCDPCreated function that runs after a cdp is created
func (Hooks) AfterDepositCreated ¶
AfterDepositCreated function that runs after a deposit is created
func (Hooks) AfterDepositModified ¶
AfterDepositModified function that runs after a deposit is modified
func (Hooks) BeforeBorrowModified ¶
BeforeBorrowModified function that runs before a borrow is modified
func (Hooks) BeforeCDPModified ¶
BeforeCDPModified function that runs before a cdp is modified note that this is called immediately after interest is synchronized, and so could potentially be called AfterCDPInterestUpdated or something like that, if we we're to expand the scope of cdp hooks
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper keeper for the incentive module
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key sdk.StoreKey, paramstore types.ParamSubspace, bk types.BankKeeper, cdpk types.CdpKeeper, hk types.JoltKeeper, ak types.AccountKeeper, ) Keeper
NewKeeper creates a new keeper
func (Keeper) AccumulateJoltBorrowRewards ¶
func (k Keeper) AccumulateJoltBorrowRewards(ctx sdk.Context, rewardPeriod types.MultiRewardPeriod)
AccumulateJoltBorrowRewards calculates new rewards to distribute this block and updates the global indexes to reflect this. The provided rewardPeriod must be valid to avoid panics in calculating time durations.
func (Keeper) AccumulateJoltSupplyRewards ¶
func (k Keeper) AccumulateJoltSupplyRewards(ctx sdk.Context, rewardPeriod types.MultiRewardPeriod)
AccumulateJoltSupplyRewards calculates new rewards to distribute this block and updates the global indexes to reflect this. The provided rewardPeriod must be valid to avoid panics in calculating time durations.
func (Keeper) CalculateRewards ¶
func (k Keeper) CalculateRewards(oldIndexes, newIndexes types.RewardIndexes, sourceShares sdk.Dec) (sdk.Coins, error)
CalculateRewards computes how much rewards should have accrued to a reward source (eg a user's jolt borrowed btc amount) between two index values.
oldIndex is normally the index stored on a claim, newIndex the current global value, and sourceShares a jolt borrowed/supplied amount.
It returns an error if newIndexes does not contain all CollateralTypes from oldIndexes, or if any value of oldIndex.RewardFactor > newIndex.RewardFactor. This should never happen, as it would mean that a global reward index has decreased in value, or that a global reward index has been deleted from state.
func (Keeper) CalculateSingleReward ¶
CalculateSingleReward computes how much rewards should have accrued to a reward source (eg a user's btcb-a cdp principal) between two index values.
oldIndex is normally the index stored on a claim, newIndex the current global value, and sourceShares a cdp principal amount.
Returns an error if oldIndex > newIndex. This should never happen, as it would mean that a global reward index has decreased in value, or that a global reward index has been deleted from state.
func (Keeper) ClaimJoltReward ¶
func (k Keeper) ClaimJoltReward(ctx sdk.Context, owner, receiver sdk.AccAddress, denom string, multiplierName string) error
ClaimJoltReward pays out funds from a claim to a receiver account. Rewards are removed from a claim and paid out according to the multiplier, which reduces the reward amount in exchange for shorter vesting times.
func (Keeper) DeleteDelegatorClaim ¶
func (k Keeper) DeleteDelegatorClaim(ctx sdk.Context, owner sdk.AccAddress)
DeleteDelegatorClaim deletes the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) DeleteJoltLiquidityProviderClaim ¶
func (k Keeper) DeleteJoltLiquidityProviderClaim(ctx sdk.Context, owner sdk.AccAddress)
DeleteJoltLiquidityProviderClaim deletes the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) DeleteSavingsClaim ¶
func (k Keeper) DeleteSavingsClaim(ctx sdk.Context, owner sdk.AccAddress)
DeleteSavingsClaim deletes the claim in the store corresponding to the input address.
func (Keeper) DeleteSwapClaim ¶
func (k Keeper) DeleteSwapClaim(ctx sdk.Context, owner sdk.AccAddress)
DeleteSwapClaim deletes the claim in the store corresponding to the input address.
func (Keeper) DeleteUSDXMintingClaim ¶
func (k Keeper) DeleteUSDXMintingClaim(ctx sdk.Context, owner sdk.AccAddress)
DeleteUSDXMintingClaim deletes the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) GetAllDelegatorClaims ¶
func (k Keeper) GetAllDelegatorClaims(ctx sdk.Context) types.DelegatorClaims
GetAllDelegatorClaims returns all DelegatorClaim objects in the store
func (Keeper) GetAllJoltLiquidityProviderClaims ¶
func (k Keeper) GetAllJoltLiquidityProviderClaims(ctx sdk.Context) types.JoltLiquidityProviderClaims
GetAllJoltLiquidityProviderClaims returns all Claim objects in the store
func (Keeper) GetAllSavingsClaims ¶
func (k Keeper) GetAllSavingsClaims(ctx sdk.Context) types.SavingsClaims
GetAllSavingsClaims returns all savings claim objects in the store
func (Keeper) GetAllSwapClaims ¶
func (k Keeper) GetAllSwapClaims(ctx sdk.Context) types.SwapClaims
GetAllSwapClaims returns all Claim objects in the store
func (Keeper) GetAllUSDXMintingClaims ¶
func (k Keeper) GetAllUSDXMintingClaims(ctx sdk.Context) types.USDXMintingClaims
GetAllUSDXMintingClaims returns all Claim objects in the store
func (Keeper) GetClaimEnd ¶
GetClaimEnd returns the claim end time for the params
func (Keeper) GetDelegatorClaim ¶
func (k Keeper) GetDelegatorClaim(ctx sdk.Context, addr sdk.AccAddress) (types.DelegatorClaim, bool)
GetDelegatorClaim returns the claim in the store corresponding the the input address collateral type and id and a boolean for if the claim was found
func (Keeper) GetDelegatorRewardIndexes ¶
func (k Keeper) GetDelegatorRewardIndexes(ctx sdk.Context, denom string) (types.RewardIndexes, bool)
GetDelegatorRewardIndexes gets the current reward indexes for an individual denom
func (Keeper) GetDelegatorRewardPeriods ¶
func (k Keeper) GetDelegatorRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
GetDelegatorRewardPeriods returns the reward period with the specified collateral type if it's found in the params
func (Keeper) GetJoltBorrowRewardIndexes ¶
func (k Keeper) GetJoltBorrowRewardIndexes(ctx sdk.Context, denom string) (types.RewardIndexes, bool)
GetJoltBorrowRewardIndexes gets the current reward indexes for an individual denom
func (Keeper) GetJoltBorrowRewardPeriods ¶
func (k Keeper) GetJoltBorrowRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
GetJoltBorrowRewardPeriods returns the reward period with the specified collateral type if it's found in the params
func (Keeper) GetJoltLiquidityProviderClaim ¶
func (k Keeper) GetJoltLiquidityProviderClaim(ctx sdk.Context, addr sdk.AccAddress) (types.JoltLiquidityProviderClaim, bool)
GetJoltLiquidityProviderClaim returns the claim in the store corresponding the the input address collateral type and id and a boolean for if the claim was found
func (Keeper) GetJoltSupplyRewardIndexes ¶
func (k Keeper) GetJoltSupplyRewardIndexes(ctx sdk.Context, denom string) (types.RewardIndexes, bool)
GetJoltSupplyRewardIndexes gets the current reward indexes for an individual denom
func (Keeper) GetJoltSupplyRewardPeriods ¶
func (k Keeper) GetJoltSupplyRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
GetJoltSupplyRewardPeriods returns the reward period with the specified collateral type if it's found in the params
func (Keeper) GetMultiplierByDenom ¶
func (k Keeper) GetMultiplierByDenom(ctx sdk.Context, denom string, name string) (types.Multiplier, bool)
GetMultiplierByDenom fetches a multiplier from the params matching the denom and name.
func (Keeper) GetPeriodLength ¶
GetPeriodLength returns the length of the lockup period based on the input blocktime and multiplier lockup. Note that pay dates are always the 1st or 15th of the month at 14:00UTC. Months lockup cannot be negative
func (Keeper) GetPreviousDelegatorRewardAccrualTime ¶
func (k Keeper) GetPreviousDelegatorRewardAccrualTime(ctx sdk.Context, denom string) (blockTime time.Time, found bool)
GetPreviousDelegatorRewardAccrualTime returns the last time a denom accrued protocol delegator rewards
func (Keeper) GetPreviousJoltBorrowRewardAccrualTime ¶
func (k Keeper) GetPreviousJoltBorrowRewardAccrualTime(ctx sdk.Context, denom string) (blockTime time.Time, found bool)
GetPreviousJoltBorrowRewardAccrualTime returns the last time a denom accrued Hard protocol borrow-side rewards
func (Keeper) GetPreviousJoltSupplyRewardAccrualTime ¶
func (k Keeper) GetPreviousJoltSupplyRewardAccrualTime(ctx sdk.Context, denom string) (blockTime time.Time, found bool)
GetPreviousJoltSupplyRewardAccrualTime returns the last time a denom accrued Hard protocol supply-side rewards
func (Keeper) GetPreviousUSDXMintingAccrualTime ¶
func (k Keeper) GetPreviousUSDXMintingAccrualTime(ctx sdk.Context, ctype string) (blockTime time.Time, found bool)
GetPreviousUSDXMintingAccrualTime returns the last time a collateral type accrued USDX minting rewards
func (Keeper) GetSavingsClaim ¶
func (k Keeper) GetSavingsClaim(ctx sdk.Context, addr sdk.AccAddress) (types.SavingsClaim, bool)
GetSavingsClaim returns the claim in the store corresponding the the input address.
func (Keeper) GetSavingsRewardAccrualTime ¶
func (k Keeper) GetSavingsRewardAccrualTime(ctx sdk.Context, poolID string) (blockTime time.Time, found bool)
GetSavingsRewardAccrualTime fetches the last time rewards were accrued for an individual denom type
func (Keeper) GetSavingsRewardIndexes ¶
GetSavingsRewardIndexes fetches the global reward indexes that track rewards for an individual denom type
func (Keeper) GetSavingsRewardPeriods ¶
func (k Keeper) GetSavingsRewardPeriods(ctx sdk.Context, denom string) (types.MultiRewardPeriod, bool)
GetSavingsRewardPeriods returns the reward period with the specified collateral type if it's found in the params
func (Keeper) GetSwapClaim ¶
GetSwapClaim returns the claim in the store corresponding the the input address.
func (Keeper) GetSwapRewardAccrualTime ¶
func (k Keeper) GetSwapRewardAccrualTime(ctx sdk.Context, poolID string) (blockTime time.Time, found bool)
GetSwapRewardAccrualTime fetches the last time rewards were accrued for a swap pool.
func (Keeper) GetSwapRewardIndexes ¶
GetSwapRewardIndexes fetches the global reward indexes that track total rewards to a swap pool.
func (Keeper) GetUSDXMintingClaim ¶
func (k Keeper) GetUSDXMintingClaim(ctx sdk.Context, addr sdk.AccAddress) (types.USDXMintingClaim, bool)
GetUSDXMintingClaim returns the claim in the store corresponding the the input address collateral type and id and a boolean for if the claim was found
func (Keeper) GetUSDXMintingRewardFactor ¶
func (k Keeper) GetUSDXMintingRewardFactor(ctx sdk.Context, ctype string) (factor sdk.Dec, found bool)
GetUSDXMintingRewardFactor returns the current reward factor for an individual collateral type
func (Keeper) GetUSDXMintingRewardPeriod ¶
func (k Keeper) GetUSDXMintingRewardPeriod(ctx sdk.Context, collateralType string) (types.RewardPeriod, bool)
GetUSDXMintingRewardPeriod returns the reward period with the specified collateral type if it's found in the params
func (Keeper) InitializeJoltBorrowReward ¶
InitializeJoltBorrowReward initializes the borrow-side of a jolt liquidity provider claim by creating the claim and setting the borrow reward factor index
func (Keeper) InitializeJoltSupplyReward ¶
InitializeJoltSupplyReward initializes the supply-side of a jolt liquidity provider claim by creating the claim and setting the supply reward factor index
func (Keeper) IterateDelegatorClaims ¶
func (k Keeper) IterateDelegatorClaims(ctx sdk.Context, cb func(c types.DelegatorClaim) (stop bool))
IterateDelegatorClaims iterates over all claim objects in the store and preforms a callback function
func (Keeper) IterateDelegatorRewardAccrualTimes ¶
func (Keeper) IterateDelegatorRewardIndexes ¶
func (k Keeper) IterateDelegatorRewardIndexes(ctx sdk.Context, cb func(denom string, indexes types.RewardIndexes) (stop bool))
IterateDelegatorRewardIndexes iterates over all delegator reward index objects in the store and preforms a callback function
func (Keeper) IterateJoltBorrowRewardAccrualTimes ¶
func (Keeper) IterateJoltBorrowRewardIndexes ¶
func (k Keeper) IterateJoltBorrowRewardIndexes(ctx sdk.Context, cb func(denom string, indexes types.RewardIndexes) (stop bool))
IterateJoltBorrowRewardIndexes iterates over all Hard borrow reward index objects in the store and preforms a callback function
func (Keeper) IterateJoltLiquidityProviderClaims ¶
func (k Keeper) IterateJoltLiquidityProviderClaims(ctx sdk.Context, cb func(c types.JoltLiquidityProviderClaim) (stop bool))
IterateJoltLiquidityProviderClaims iterates over all claim objects in the store and preforms a callback function
func (Keeper) IterateJoltSupplyRewardAccrualTimes ¶
func (Keeper) IterateJoltSupplyRewardIndexes ¶
func (k Keeper) IterateJoltSupplyRewardIndexes(ctx sdk.Context, cb func(denom string, indexes types.RewardIndexes) (stop bool))
IterateJoltSupplyRewardIndexes iterates over all Hard supply reward index objects in the store and preforms a callback function
func (Keeper) IterateSavingsClaims ¶
IterateSavingsClaims iterates over all savings claim objects in the store and preforms a callback function
func (Keeper) IterateSavingsRewardAccrualTimes ¶
func (k Keeper) IterateSavingsRewardAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
IterateSavingsRewardAccrualTimesiterates over all the previous savings reward accrual times in the store
func (Keeper) IterateSavingsRewardIndexes ¶
func (k Keeper) IterateSavingsRewardIndexes(ctx sdk.Context, cb func(poolID string, indexes types.RewardIndexes) (stop bool))
IterateSavingsRewardIndexes iterates over all savings reward index objects in the store and preforms a callback function
func (Keeper) IterateSwapClaims ¶
IterateSwapClaims iterates over all claim objects in the store and preforms a callback function
func (Keeper) IterateSwapRewardAccrualTimes ¶
func (Keeper) IterateSwapRewardIndexes ¶
func (k Keeper) IterateSwapRewardIndexes(ctx sdk.Context, cb func(poolID string, indexes types.RewardIndexes) (stop bool))
IterateSwapRewardIndexes iterates over all swap reward index objects in the store and preforms a callback function
func (Keeper) IterateUSDXMintingAccrualTimes ¶
func (k Keeper) IterateUSDXMintingAccrualTimes(ctx sdk.Context, cb func(string, time.Time) (stop bool))
IterateUSDXMintingAccrualTimes iterates over all previous USDX minting accrual times and preforms a callback function
func (Keeper) IterateUSDXMintingClaims ¶
func (k Keeper) IterateUSDXMintingClaims(ctx sdk.Context, cb func(c types.USDXMintingClaim) (stop bool))
IterateUSDXMintingClaims iterates over all claim objects in the store and preforms a callback function
func (Keeper) IterateUSDXMintingRewardFactors ¶
func (k Keeper) IterateUSDXMintingRewardFactors(ctx sdk.Context, cb func(denom string, factor sdk.Dec) (stop bool))
IterateUSDXMintingRewardFactors iterates over all USDX Minting reward factor objects in the store and preforms a callback function
func (Keeper) SendTimeLockedCoinsToAccount ¶
func (k Keeper) SendTimeLockedCoinsToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error
SendTimeLockedCoinsToAccount sends time-locked coins from the input module account to the recipient. If the recipients account is not a vesting account and the input length is greater than zero, the recipient account is converted to a periodic vesting account and the coins are added to the vesting balance as a vesting period with the input length.
func (Keeper) SendTimeLockedCoinsToBaseAccount ¶
func (k Keeper) SendTimeLockedCoinsToBaseAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error
SendTimeLockedCoinsToBaseAccount sends time-locked coins from the input module account to the recipient, converting the recipient account to a vesting account
func (Keeper) SendTimeLockedCoinsToPeriodicVestingAccount ¶
func (k Keeper) SendTimeLockedCoinsToPeriodicVestingAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error
SendTimeLockedCoinsToPeriodicVestingAccount sends time-locked coins from the input module account to the recipient
func (Keeper) SetDelegatorClaim ¶
func (k Keeper) SetDelegatorClaim(ctx sdk.Context, c types.DelegatorClaim)
SetDelegatorClaim sets the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) SetDelegatorRewardIndexes ¶
func (k Keeper) SetDelegatorRewardIndexes(ctx sdk.Context, denom string, indexes types.RewardIndexes)
SetDelegatorRewardIndexes sets the current reward indexes for an individual denom
func (Keeper) SetJoltBorrowRewardIndexes ¶
func (k Keeper) SetJoltBorrowRewardIndexes(ctx sdk.Context, denom string, indexes types.RewardIndexes)
SetJoltBorrowRewardIndexes sets the current reward indexes for an individual denom
func (Keeper) SetJoltLiquidityProviderClaim ¶
func (k Keeper) SetJoltLiquidityProviderClaim(ctx sdk.Context, c types.JoltLiquidityProviderClaim)
SetJoltLiquidityProviderClaim sets the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) SetJoltSupplyRewardIndexes ¶
func (k Keeper) SetJoltSupplyRewardIndexes(ctx sdk.Context, denom string, indexes types.RewardIndexes)
SetJoltSupplyRewardIndexes sets the current reward indexes for an individual denom
func (Keeper) SetPreviousDelegatorRewardAccrualTime ¶
func (k Keeper) SetPreviousDelegatorRewardAccrualTime(ctx sdk.Context, denom string, blockTime time.Time)
SetPreviousDelegatorRewardAccrualTime sets the last time a denom accrued protocol delegator rewards
func (Keeper) SetPreviousJoltBorrowRewardAccrualTime ¶
func (k Keeper) SetPreviousJoltBorrowRewardAccrualTime(ctx sdk.Context, denom string, blockTime time.Time)
SetPreviousJoltBorrowRewardAccrualTime sets the last time a denom accrued Hard protocol borrow-side rewards
func (Keeper) SetPreviousJoltSupplyRewardAccrualTime ¶
func (k Keeper) SetPreviousJoltSupplyRewardAccrualTime(ctx sdk.Context, denom string, blockTime time.Time)
SetPreviousJoltSupplyRewardAccrualTime sets the last time a denom accrued Hard protocol supply-side rewards
func (Keeper) SetPreviousUSDXMintingAccrualTime ¶
func (k Keeper) SetPreviousUSDXMintingAccrualTime(ctx sdk.Context, ctype string, blockTime time.Time)
SetPreviousUSDXMintingAccrualTime sets the last time a collateral type accrued USDX minting rewards
func (Keeper) SetSavingsClaim ¶
func (k Keeper) SetSavingsClaim(ctx sdk.Context, c types.SavingsClaim)
SetSavingsClaim sets the claim in the store corresponding to the input address.
func (Keeper) SetSavingsRewardAccrualTime ¶
SetSavingsRewardAccrualTime stores the last time rewards were accrued for a savings deposit denom type
func (Keeper) SetSavingsRewardIndexes ¶
SetSavingsRewardIndexes stores the global reward indexes that rewards for an individual denom type
func (Keeper) SetSwapClaim ¶
SetSwapClaim sets the claim in the store corresponding to the input address.
func (Keeper) SetSwapRewardAccrualTime ¶
SetSwapRewardAccrualTime stores the last time rewards were accrued for a swap pool.
func (Keeper) SetSwapRewardIndexes ¶
SetSwapRewardIndexes stores the global reward indexes that track total rewards to a swap pool.
func (Keeper) SetUSDXMintingClaim ¶
func (k Keeper) SetUSDXMintingClaim(ctx sdk.Context, c types.USDXMintingClaim)
SetUSDXMintingClaim sets the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) SetUSDXMintingRewardFactor ¶
SetUSDXMintingRewardFactor sets the current reward factor for an individual collateral type
func (Keeper) SimulateHardSynchronization ¶
func (k Keeper) SimulateHardSynchronization(ctx sdk.Context, claim types.JoltLiquidityProviderClaim) types.JoltLiquidityProviderClaim
SimulateHardSynchronization calculates a user's outstanding jolt rewards by simulating reward synchronization
func (Keeper) SynchronizeJoltBorrowReward ¶
SynchronizeJoltBorrowReward updates the claim object by adding any accumulated rewards and updating the reward index value
func (Keeper) SynchronizeJoltLiquidityProviderClaim ¶
func (k Keeper) SynchronizeJoltLiquidityProviderClaim(ctx sdk.Context, owner sdk.AccAddress)
SynchronizeJoltLiquidityProviderClaim adds any accumulated rewards
func (Keeper) SynchronizeJoltSupplyReward ¶
SynchronizeJoltSupplyReward updates the claim object by adding any accumulated rewards and updating the reward index value
func (Keeper) UpdateJoltBorrowIndexDenoms ¶
UpdateJoltBorrowIndexDenoms adds or removes reward indexes from a claim to match the denoms in the borrow.