keeper

package
v5.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the marketmaker module.

func DepositRecordsInvariant

func DepositRecordsInvariant(k Keeper) sdk.Invariant

DepositRecordsInvariant checks that the invariants for pair of deposit records with not eligible market maker.

func DepositReservedAmountInvariant

func DepositReservedAmountInvariant(k Keeper) sdk.Invariant

DepositReservedAmountInvariant checks that the balance of StakingReserveAcc greater than the amount of staked, Queued coins in all staking objects.

func HandleMarketMakerProposal

func HandleMarketMakerProposal(ctx sdk.Context, k Keeper, proposal *types.MarketMakerProposal) error

HandleMarketMakerProposal is a handler for executing a market maker proposal.

func IncentiveReservedAmountInvariant

func IncentiveReservedAmountInvariant(k Keeper) sdk.Invariant

IncentiveReservedAmountInvariant checks that the balance of StakingReserveAcc greater than the amount of staked, Queued coins in all staking objects.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the marketmaker MsgServer interface for the provided Keeper.

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all marketmaker invariants.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper of the marketmaker store

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace,
	accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper,
) Keeper

NewKeeper returns a marketmaker keeper. It handles: - creating new ModuleAccounts for each pool ReserveAccount - sending to and from ModuleAccounts - minting, burning PoolCoins

func (Keeper) ApplyMarketMaker

func (k Keeper) ApplyMarketMaker(ctx sdk.Context, mmAddr sdk.AccAddress, pairIds []uint64) error

func (Keeper) ClaimIncentives

func (k Keeper) ClaimIncentives(ctx sdk.Context, mmAddr sdk.AccAddress) error

func (Keeper) DeleteDeposit

func (k Keeper) DeleteDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64)

DeleteDeposit deletes deposit object for a given address and pair id.

func (Keeper) DeleteIncentive

func (k Keeper) DeleteIncentive(ctx sdk.Context, mmAddr sdk.AccAddress)

DeleteIncentive deletes market maker claimable incentive for a given address.

func (Keeper) DeleteMarketMaker

func (k Keeper) DeleteMarketMaker(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64)

DeleteMarketMaker deletes market maker for a given address and pair id.

func (Keeper) DistributeMarketMakerIncentives

func (k Keeper) DistributeMarketMakerIncentives(ctx sdk.Context, proposals []types.IncentiveDistribution) error

DistributeMarketMakerIncentives is a handler for distribute incentives to eligible market makers.

func (Keeper) ExcludeMarketMakers

func (k Keeper) ExcludeMarketMakers(ctx sdk.Context, proposals []types.MarketMakerHandle) error

ExcludeMarketMakers is a handler for exclude eligible market makers.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the marketmaker module's genesis state.

func (Keeper) GetAllDepositRecords

func (k Keeper) GetAllDepositRecords(ctx sdk.Context) []types.DepositRecord

GetAllDepositRecords returns all deposit records

func (Keeper) GetAllDeposits

func (k Keeper) GetAllDeposits(ctx sdk.Context) []types.Deposit

GetAllDeposits returns all deposits

func (Keeper) GetAllIncentives

func (k Keeper) GetAllIncentives(ctx sdk.Context) []types.Incentive

GetAllIncentives returns all incentives

func (Keeper) GetAllMarketMakers

func (k Keeper) GetAllMarketMakers(ctx sdk.Context) []types.MarketMaker

GetAllMarketMakers returns all market makers

func (Keeper) GetCodec

func (k Keeper) GetCodec() codec.BinaryCodec

GetCodec returns codec.Codec object used by the keeper>

func (Keeper) GetDeposit

func (k Keeper) GetDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64) (mm types.Deposit, found bool)

GetDeposit returns market maker deposit object for a given address and pair id.

func (Keeper) GetIncentive

func (k Keeper) GetIncentive(ctx sdk.Context, mmAddr sdk.AccAddress) (incentive types.Incentive, found bool)

GetIncentive returns claimable incentive object for a given address.

func (Keeper) GetMarketMaker

func (k Keeper) GetMarketMaker(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64) (mm types.MarketMaker, found bool)

GetMarketMaker returns market maker object for a given address and pair id.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the parameters for the marketmaker module.

func (Keeper) IncludeMarketMakers

func (k Keeper) IncludeMarketMakers(ctx sdk.Context, proposals []types.MarketMakerHandle) error

IncludeMarketMakers is a handler for include applied and not eligible market makers.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)

InitGenesis initializes the marketmaker module's state from a given genesis state.

func (Keeper) IterateDepositRecords

func (k Keeper) IterateDepositRecords(ctx sdk.Context, cb func(idr types.DepositRecord) (stop bool))

IterateDepositRecords iterates through all deposits stored in the store and invokes callback function for each item. Stops the iteration when the callback function returns true.

func (Keeper) IterateDeposits

func (k Keeper) IterateDeposits(ctx sdk.Context, cb func(id types.Deposit) (stop bool))

IterateDeposits iterates through all apply deposits stored in the store and invokes callback function for each item. Stops the iteration when the callback function returns true.

func (Keeper) IterateIncentives

func (k Keeper) IterateIncentives(ctx sdk.Context, cb func(incentive types.Incentive) (stop bool))

IterateIncentives iterates through all incentives stored in the store and invokes callback function for each item. Stops the iteration when the callback function returns true.

func (Keeper) IterateMarketMakers

func (k Keeper) IterateMarketMakers(ctx sdk.Context, cb func(mm types.MarketMaker) (stop bool))

IterateMarketMakers iterates through all market makers stored in the store and invokes callback function for each item. Stops the iteration when the callback function returns true.

func (Keeper) IterateMarketMakersByAddr

func (k Keeper) IterateMarketMakersByAddr(ctx sdk.Context, mmAddr sdk.AccAddress, cb func(mm types.MarketMaker) (stop bool))

IterateMarketMakersByAddr iterates through all market makers by an address stored in the store and invokes callback function for each item. Stops the iteration when the callback function returns true.

func (Keeper) IterateMarketMakersByPairId

func (k Keeper) IterateMarketMakersByPairId(ctx sdk.Context, pairId uint64, cb func(mm types.MarketMaker) (stop bool))

IterateMarketMakersByPairId iterates through all market makers by an pair id stored in the store and invokes callback function for each item. Stops the iteration when the callback function returns true.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) RefundDeposit

func (k Keeper) RefundDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64) error

RefundDeposit is a handler for refund deposit amount and delete deposit object.

func (Keeper) RejectMarketMakers

func (k Keeper) RejectMarketMakers(ctx sdk.Context, proposals []types.MarketMakerHandle) error

RejectMarketMakers is a handler for reject applied and not eligible market makers.

func (Keeper) SetDeposit

func (k Keeper) SetDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64, amount sdk.Coins)

SetDeposit sets a deposit.

func (Keeper) SetIncentive

func (k Keeper) SetIncentive(ctx sdk.Context, incentive types.Incentive)

SetIncentive sets claimable incentive.

func (Keeper) SetMarketMaker

func (k Keeper) SetMarketMaker(ctx sdk.Context, mm types.MarketMaker)

SetMarketMaker sets a market maker.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the parameters for the marketmaker module.

func (Keeper) ValidateDepositReservedAmount

func (k Keeper) ValidateDepositReservedAmount(ctx sdk.Context) error

func (Keeper) ValidateIncentiveReservedAmount

func (k Keeper) ValidateIncentiveReservedAmount(ctx sdk.Context, incentives []types.Incentive) error

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.

func (Querier) Incentive

Incentive queries all queued stakings of the farmer.

func (Querier) MarketMakers

MarketMakers queries all market makers.

func (Querier) Params

Params queries the parameters of the marketmaker module.

Jump to

Keyboard shortcuts

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