Documentation ¶
Index ¶
- func FilterAllianceValsWithStake(allianceVals []alliancetypes.QueryAllianceValidatorResponse, ...) ([]types.ValWithAllianceTokensStake, sdktypes.Dec)
- func NewAllianceProtocolsInfo(config *config.AllianceConfig, providerManager *provider.ProviderManager) *allianceProtocolsInfo
- func NewAllianceProvider(config *config.AllianceConfig, providerManager *provider.ProviderManager) *allianceProvider
- func NewAllianceValidatorsProvider(config *config.AllianceConfig, providerManager *provider.ProviderManager) *allianceValidatorsProvider
- func NewAlliancesQuerierProvider(feederType types.FeederType) *alliancesQuerierProvider
- func ParseAllianceValsByCompliance(compliantVals []stakingtypes.Validator, ...) ([]types.ValWithAllianceTokensStake, []types.ValWithAllianceTokensStake)
- func RebalanceVals(compVal []types.ValWithAllianceTokensStake, ...) []types.Redelegation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterAllianceValsWithStake ¶
func FilterAllianceValsWithStake(allianceVals []alliancetypes.QueryAllianceValidatorResponse, allianceTokenDenom string) ([]types.ValWithAllianceTokensStake, sdktypes.Dec)
Filter the alliance validators to keep only the ones that have staked ualliance tokens
func NewAllianceProtocolsInfo ¶
func NewAllianceProtocolsInfo(config *config.AllianceConfig, providerManager *provider.ProviderManager) *allianceProtocolsInfo
func NewAllianceProvider ¶
func NewAllianceProvider(config *config.AllianceConfig, providerManager *provider.ProviderManager) *allianceProvider
func NewAllianceValidatorsProvider ¶
func NewAllianceValidatorsProvider(config *config.AllianceConfig, providerManager *provider.ProviderManager) *allianceValidatorsProvider
func NewAlliancesQuerierProvider ¶
func NewAlliancesQuerierProvider(feederType types.FeederType) *alliancesQuerierProvider
func ParseAllianceValsByCompliance ¶
func ParseAllianceValsByCompliance( compliantVals []stakingtypes.Validator, valsWithAllianceTokens []types.ValWithAllianceTokensStake, allianceTokenDenom string, ) ([]types.ValWithAllianceTokensStake, []types.ValWithAllianceTokensStake)
Method to split the list of alliance validators in two subsets:
compliantValsWithAllianceTokens: validatos that comply with the rules described below the method GetAllianceRedelegateReq with the stake to zero if has no stake.
nonCompliantValsWithAllianceTokens: the ones that does not complie with the rules in this subset should never exist validators with zero stake,
func RebalanceVals ¶
func RebalanceVals( compVal []types.ValWithAllianceTokensStake, nonCompVals []types.ValWithAllianceTokensStake, avgTokensPerComplVal sdktypes.Dec, ) []types.Redelegation
In charge of rebalancing the stake from non-compliant validators to compliant ones. - Non-compliant validators should end with 0 stake at the end of function execution. - Compliant validators shouldn't have more than the average amout of stake (avgTokensPerComplVal). - If any compliant validator has more than the average amout of stake, re-balance to other compliant validators.
Types ¶
This section is empty.