Documentation ¶
Index ¶
- func HandlePublicPositionCreateProposal(ctx sdk.Context, k Keeper, p *types.PublicPositionCreateProposal) error
- func HandlePublicPositionParameterChangeProposal(ctx sdk.Context, k Keeper, p *types.PublicPositionParameterChangeProposal) 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, publicPositionId uint64, ...) (removedLiquidity sdk.Int, position ammtypes.Position, amt sdk.Coins, err error)
- func (k Keeper) CreatePublicPosition(ctx sdk.Context, poolId uint64, lowerPrice, upperPrice sdk.Dec, ...) (publicPosition types.PublicPosition, err error)
- func (k Keeper) DeleteBid(ctx sdk.Context, bid types.Bid)
- func (k Keeper) DeletePublicPosition(ctx sdk.Context, publicPosition types.PublicPosition)
- 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, publicPosition types.PublicPosition, ...) error
- func (k Keeper) GetAMMPosition(ctx sdk.Context, publicPosition types.PublicPosition) (position ammtypes.Position, found bool)
- func (k Keeper) GetAllBids(ctx sdk.Context) (bids []types.Bid)
- func (k Keeper) GetAllPublicPositions(ctx sdk.Context) (publicPositions []types.PublicPosition)
- func (k Keeper) GetAllRewardsAuctions(ctx sdk.Context) (auctions []types.RewardsAuction)
- func (k Keeper) GetBid(ctx sdk.Context, publicPositionId, auctionId uint64, bidderAddr sdk.AccAddress) (bid types.Bid, found bool)
- func (k Keeper) GetLastPublicPositionId(ctx sdk.Context) uint64
- func (k Keeper) GetLastRewardsAuction(ctx sdk.Context, publicPositionId uint64) (auction types.RewardsAuction, found bool)
- func (k Keeper) GetMaxNumRecentRewardsAuctions(ctx sdk.Context) (maxNum uint32)
- func (k Keeper) GetModuleAddress() sdk.AccAddress
- func (k Keeper) GetNextPublicPositionIdWithUpdate(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, publicPosition types.PublicPosition) (auction types.RewardsAuction, found bool)
- func (k Keeper) GetPublicPosition(ctx sdk.Context, publicPositionId uint64) (publicPosition types.PublicPosition, found bool)
- func (k Keeper) GetRewardsAuction(ctx sdk.Context, publicPositionId, 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) IterateAllPublicPositions(ctx sdk.Context, cb func(publicPosition types.PublicPosition) (stop bool))
- func (k Keeper) IterateAllRewardsAuctions(ctx sdk.Context, cb func(auction types.RewardsAuction) (stop bool))
- func (k Keeper) IterateBidsByRewardsAuction(ctx sdk.Context, publicPositionId, auctionId uint64, ...)
- func (k Keeper) IteratePublicPositionsByPool(ctx sdk.Context, poolId uint64, ...)
- func (k Keeper) IterateRewardsAuctionsByPublicPosition(ctx sdk.Context, publicPositionId uint64, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) LookupPublicPosition(ctx sdk.Context, publicPositionId uint64) (found bool)
- func (k Keeper) LookupPublicPositionByParams(ctx sdk.Context, poolId uint64, lowerTick, upperTick int32) (found bool)
- func (k Keeper) LookupRewardsAuction(ctx sdk.Context, publicPositionId, auctionId uint64) (found bool)
- func (k Keeper) MintShare(ctx sdk.Context, senderAddr sdk.AccAddress, publicPositionId uint64, ...) (mintedShare sdk.Coin, position ammtypes.Position, liquidity sdk.Int, ...)
- func (k Keeper) MustGetAMMPosition(ctx sdk.Context, publicPosition types.PublicPosition) ammtypes.Position
- func (k Keeper) PlaceBid(ctx sdk.Context, bidderAddr sdk.AccAddress, publicPositionId, auctionId uint64, ...) (bid types.Bid, err error)
- func (k Keeper) SetBid(ctx sdk.Context, bid types.Bid)
- func (k Keeper) SetLastPublicPositionId(ctx sdk.Context, publicPositionId uint64)
- 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) SetPublicPosition(ctx sdk.Context, publicPosition types.PublicPosition)
- func (k Keeper) SetPublicPositionByParamsIndex(ctx sdk.Context, publicPosition types.PublicPosition)
- func (k Keeper) SetPublicPositionsByPoolIndex(ctx sdk.Context, publicPosition types.PublicPosition)
- 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, publicPosition types.PublicPosition, ...) error
- func (k Keeper) StartNewRewardsAuction(ctx sdk.Context, publicPosition types.PublicPosition, endTime time.Time) (auctionId uint64)
- type Querier
- func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error)
- func (k Querier) ExchangeRate(c context.Context, req *types.QueryExchangeRateRequest) (*types.QueryExchangeRateResponse, error)
- func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) PublicPosition(c context.Context, req *types.QueryPublicPositionRequest) (*types.QueryPublicPositionResponse, error)
- func (k Querier) PublicPositions(c context.Context, req *types.QueryPublicPositionsRequest) (*types.QueryPublicPositionsResponse, 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, publicPositionId uint64, share sdk.Coin) (removedLiquidity sdk.Int, position ammtypes.Position, amt sdk.Coins, err error)
BurnShare handles types.MsgBurnShare to burn public position share.
func (Keeper) CreatePublicPosition ¶
func (Keeper) DeletePublicPosition ¶
func (k Keeper) DeletePublicPosition(ctx sdk.Context, publicPosition types.PublicPosition)
DeletePublicPosition deletes the public position 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, publicPosition types.PublicPosition, 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) GetAMMPosition ¶
func (Keeper) GetAllBids ¶
GetAllBids returns all bids in the store.
func (Keeper) GetAllPublicPositions ¶
func (k Keeper) GetAllPublicPositions(ctx sdk.Context) (publicPositions []types.PublicPosition)
GetAllPublicPositions returns all public position 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, publicPositionId, 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) GetLastPublicPositionId ¶
func (Keeper) GetLastRewardsAuction ¶
func (Keeper) GetMaxNumRecentRewardsAuctions ¶
func (Keeper) GetModuleAddress ¶
func (k Keeper) GetModuleAddress() sdk.AccAddress
GetModuleAddress returns the module account's address.
func (Keeper) GetNextPublicPositionIdWithUpdate ¶
func (Keeper) GetNextRewardsAuctionEndTime ¶
GetNextRewardsAuctionEndTime returns the last rewards auction end time.
func (Keeper) GetPreviousRewardsAuction ¶
func (k Keeper) GetPreviousRewardsAuction(ctx sdk.Context, publicPosition types.PublicPosition) (auction types.RewardsAuction, found bool)
func (Keeper) GetPublicPosition ¶
func (k Keeper) GetPublicPosition(ctx sdk.Context, publicPositionId uint64) (publicPosition types.PublicPosition, found bool)
GetPublicPosition returns public position object by the given id.
func (Keeper) GetRewardsAuction ¶
func (k Keeper) GetRewardsAuction(ctx sdk.Context, publicPositionId, 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) IterateAllPublicPositions ¶
func (k Keeper) IterateAllPublicPositions(ctx sdk.Context, cb func(publicPosition types.PublicPosition) (stop bool))
IterateAllPublicPositions iterates through all public position 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) IteratePublicPositionsByPool ¶
func (Keeper) IterateRewardsAuctionsByPublicPosition ¶
func (Keeper) LookupPublicPosition ¶
func (Keeper) LookupPublicPositionByParams ¶
func (Keeper) LookupRewardsAuction ¶
func (Keeper) MustGetAMMPosition ¶
func (Keeper) PlaceBid ¶
func (k Keeper) PlaceBid( ctx sdk.Context, bidderAddr sdk.AccAddress, publicPositionId, auctionId uint64, share sdk.Coin) (bid types.Bid, err error)
PlaceBid handles types.MsgPlaceBid and stores bid object.
func (Keeper) SetLastPublicPositionId ¶
func (Keeper) SetMaxNumRecentRewardsAuctions ¶
func (Keeper) SetNextRewardsAuctionEndTime ¶
SetNextRewardsAuctionEndTime stores the last rewards auction end time.
func (Keeper) SetPublicPosition ¶
func (k Keeper) SetPublicPosition(ctx sdk.Context, publicPosition types.PublicPosition)
SetPublicPosition stores public position object with the given id.
func (Keeper) SetPublicPositionByParamsIndex ¶
func (k Keeper) SetPublicPositionByParamsIndex(ctx sdk.Context, publicPosition types.PublicPosition)
func (Keeper) SetPublicPositionsByPoolIndex ¶
func (k Keeper) SetPublicPositionsByPoolIndex(ctx sdk.Context, publicPosition types.PublicPosition)
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, publicPosition types.PublicPosition, auction types.RewardsAuction) error
SkipRewardsAuction skips rewards auction since there is no bid.
func (Keeper) StartNewRewardsAuction ¶
func (k Keeper) StartNewRewardsAuction(ctx sdk.Context, publicPosition types.PublicPosition, endTime time.Time) (auctionId uint64)
StartNewRewardsAuction creates a new rewards auction and increment the public position'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) ExchangeRate ¶
func (k Querier) ExchangeRate(c context.Context, req *types.QueryExchangeRateRequest) (*types.QueryExchangeRateResponse, error)
ExchangeRate queries exchange rate, such as mint rate and burn rate per 1 sb.
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) PublicPosition ¶
func (k Querier) PublicPosition(c context.Context, req *types.QueryPublicPositionRequest) (*types.QueryPublicPositionResponse, error)
PublicPosition queries the particular public position object.
func (Querier) PublicPositions ¶
func (k Querier) PublicPositions(c context.Context, req *types.QueryPublicPositionsRequest) (*types.QueryPublicPositionsResponse, error)
PublicPositions queries all public position objects.
func (Querier) Rewards ¶
func (k Querier) Rewards(c context.Context, req *types.QueryRewardsRequest) (*types.QueryRewardsResponse, error)
Rewards queries all rewards accumulated for the public position.
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.