alliance_provider

package
v0.0.0-...-f03262a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL