Documentation ¶
Index ¶
- func HandleLiquidFarmCreateProposal(ctx sdk.Context, k Keeper, p *types.LiquidFarmCreateProposal) error
- func HandleLiquidFarmParameterChangeProposal(ctx sdk.Context, k Keeper, p *types.LiquidFarmParameterChangeProposal) error
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AdvanceRewardsAuctions(ctx sdk.Context, nextEndTime time.Time) (err error)
- func (k Keeper) BurnShare(ctx sdk.Context, senderAddr sdk.AccAddress, liquidFarmId uint64, ...) (removedLiquidity sdk.Int, position ammtypes.Position, amt sdk.Coins, err error)
- func (k Keeper) CreateLiquidFarm(ctx sdk.Context, poolId uint64, lowerPrice, upperPrice sdk.Dec, ...) (liquidFarm types.LiquidFarm, err error)
- func (k Keeper) DeleteBid(ctx sdk.Context, bid types.Bid)
- func (k Keeper) DeleteLiquidFarm(ctx sdk.Context, liquidFarm types.LiquidFarm)
- func (k Keeper) DeleteRewardsAuction(ctx sdk.Context, auction types.RewardsAuction)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FinishRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm, auction types.RewardsAuction) error
- func (k Keeper) GetAllBids(ctx sdk.Context) (bids []types.Bid)
- func (k Keeper) GetAllLiquidFarms(ctx sdk.Context) (liquidFarms []types.LiquidFarm)
- func (k Keeper) GetAllRewardsAuctions(ctx sdk.Context) (auctions []types.RewardsAuction)
- func (k Keeper) GetBid(ctx sdk.Context, liquidFarmId, auctionId uint64, bidderAddr sdk.AccAddress) (bid types.Bid, found bool)
- func (k Keeper) GetLastLiquidFarmId(ctx sdk.Context) uint64
- func (k Keeper) GetLastRewardsAuction(ctx sdk.Context, liquidFarmId uint64) (auction types.RewardsAuction, found bool)
- func (k Keeper) GetLiquidFarm(ctx sdk.Context, liquidFarmId uint64) (liquidFarm types.LiquidFarm, found bool)
- func (k Keeper) GetLiquidFarmPosition(ctx sdk.Context, liquidFarm types.LiquidFarm) (position ammtypes.Position, found bool)
- func (k Keeper) GetMaxNumRecentRewardsAuctions(ctx sdk.Context) (maxNum uint32)
- func (k Keeper) GetNextLiquidFarmIdWithUpdate(ctx sdk.Context) uint64
- func (k Keeper) GetNextRewardsAuctionEndTime(ctx sdk.Context) (t time.Time, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPreviousRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm) (auction types.RewardsAuction, found bool)
- func (k Keeper) GetRewardsAuction(ctx sdk.Context, liquidFarmId, auctionId uint64) (auction types.RewardsAuction, found bool)
- func (k Keeper) GetRewardsAuctionDuration(ctx sdk.Context) (duration time.Duration)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IterateAllBids(ctx sdk.Context, cb func(bid types.Bid) (stop bool))
- func (k Keeper) IterateAllLiquidFarms(ctx sdk.Context, cb func(liquidFarm types.LiquidFarm) (stop bool))
- func (k Keeper) IterateAllRewardsAuctions(ctx sdk.Context, cb func(auction types.RewardsAuction) (stop bool))
- func (k Keeper) IterateBidsByRewardsAuction(ctx sdk.Context, liquidFarmId, auctionId uint64, ...)
- func (k Keeper) IterateRewardsAuctionsByLiquidFarm(ctx sdk.Context, liquidFarmId uint64, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) LookupLiquidFarm(ctx sdk.Context, liquidFarmId uint64) (found bool)
- func (k Keeper) LookupRewardsAuction(ctx sdk.Context, liquidFarmId, auctionId uint64) (found bool)
- func (k Keeper) MintShare(ctx sdk.Context, senderAddr sdk.AccAddress, liquidFarmId uint64, ...) (mintedShare sdk.Coin, position ammtypes.Position, liquidity sdk.Int, ...)
- func (k Keeper) MustGetLiquidFarmPosition(ctx sdk.Context, liquidFarm types.LiquidFarm) ammtypes.Position
- func (k Keeper) PlaceBid(ctx sdk.Context, bidderAddr sdk.AccAddress, liquidFarmId, auctionId uint64, ...) (bid types.Bid, err error)
- func (k Keeper) SetBid(ctx sdk.Context, bid types.Bid)
- func (k Keeper) SetLastLiquidFarmId(ctx sdk.Context, liquidFarmId uint64)
- func (k Keeper) SetLiquidFarm(ctx sdk.Context, liquidFarm types.LiquidFarm)
- func (k Keeper) SetMaxNumRecentRewardsAuctions(ctx sdk.Context, maxNum uint32)
- func (k Keeper) SetNextRewardsAuctionEndTime(ctx sdk.Context, t time.Time)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetRewardsAuction(ctx sdk.Context, auction types.RewardsAuction)
- func (k Keeper) SetRewardsAuctionDuration(ctx sdk.Context, duration time.Duration)
- func (k Keeper) SkipRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm, auction types.RewardsAuction) error
- func (k Keeper) StartNewRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm, endTime time.Time) (auctionId uint64)
- type Querier
- func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error)
- func (k Querier) LiquidFarm(c context.Context, req *types.QueryLiquidFarmRequest) (*types.QueryLiquidFarmResponse, error)
- func (k Querier) LiquidFarms(c context.Context, req *types.QueryLiquidFarmsRequest) (*types.QueryLiquidFarmsResponse, error)
- func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) Rewards(c context.Context, req *types.QueryRewardsRequest) (*types.QueryRewardsResponse, error)
- func (k Querier) RewardsAuction(c context.Context, req *types.QueryRewardsAuctionRequest) (*types.QueryRewardsAuctionResponse, error)
- func (k Querier) RewardsAuctions(c context.Context, req *types.QueryRewardsAuctionsRequest) (*types.QueryRewardsAuctionsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, ammKeeper types.AMMKeeper, ) Keeper
func (Keeper) AdvanceRewardsAuctions ¶
AdvanceRewardsAuctions advances all rewards auctions' epoch by one and sets the next auction end time.
func (Keeper) BurnShare ¶
func (k Keeper) BurnShare( ctx sdk.Context, senderAddr sdk.AccAddress, liquidFarmId uint64, share sdk.Coin) (removedLiquidity sdk.Int, position ammtypes.Position, amt sdk.Coins, err error)
BurnShare handles types.MsgBurnShare to burn liquid farm share.
func (Keeper) CreateLiquidFarm ¶
func (Keeper) DeleteLiquidFarm ¶
func (k Keeper) DeleteLiquidFarm(ctx sdk.Context, liquidFarm types.LiquidFarm)
DeleteLiquidFarm deletes the liquid farm object from the store.
func (Keeper) DeleteRewardsAuction ¶
func (k Keeper) DeleteRewardsAuction(ctx sdk.Context, auction types.RewardsAuction)
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the module's exported genesis.
func (Keeper) FinishRewardsAuction ¶
func (k Keeper) FinishRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm, auction types.RewardsAuction) error
FinishRewardsAuction finishes ongoing rewards auction by looking up the existence of winning bid. Compound accumulated farming rewards for farmers and refund all bids that are placed for the auction if winning bid exists. If not, set the compounding rewards to zero and update the auction status AuctionStatusSkipped.
func (Keeper) GetAllBids ¶
GetAllBids returns all bids in the store.
func (Keeper) GetAllLiquidFarms ¶
func (k Keeper) GetAllLiquidFarms(ctx sdk.Context) (liquidFarms []types.LiquidFarm)
GetAllLiquidFarms returns all liquid farm objects stored in the store.
func (Keeper) GetAllRewardsAuctions ¶
func (k Keeper) GetAllRewardsAuctions(ctx sdk.Context) (auctions []types.RewardsAuction)
GetAllRewardsAuctions returns all rewards auctions in the store.
func (Keeper) GetBid ¶
func (k Keeper) GetBid(ctx sdk.Context, liquidFarmId, auctionId uint64, bidderAddr sdk.AccAddress) (bid types.Bid, found bool)
GetBid returns the bid object by the given pool id and bidder address.
func (Keeper) GetLastRewardsAuction ¶
func (Keeper) GetLiquidFarm ¶
func (k Keeper) GetLiquidFarm(ctx sdk.Context, liquidFarmId uint64) (liquidFarm types.LiquidFarm, found bool)
GetLiquidFarm returns liquid farm object by the given id.
func (Keeper) GetLiquidFarmPosition ¶
func (Keeper) GetMaxNumRecentRewardsAuctions ¶
func (Keeper) GetNextLiquidFarmIdWithUpdate ¶
func (Keeper) GetNextRewardsAuctionEndTime ¶
GetNextRewardsAuctionEndTime returns the last rewards auction end time.
func (Keeper) GetPreviousRewardsAuction ¶
func (k Keeper) GetPreviousRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm) (auction types.RewardsAuction, found bool)
func (Keeper) GetRewardsAuction ¶
func (k Keeper) GetRewardsAuction(ctx sdk.Context, liquidFarmId, auctionId uint64) (auction types.RewardsAuction, found bool)
GetRewardsAuction returns the reward auction object by the given auction id pool id.
func (Keeper) GetRewardsAuctionDuration ¶
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the capability module's state from a provided genesis state.
func (Keeper) IterateAllBids ¶
IterateAllBids iterates over all the stored bids and performs a callback function. Stops iteration when callback returns true.
func (Keeper) IterateAllLiquidFarms ¶
func (k Keeper) IterateAllLiquidFarms(ctx sdk.Context, cb func(liquidFarm types.LiquidFarm) (stop bool))
IterateAllLiquidFarms iterates through all liquid farm objects stored in the store and invokes callback function for each item. Stops the iteration when the callback function for each time.
func (Keeper) IterateAllRewardsAuctions ¶
func (k Keeper) IterateAllRewardsAuctions(ctx sdk.Context, cb func(auction types.RewardsAuction) (stop bool))
IterateAllRewardsAuctions iterates over all the stored auctions and performs a callback function. Stops iteration when callback returns true.
func (Keeper) IterateBidsByRewardsAuction ¶
func (Keeper) IterateRewardsAuctionsByLiquidFarm ¶
func (Keeper) LookupLiquidFarm ¶
func (Keeper) LookupRewardsAuction ¶
func (Keeper) MustGetLiquidFarmPosition ¶
func (Keeper) PlaceBid ¶
func (k Keeper) PlaceBid( ctx sdk.Context, bidderAddr sdk.AccAddress, liquidFarmId, auctionId uint64, share sdk.Coin) (bid types.Bid, err error)
PlaceBid handles types.MsgPlaceBid and stores bid object.
func (Keeper) SetLastLiquidFarmId ¶
func (Keeper) SetLiquidFarm ¶
func (k Keeper) SetLiquidFarm(ctx sdk.Context, liquidFarm types.LiquidFarm)
SetLiquidFarm stores liquid farm object with the given id.
func (Keeper) SetMaxNumRecentRewardsAuctions ¶
func (Keeper) SetNextRewardsAuctionEndTime ¶
SetNextRewardsAuctionEndTime stores the last rewards auction end time.
func (Keeper) SetRewardsAuction ¶
func (k Keeper) SetRewardsAuction(ctx sdk.Context, auction types.RewardsAuction)
SetRewardsAuction stores rewards auction.
func (Keeper) SetRewardsAuctionDuration ¶
func (Keeper) SkipRewardsAuction ¶
func (k Keeper) SkipRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm, auction types.RewardsAuction) error
SkipRewardsAuction skips rewards auction since there is no bid.
func (Keeper) StartNewRewardsAuction ¶
func (k Keeper) StartNewRewardsAuction(ctx sdk.Context, liquidFarm types.LiquidFarm, endTime time.Time) (auctionId uint64)
StartNewRewardsAuction creates a new rewards auction and increment the liquid farm's last rewards auction id.
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) Bids ¶
func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error)
Bids queries all Bid objects.
func (Querier) LiquidFarm ¶
func (k Querier) LiquidFarm(c context.Context, req *types.QueryLiquidFarmRequest) (*types.QueryLiquidFarmResponse, error)
LiquidFarm queries the particular LiquidFarm object.
func (Querier) LiquidFarms ¶
func (k Querier) LiquidFarms(c context.Context, req *types.QueryLiquidFarmsRequest) (*types.QueryLiquidFarmsResponse, error)
LiquidFarms queries all LiquidFarm objects.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the parameters of the module.
func (Querier) Rewards ¶
func (k Querier) Rewards(c context.Context, req *types.QueryRewardsRequest) (*types.QueryRewardsResponse, error)
Rewards queries all rewards accumulated for the liquid farm.
func (Querier) RewardsAuction ¶
func (k Querier) RewardsAuction(c context.Context, req *types.QueryRewardsAuctionRequest) (*types.QueryRewardsAuctionResponse, error)
RewardsAuction queries the particular RewardsAuction object.
func (Querier) RewardsAuctions ¶
func (k Querier) RewardsAuctions(c context.Context, req *types.QueryRewardsAuctionsRequest) (*types.QueryRewardsAuctionsResponse, error)
RewardsAuctions queries all RewardsAuction objects.