Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type AmmHooks
- func (h AmmHooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, ...)
- func (h AmmHooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, ...)
- func (h AmmHooks) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool)
- func (h AmmHooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, input sdk.Coins, ...)
- type CommitmentHooks
- type Hooks
- type Keeper
- func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64)
- func (k Keeper) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount sdk.Int, ...)
- func (k Keeper) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, ...)
- func (k Keeper) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
- func (k Keeper) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, ...)
- func (k Keeper) AmmHooks() AmmHooks
- func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
- func (k Keeper) CalculateDelegatedAmount(ctx sdk.Context, delegator string) sdk.Int
- func (k Keeper) CalculateEdenBoostRewards(ctx sdk.Context, delegatedAmt sdk.Int, commitments ctypes.Commitments, ...) sdk.Int
- func (k Keeper) CalculateEpochCountsPerYear(epochIdentifier string) int64
- func (k Keeper) CalculateProxyTVL(ctx sdk.Context) sdk.Dec
- func (k Keeper) CalculateRewardsForLPs(ctx sdk.Context, totalProxyTVL sdk.Dec, commitments ctypes.Commitments, ...) (sdk.Int, sdk.Int)
- func (k Keeper) CalculateRewardsForStakers(ctx sdk.Context, delegatedAmt sdk.Int, commitments ctypes.Commitments, ...) (sdk.Int, sdk.Int, sdk.Dec)
- func (k Keeper) CalculateTVL(ctx sdk.Context) sdk.Dec
- func (k Keeper) CalculateTotalShareOfStaking(amount sdk.Int) sdk.Dec
- func (k Keeper) CollectDEXRevenue(ctx sdk.Context) (sdk.Coins, sdk.DecCoins)
- func (k Keeper) CollectGasFeesToIncentiveModule(ctx sdk.Context) sdk.Coins
- func (k Keeper) CommitmentChanged(ctx sdk.Context, creator string, amount sdk.Coin)
- func (k Keeper) CommitmentHooks() CommitmentHooks
- func (k Keeper) CommunityPool(goCtx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error)
- func (k Keeper) DistributeFromFeePool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FindPool(ctx sdk.Context, in_denom string, out_denom string) (ammtypes.Pool, bool)
- func (k Keeper) GetCommunityTax(ctx sdk.Context) (percent sdk.Dec)
- func (k Keeper) GetDEXRewardPortionForLPs(ctx sdk.Context) (percent sdk.Dec)
- func (k Keeper) GetFeePool(ctx sdk.Context) (feePool types.FeePool)
- func (k Keeper) GetFeePoolCommunityCoins(ctx sdk.Context) sdk.DecCoins
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPoolInfo(ctx sdk.Context, poolId uint64) (types.PoolInfo, bool)
- func (k Keeper) GetProperIncentiveParam(ctx sdk.Context, epochIdentifier string) (bool, types.IncentiveInfo, types.IncentiveInfo)
- func (k Keeper) GetWithdrawAddrEnabled(ctx sdk.Context) (enabled bool)
- func (k Keeper) GiveCommissionToValidators(ctx sdk.Context, delegator string, totalDelegationAmt sdk.Int, ...) (sdk.Int, sdk.Int)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) InitPoolMultiplier(ctx sdk.Context, poolId uint64) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ProcessWithdrawRewards(ctx sdk.Context, delegator string) error
- func (k Keeper) ProcessWithdrawValidatorCommission(ctx sdk.Context, delegator string, validator string) error
- func (k Keeper) SetFeePool(ctx sdk.Context, feePool types.FeePool)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) StakingHooks() StakingHooks
- func (k Keeper) UpdateCommitments(ctx sdk.Context, creator string, commitments *ctypes.Commitments, ...)
- func (k Keeper) UpdateCommunityPool(ctx sdk.Context, amt sdk.DecCoins) sdk.DecCoins
- func (k Keeper) UpdatePoolMultipliers(ctx sdk.Context, poolMultipliers []types.PoolMultipliers) bool
- func (k Keeper) UpdateTokensCommitment(commitments *ctypes.Commitments, new_uncommitted_eden_tokens sdk.Int, ...)
- func (k Keeper) UpdateTokensForValidator(ctx sdk.Context, validator string, new_uncommitted_eden_tokens sdk.Int, ...)
- func (k Keeper) UpdateTotalCommitmentInfo(ctx sdk.Context)
- func (k Keeper) UpdateUncommittedTokens(ctx sdk.Context, epochIdentifier string, stakeIncentive types.IncentiveInfo, ...)
- type StakingHooks
- func (h StakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error
- func (h StakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type AmmHooks ¶
type AmmHooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentive keeper
func (AmmHooks) AfterExitPool ¶
func (h AmmHooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, shareInAmount sdk.Int, exitCoins sdk.Coins)
AfterExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut
func (AmmHooks) AfterJoinPool ¶
func (h AmmHooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, enterCoins sdk.Coins, shareOutAmount sdk.Int)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (AmmHooks) AfterPoolCreated ¶
AfterPoolCreated is called after CreatePool
type CommitmentHooks ¶
type CommitmentHooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentive keeper
func (CommitmentHooks) CommitmentChanged ¶
CommitmentChanged implements CommentmentHook
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentive keeper
func (Hooks) AfterEpochEnd ¶
AfterEpochEnd implements EpochHooks
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, ck types.CommitmentKeeper, sk types.StakingKeeper, ak types.AccountKeeper, bk types.BankKeeper, amm types.AmmKeeper, ok types.OracleKeeper, feeCollectorName string, dexRevCollectorName string, ) *Keeper
func (Keeper) AfterDelegationModified ¶
func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
Updating commitments on delegation changes
func (Keeper) AfterEpochEnd ¶
AfterEpochEnd distributes vested tokens at the end of each epoch
func (Keeper) AfterExitPool ¶
func (k Keeper) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount sdk.Int, exitCoins sdk.Coins)
AfterExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut
func (Keeper) AfterJoinPool ¶
func (k Keeper) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, shareOutAmount sdk.Int)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (Keeper) AfterPoolCreated ¶
AfterPoolCreated is called after CreatePool
func (Keeper) AfterSwap ¶
func (k Keeper) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, output sdk.Coins)
AfterSwap is called after SwapExactAmountIn and SwapExactAmountOut
func (Keeper) BeforeDelegationCreated ¶
func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
Creating a commitment object for a delegator if one does not exist:
func (Keeper) BeforeDelegationRemoved ¶
func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Keeper) BeforeDelegationSharesModified ¶
func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Keeper) BeforeEpochStart ¶
BeforeEpochStart performs a no-op
func (Keeper) CalculateDelegatedAmount ¶
Calculate the delegated amount
func (Keeper) CalculateEdenBoostRewards ¶
func (k Keeper) CalculateEdenBoostRewards(ctx sdk.Context, delegatedAmt sdk.Int, commitments ctypes.Commitments, epochIdentifier string, edenBoostAPR int64) sdk.Int
Calculate new Eden-Boost token amounts based on the given conditions and user's current uncommitted token balance
func (Keeper) CalculateEpochCountsPerYear ¶
Calculate epoch counts per year to be used in APR calculation
func (Keeper) CalculateProxyTVL ¶
Calculate Proxy TVL
func (Keeper) CalculateRewardsForLPs ¶
func (k Keeper) CalculateRewardsForLPs(ctx sdk.Context, totalProxyTVL sdk.Dec, commitments ctypes.Commitments, edenAmountPerEpochLp sdk.Int, gasFeesForLPs sdk.Dec) (sdk.Int, sdk.Int)
Calculate new Eden token amounts based on LpElys committed and MElys committed
func (Keeper) CalculateRewardsForStakers ¶
func (k Keeper) CalculateRewardsForStakers(ctx sdk.Context, delegatedAmt sdk.Int, commitments ctypes.Commitments, edenAmountPerEpoch sdk.Int, dexRevenueAmtForStakers sdk.Dec) (sdk.Int, sdk.Int, sdk.Dec)
Calculate new Eden token amounts based on the given conditions and user's current uncommitted token balance
func (Keeper) CalculateTVL ¶
Caculate total TVL
func (Keeper) CalculateTotalShareOfStaking ¶
Calculate total share of staking
func (Keeper) CollectDEXRevenue ¶
Collect all DEX revenues to DEX revenue wallet, while tracking the 65% of it for LPs reward distribution transfer collected fees from different wallets(liquidity pool, margin module etc) to the distribution module account Assume this is already in USDC. TODO: + Collect revenue from margin, lend module
func (Keeper) CollectGasFeesToIncentiveModule ¶
Move gas fees collected to dex revenue wallet Convert it into USDC
func (Keeper) CommitmentChanged ¶
Process commitmentChanged hook
func (Keeper) CommitmentHooks ¶
func (k Keeper) CommitmentHooks() CommitmentHooks
Return the wrapper struct
func (Keeper) CommunityPool ¶
func (k Keeper) CommunityPool(goCtx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error)
func (Keeper) DistributeFromFeePool ¶
func (k Keeper) DistributeFromFeePool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error
DistributeFromFeePool distributes funds from the distribution module account to a receiver address while updating the community pool
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the module's exported genesis
func (Keeper) FindPool ¶
FindPool function gets a pool that can convert in_denom token to out_denom token TODO: Later on: add a logic to choose best pool
func (Keeper) GetCommunityTax ¶
GetCommunityTax returns the current distribution community tax.
func (Keeper) GetDEXRewardPortionForLPs ¶
GetDEXRewardPortionForLPs returns the dex revenue percent for Lps
func (Keeper) GetFeePool ¶
get the global fee pool distribution info
func (Keeper) GetFeePoolCommunityCoins ¶
get the community coins
func (Keeper) GetPoolInfo ¶
GetPoolInfo
func (Keeper) GetProperIncentiveParam ¶
func (k Keeper) GetProperIncentiveParam(ctx sdk.Context, epochIdentifier string) (bool, types.IncentiveInfo, types.IncentiveInfo)
Find out active incentive params
func (Keeper) GetWithdrawAddrEnabled ¶
GetWithdrawAddrEnabled returns the current distribution withdraw address enabled parameter.
func (Keeper) GiveCommissionToValidators ¶
func (k Keeper) GiveCommissionToValidators(ctx sdk.Context, delegator string, totalDelegationAmt sdk.Int, newUncommittedAmt sdk.Int, dexRewards sdk.Dec) (sdk.Int, sdk.Int)
Give commissions to validators
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis initializes the module's state from a provided genesis state.
func (Keeper) InitPoolMultiplier ¶
InitPoolMultiplier: create a pool information responding to the pool creation.
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) ProcessWithdrawRewards ¶
withdraw rewards Eden, EdenBoost and Elys to USDC
func (Keeper) ProcessWithdrawValidatorCommission ¶
func (k Keeper) ProcessWithdrawValidatorCommission(ctx sdk.Context, delegator string, validator string) error
Withdraw validator commission Eden, EdenBoost and USDC
func (Keeper) SetFeePool ¶
set the global fee pool distribution info
func (Keeper) UpdateCommitments ¶
func (Keeper) UpdateCommunityPool ¶
Fund community pool based on community tax
func (Keeper) UpdatePoolMultipliers ¶
func (k Keeper) UpdatePoolMultipliers(ctx sdk.Context, poolMultipliers []types.PoolMultipliers) bool
UpdatePoolMultipliers updates pool multipliers through gov proposal
func (Keeper) UpdateTokensCommitment ¶
func (k Keeper) UpdateTokensCommitment(commitments *ctypes.Commitments, new_uncommitted_eden_tokens sdk.Int, denom string)
Update the uncommitted Eden token balance
func (Keeper) UpdateTokensForValidator ¶
func (k Keeper) UpdateTokensForValidator(ctx sdk.Context, validator string, new_uncommitted_eden_tokens sdk.Int, dexRewards sdk.Dec)
Increase uncommitted token amount for the corresponding validator
func (Keeper) UpdateTotalCommitmentInfo ¶
Update total commitment info
func (Keeper) UpdateUncommittedTokens ¶
func (k Keeper) UpdateUncommittedTokens(ctx sdk.Context, epochIdentifier string, stakeIncentive types.IncentiveInfo, lpIncentive types.IncentiveInfo)
Update uncommitted token amount Called back through epoch hook
type StakingHooks ¶
type StakingHooks struct {
// contains filtered or unexported fields
}
StakingHooks wrapper struct for slashing keeper
func (StakingHooks) AfterDelegationModified ¶
func (h StakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (StakingHooks) AfterUnbondingInitiated ¶
func (h StakingHooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error
staking StakingHooks Must be called when a validator is created
func (StakingHooks) AfterValidatorBeginUnbonding ¶
func (h StakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
Must be called when a validator begins unbonding
func (StakingHooks) AfterValidatorBonded ¶
func (h StakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
Must be called when a validator is bonded
func (StakingHooks) AfterValidatorCreated ¶
func (h StakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
staking StakingHooks Must be called when a validator is created
func (StakingHooks) AfterValidatorRemoved ¶
func (h StakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
Must be called when a validator is deleted
func (StakingHooks) BeforeDelegationCreated ¶
func (h StakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
Must be called when a delegation is created
func (StakingHooks) BeforeDelegationRemoved ¶
func (h StakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
Must be called when a delegation is removed
func (StakingHooks) BeforeDelegationSharesModified ¶
func (h StakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
Must be called when a delegation's shares are modified
func (StakingHooks) BeforeValidatorModified ¶
func (h StakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
Must be called when a validator's state changes
func (StakingHooks) BeforeValidatorSlashed ¶
func (h StakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error