strategies

package
v0.0.0-...-1350c8b Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceOfNfts

type BalanceOfNfts struct {
	shared.StrategyStruct
	DB *shared.Database
}

func (*BalanceOfNfts) FetchBalance

func (b *BalanceOfNfts) FetchBalance(
	balance *models.Balance,
	p *models.Proposal,
) (*models.Balance, error)

func (*BalanceOfNfts) GetVoteWeightForBalance

func (b *BalanceOfNfts) GetVoteWeightForBalance(vote *models.VoteWithBalance, proposal *models.Proposal) (float64, error)

func (*BalanceOfNfts) GetVotes

func (b *BalanceOfNfts) GetVotes(
	votes []*models.VoteWithBalance,
	proposal *models.Proposal,
) ([]*models.VoteWithBalance, error)

func (*BalanceOfNfts) InitStrategy

func (b *BalanceOfNfts) InitStrategy(
	f *shared.FlowAdapter,
	db *shared.Database,
)

func (*BalanceOfNfts) RequiresSnapshot

func (b *BalanceOfNfts) RequiresSnapshot() bool

func (*BalanceOfNfts) TallyVotes

type CustomScript

type CustomScript struct {
	shared.StrategyStruct
	DB *shared.Database
}

func (*CustomScript) FetchBalance

func (cs *CustomScript) FetchBalance(
	balance *models.Balance,
	p *models.Proposal,
) (*models.Balance, error)

func (*CustomScript) GetVoteWeightForBalance

func (cs *CustomScript) GetVoteWeightForBalance(
	vote *models.VoteWithBalance,
	proposal *models.Proposal,
) (float64, error)

func (*CustomScript) GetVotes

func (cs *CustomScript) GetVotes(
	votes []*models.VoteWithBalance,
	proposal *models.Proposal,
) ([]*models.VoteWithBalance, error)

func (*CustomScript) InitStrategy

func (cs *CustomScript) InitStrategy(
	f *shared.FlowAdapter,
	db *shared.Database,
)

func (*CustomScript) RequiresSnapshot

func (cs *CustomScript) RequiresSnapshot() bool

func (*CustomScript) TallyVotes

func (cs *CustomScript) TallyVotes(
	votes []*models.VoteWithBalance,
	r *models.ProposalResults,
	proposal *models.Proposal,
) (models.ProposalResults, error)

type FloatNFTs

type FloatNFTs struct {
	shared.StrategyStruct
	DB *shared.Database
}

func (*FloatNFTs) FetchBalance

func (f *FloatNFTs) FetchBalance(
	balance *models.Balance,
	p *models.Proposal,
) (*models.Balance, error)

func (*FloatNFTs) GetVoteWeightForBalance

func (f *FloatNFTs) GetVoteWeightForBalance(vote *models.VoteWithBalance, proposal *models.Proposal) (float64, error)

func (*FloatNFTs) GetVotes

func (f *FloatNFTs) GetVotes(
	votes []*models.VoteWithBalance,
	proposal *models.Proposal,
) ([]*models.VoteWithBalance, error)

func (*FloatNFTs) InitStrategy

func (f *FloatNFTs) InitStrategy(
	fa *shared.FlowAdapter,
	db *shared.Database,
)

func (*FloatNFTs) RequiresSnapshot

func (f *FloatNFTs) RequiresSnapshot() bool

func (*FloatNFTs) TallyVotes

func (f *FloatNFTs) TallyVotes(
	votes []*models.VoteWithBalance,
	r *models.ProposalResults,
	proposal *models.Proposal,
) (models.ProposalResults, error)

type OneAddressOneVote

type OneAddressOneVote struct {
	s.StrategyStruct
	DB *s.Database
}

func (*OneAddressOneVote) FetchBalance

func (s *OneAddressOneVote) FetchBalance(
	b *models.Balance,
	p *models.Proposal,
) (*models.Balance, error)

func (*OneAddressOneVote) GetVoteWeightForBalance

func (s *OneAddressOneVote) GetVoteWeightForBalance(
	vote *models.VoteWithBalance,
	proposal *models.Proposal,
) (float64, error)

func (*OneAddressOneVote) GetVotes

func (s *OneAddressOneVote) GetVotes(
	votes []*models.VoteWithBalance,
	proposal *models.Proposal,
) ([]*models.VoteWithBalance, error)

func (*OneAddressOneVote) InitStrategy

func (s *OneAddressOneVote) InitStrategy(
	f *shared.FlowAdapter,
	db *shared.Database,
)

func (*OneAddressOneVote) RequiresSnapshot

func (s *OneAddressOneVote) RequiresSnapshot() bool

func (*OneAddressOneVote) TallyVotes

type StakedTokenWeightedDefault

type StakedTokenWeightedDefault struct {
	s.StrategyStruct
	DB *s.Database
}

func (*StakedTokenWeightedDefault) FetchBalance

func (*StakedTokenWeightedDefault) FetchBalanceFromSnapshot

func (s *StakedTokenWeightedDefault) FetchBalanceFromSnapshot(
	strategy *models.Strategy,
	b *models.Balance,
) error

func (*StakedTokenWeightedDefault) GetVoteWeightForBalance

func (s *StakedTokenWeightedDefault) GetVoteWeightForBalance(
	vote *models.VoteWithBalance,
	proposal *models.Proposal,
) (float64, error)

func (*StakedTokenWeightedDefault) GetVotes

func (s *StakedTokenWeightedDefault) GetVotes(
	votes []*models.VoteWithBalance,
	proposal *models.Proposal,
) ([]*models.VoteWithBalance, error)

func (*StakedTokenWeightedDefault) InitStrategy

func (s *StakedTokenWeightedDefault) InitStrategy(
	f *shared.FlowAdapter,
	db *shared.Database,
)

func (*StakedTokenWeightedDefault) RequiresSnapshot

func (s *StakedTokenWeightedDefault) RequiresSnapshot() bool

func (*StakedTokenWeightedDefault) TallyVotes

type TokenWeightedDefault

type TokenWeightedDefault struct {
	s.StrategyStruct
	DB *s.Database
}

func (*TokenWeightedDefault) FetchBalance

func (s *TokenWeightedDefault) FetchBalance(
	b *models.Balance,
	p *models.Proposal,
) (*models.Balance, error)

func (*TokenWeightedDefault) FetchBalanceFromSnapshot

func (s *TokenWeightedDefault) FetchBalanceFromSnapshot(
	strategy *models.Strategy,
	b *models.Balance,
) error

func (*TokenWeightedDefault) GetVoteWeightForBalance

func (s *TokenWeightedDefault) GetVoteWeightForBalance(
	vote *models.VoteWithBalance,
	proposal *models.Proposal,
) (float64, error)

func (*TokenWeightedDefault) GetVotes

func (s *TokenWeightedDefault) GetVotes(
	votes []*models.VoteWithBalance,
	proposal *models.Proposal,
) ([]*models.VoteWithBalance, error)

func (*TokenWeightedDefault) InitStrategy

func (s *TokenWeightedDefault) InitStrategy(
	f *shared.FlowAdapter,
	db *shared.Database,
)

func (*TokenWeightedDefault) RequiresSnapshot

func (s *TokenWeightedDefault) RequiresSnapshot() bool

func (*TokenWeightedDefault) TallyVotes

type TotalTokenWeightedDefault

type TotalTokenWeightedDefault struct {
	s.StrategyStruct
	DB *s.Database
}

func (*TotalTokenWeightedDefault) FetchBalance

func (s *TotalTokenWeightedDefault) FetchBalance(
	b *models.Balance,
	p *models.Proposal,
) (*models.Balance, error)

func (*TotalTokenWeightedDefault) FetchBalanceFromSnapshot

func (s *TotalTokenWeightedDefault) FetchBalanceFromSnapshot(
	strategy *models.Strategy,
	b *models.Balance,
) error

func (*TotalTokenWeightedDefault) GetVoteWeightForBalance

func (s *TotalTokenWeightedDefault) GetVoteWeightForBalance(
	vote *models.VoteWithBalance,
	proposal *models.Proposal,
) (float64, error)

func (*TotalTokenWeightedDefault) GetVotes

func (s *TotalTokenWeightedDefault) GetVotes(
	votes []*models.VoteWithBalance,
	proposal *models.Proposal,
) ([]*models.VoteWithBalance, error)

func (*TotalTokenWeightedDefault) InitStrategy

func (s *TotalTokenWeightedDefault) InitStrategy(
	f *shared.FlowAdapter,
	db *shared.Database,
)

func (*TotalTokenWeightedDefault) RequiresSnapshot

func (s *TotalTokenWeightedDefault) RequiresSnapshot() bool

func (*TotalTokenWeightedDefault) TallyVotes

Jump to

Keyboard shortcuts

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