Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func DepositRecordsInvariant(k Keeper) sdk.Invariant
- func DepositReservedAmountInvariant(k Keeper) sdk.Invariant
- func HandleMarketMakerProposal(ctx sdk.Context, k Keeper, proposal *types.MarketMakerProposal) error
- func IncentiveReservedAmountInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Keeper
- func (k Keeper) ApplyMarketMaker(ctx sdk.Context, mmAddr sdk.AccAddress, pairIds []uint64) error
- func (k Keeper) ClaimIncentives(ctx sdk.Context, mmAddr sdk.AccAddress) error
- func (k Keeper) DeleteDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64)
- func (k Keeper) DeleteIncentive(ctx sdk.Context, mmAddr sdk.AccAddress)
- func (k Keeper) DeleteMarketMaker(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64)
- func (k Keeper) DistributeMarketMakerIncentives(ctx sdk.Context, proposals []types.IncentiveDistribution) error
- func (k Keeper) ExcludeMarketMakers(ctx sdk.Context, proposals []types.MarketMakerHandle) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllDepositRecords(ctx sdk.Context) []types.DepositRecord
- func (k Keeper) GetAllDeposits(ctx sdk.Context) []types.Deposit
- func (k Keeper) GetAllIncentives(ctx sdk.Context) []types.Incentive
- func (k Keeper) GetAllMarketMakers(ctx sdk.Context) []types.MarketMaker
- func (k Keeper) GetCodec() codec.BinaryCodec
- func (k Keeper) GetDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64) (mm types.Deposit, found bool)
- func (k Keeper) GetIncentive(ctx sdk.Context, mmAddr sdk.AccAddress) (incentive types.Incentive, found bool)
- func (k Keeper) GetMarketMaker(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64) (mm types.MarketMaker, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) IncludeMarketMakers(ctx sdk.Context, proposals []types.MarketMakerHandle) error
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IterateDepositRecords(ctx sdk.Context, cb func(idr types.DepositRecord) (stop bool))
- func (k Keeper) IterateDeposits(ctx sdk.Context, cb func(id types.Deposit) (stop bool))
- func (k Keeper) IterateIncentives(ctx sdk.Context, cb func(incentive types.Incentive) (stop bool))
- func (k Keeper) IterateMarketMakers(ctx sdk.Context, cb func(mm types.MarketMaker) (stop bool))
- func (k Keeper) IterateMarketMakersByAddr(ctx sdk.Context, mmAddr sdk.AccAddress, ...)
- func (k Keeper) IterateMarketMakersByPairId(ctx sdk.Context, pairId uint64, cb func(mm types.MarketMaker) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RefundDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64) error
- func (k Keeper) RejectMarketMakers(ctx sdk.Context, proposals []types.MarketMakerHandle) error
- func (k Keeper) SetDeposit(ctx sdk.Context, mmAddr sdk.AccAddress, pairId uint64, amount sdk.Coins)
- func (k Keeper) SetIncentive(ctx sdk.Context, incentive types.Incentive)
- func (k Keeper) SetMarketMaker(ctx sdk.Context, mm types.MarketMaker)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) ValidateDepositReservedAmount(ctx sdk.Context) error
- func (k Keeper) ValidateIncentiveReservedAmount(ctx sdk.Context, incentives []types.Incentive) error
- type Querier
- func (k Querier) Incentive(c context.Context, req *types.QueryIncentiveRequest) (*types.QueryIncentiveResponse, error)
- func (k Querier) MarketMakers(c context.Context, req *types.QueryMarketMakersRequest) (*types.QueryMarketMakersResponse, error)
- func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the marketmaker module.
func DepositRecordsInvariant ¶
DepositRecordsInvariant checks that the invariants for pair of deposit records with not eligible market maker.
func DepositReservedAmountInvariant ¶
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 ¶
IncentiveReservedAmountInvariant checks that the balance of StakingReserveAcc greater than the amount of staked, Queued coins in all staking objects.
func NewMsgServerImpl ¶
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 (Keeper) ClaimIncentives ¶
func (Keeper) DeleteDeposit ¶
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 ¶
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 ¶
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 ¶
GetAllDeposits returns all deposits
func (Keeper) GetAllIncentives ¶
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) IncludeMarketMakers ¶
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 ¶
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 ¶
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 ¶
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) RefundDeposit ¶
RefundDeposit is a handler for refund deposit amount and delete deposit object.
func (Keeper) RejectMarketMakers ¶
RejectMarketMakers is a handler for reject applied and not eligible market makers.
func (Keeper) SetDeposit ¶
SetDeposit sets a deposit.
func (Keeper) SetIncentive ¶
SetIncentive sets claimable incentive.
func (Keeper) SetMarketMaker ¶
func (k Keeper) SetMarketMaker(ctx sdk.Context, mm types.MarketMaker)
SetMarketMaker sets a market maker.
func (Keeper) ValidateDepositReservedAmount ¶
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 ¶
func (k Querier) Incentive(c context.Context, req *types.QueryIncentiveRequest) (*types.QueryIncentiveResponse, error)
Incentive queries all queued stakings of the farmer.
func (Querier) MarketMakers ¶
func (k Querier) MarketMakers(c context.Context, req *types.QueryMarketMakersRequest) (*types.QueryMarketMakersResponse, error)
MarketMakers queries all market makers.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the parameters of the marketmaker module.