Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) AddBookSettlement(ctx sdk.Context, orderBookUID string) error
- func (k Keeper) BatchOrderBookSettlements(ctx sdk.Context) error
- func (k Keeper) BettorLoses(ctx sdk.Context, address sdk.AccAddress, betAmount sdk.Int, ...) error
- func (k Keeper) BettorWins(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount sdk.Int, ...) error
- func (k Keeper) BookExposure(c context.Context, req *types.QueryBookExposureRequest) (*types.QueryBookExposureResponse, error)
- func (k Keeper) BookExposures(c context.Context, req *types.QueryBookExposuresRequest) (*types.QueryBookExposuresResponse, error)
- func (k Keeper) BookParticipation(c context.Context, req *types.QueryBookParticipationRequest) (*types.QueryBookParticipationResponse, error)
- func (k Keeper) BookParticipations(c context.Context, req *types.QueryBookParticipationsRequest) (*types.QueryBookParticipationsResponse, error)
- func (k Keeper) GetAllBookExposures(ctx sdk.Context) (list []types.BookOddsExposure, err error)
- func (k Keeper) GetAllBookParticipations(ctx sdk.Context) (list []types.BookParticipation, err error)
- func (k Keeper) GetAllBooks(ctx sdk.Context) (list []types.OrderBook, err error)
- func (k Keeper) GetAllHistoricalParticipationExposures(ctx sdk.Context) (list []types.ParticipationExposure, err error)
- func (k Keeper) GetAllParticipationBetPair(ctx sdk.Context) (list []types.ParticipationBetPair, err error)
- func (k Keeper) GetAllParticipationExposures(ctx sdk.Context) (list []types.ParticipationExposure, err error)
- func (k Keeper) GetAllPayoutLock(ctx sdk.Context) (list [][]byte, err error)
- func (k Keeper) GetBatchSettlementCount(ctx sdk.Context) (res uint64)
- func (k Keeper) GetBook(ctx sdk.Context, bookUID string) (val types.OrderBook, found bool)
- func (k Keeper) GetBookOddsExposure(ctx sdk.Context, bookUID, oddsUID string) (val types.BookOddsExposure, found bool)
- func (k Keeper) GetBookParticipation(ctx sdk.Context, bookUID string, index uint64) (val types.BookParticipation, found bool)
- func (k Keeper) GetExposureByBookAndOdds(ctx sdk.Context, bookUID, oddsUID string) (list []types.ParticipationExposure, err error)
- func (k Keeper) GetExposureByBookAndParticipationIndex(ctx sdk.Context, bookUID string, participationIndex uint64) (list []types.ParticipationExposure, err error)
- func (k Keeper) GetFirstUnsettledResolvedOrderBook(ctx sdk.Context) (string, bool)
- func (k Keeper) GetMaxBookParticipationsAllowed(ctx sdk.Context) (res uint64)
- func (k Keeper) GetOddsExposuresByBook(ctx sdk.Context, bookUID string) (list []types.BookOddsExposure, err error)
- func (k Keeper) GetOrderBookStats(ctx sdk.Context) (val types.OrderBookStats)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetParticipationsOfBook(ctx sdk.Context, bookUID string) (list []types.BookParticipation, err error)
- func (k Keeper) HistoricalParticipationExposures(c context.Context, req *types.QueryHistoricalParticipationExposuresRequest) (*types.QueryHistoricalParticipationExposuresResponse, error)
- func (k Keeper) InitiateBook(ctx sdk.Context, sportEventUID string, srContribution sdk.Int, ...) (err error)
- func (k Keeper) InitiateBookParticipation(ctx sdk.Context, addr sdk.AccAddress, bookUID string, liquidity, fee sdk.Int) (index uint64, err error)
- func (k Keeper) LiquidateBookParticipation(ctx sdk.Context, depositorAddr, bookUID string, participationIndex uint64, ...) (sdk.Int, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MoveToHistoricalParticipationExposure(ctx sdk.Context, pe types.ParticipationExposure)
- func (k Keeper) OrderBook(c context.Context, req *types.QueryOrderBookRequest) (*types.QueryOrderBookResponse, error)
- func (k Keeper) OrderBooks(c context.Context, req *types.QueryOrderBooksRequest) (*types.QueryOrderBooksResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ParticipationExposure(c context.Context, req *types.QueryParticipationExposureRequest) (*types.QueryParticipationExposureResponse, error)
- func (k Keeper) ParticipationExposures(c context.Context, req *types.QueryParticipationExposuresRequest) (*types.QueryParticipationExposuresResponse, error)
- func (k Keeper) ParticipationFulfilledBets(c context.Context, req *types.QueryParticipationFulfilledBetsRequest) (*types.QueryParticipationFulfilledBetsResponse, error)
- func (k Keeper) ProcessBetPlacement(ctx sdk.Context, betUID, bookUID, oddsUID string, maxLossMultiplier sdk.Dec, ...) (betFulfillments []*bettypes.BetFulfillment, err error)
- func (k Keeper) RefundBettor(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount, payout sdk.Int, ...) error
- func (k Keeper) RemoveUnsettledResolvedOrderBook(ctx sdk.Context, orderBookUID string)
- func (k *Keeper) SetBetKeeper(betKeeper types.BetKeeper)
- func (k Keeper) SetBook(ctx sdk.Context, book types.OrderBook)
- func (k Keeper) SetBookOddsExposure(ctx sdk.Context, boe types.BookOddsExposure)
- func (k Keeper) SetBookParticipation(ctx sdk.Context, participation types.BookParticipation)
- func (k Keeper) SetHistoricalParticipationExposure(ctx sdk.Context, pe types.ParticipationExposure)
- func (k Keeper) SetOrderBookStats(ctx sdk.Context, stats types.OrderBookStats)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetParticipationBetPair(ctx sdk.Context, bp types.ParticipationBetPair, betID uint64)
- func (k Keeper) SetParticipationExposure(ctx sdk.Context, pe types.ParticipationExposure)
- func (k Keeper) SetParticipationExposureByIndex(ctx sdk.Context, pe types.ParticipationExposure)
- func (k Keeper) SetPayoutLock(ctx sdk.Context, uniqueLock string)
- func (k *Keeper) SetSportEventKeeper(sportEventKeeper types.SportEventKeeper)
- type SdkExpectedKeepers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
keeper of the orderbook store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key sdk.StoreKey, ps paramtypes.Subspace, expectedKeepers SdkExpectedKeepers, ) *Keeper
NewKeeper creates a new orderbook Keeper instance
func (Keeper) AddBookSettlement ¶
func (Keeper) BatchOrderBookSettlements ¶
BatchOrderBookSettlements settles order books
func (Keeper) BettorLoses ¶
func (k Keeper) BettorLoses(ctx sdk.Context, address sdk.AccAddress, betAmount sdk.Int, payoutProfit sdk.Int, uniqueLock string, betFulfillments []*bettypes.BetFulfillment, bookUID string, ) error
BettorLoses process bets in case bettor looses
func (Keeper) BettorWins ¶
func (k Keeper) BettorWins( ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount sdk.Int, payoutProfit sdk.Int, uniqueLock string, betFulfillments []*bettypes.BetFulfillment, bookUID string, ) error
BettorLoses process bets in case bettor looses
func (Keeper) BookExposure ¶
func (k Keeper) BookExposure(c context.Context, req *types.QueryBookExposureRequest) (*types.QueryBookExposureResponse, error)
BookExposure queries book exposure info for given order book id and odds id
func (Keeper) BookExposures ¶
func (k Keeper) BookExposures(c context.Context, req *types.QueryBookExposuresRequest) (*types.QueryBookExposuresResponse, error)
BookExposures queries exposures info for given orderbook
func (Keeper) BookParticipation ¶
func (k Keeper) BookParticipation(c context.Context, req *types.QueryBookParticipationRequest) (*types.QueryBookParticipationResponse, error)
BookParticipation queries book participation info for given order book id and participation index
func (Keeper) BookParticipations ¶
func (k Keeper) BookParticipations(c context.Context, req *types.QueryBookParticipationsRequest) (*types.QueryBookParticipationsResponse, error)
BookParticipations queries participations info for given orderbook
func (Keeper) GetAllBookExposures ¶
GetAllBookExposures returns all book exposures used during genesis dump.
func (Keeper) GetAllBookParticipations ¶
func (k Keeper) GetAllBookParticipations(ctx sdk.Context) (list []types.BookParticipation, err error)
GetAllBookParticipations returns all book participations used during genesis dump.
func (Keeper) GetAllBooks ¶
GetAllBooks returns all order books used during genesis dump.
func (Keeper) GetAllHistoricalParticipationExposures ¶
func (k Keeper) GetAllHistoricalParticipationExposures(ctx sdk.Context) (list []types.ParticipationExposure, err error)
GetAllHistoricalParticipationExposures returns all participation exposures used during genesis dump.
func (Keeper) GetAllParticipationBetPair ¶
func (k Keeper) GetAllParticipationBetPair(ctx sdk.Context) (list []types.ParticipationBetPair, err error)
GetAllParticipationBetPair returns all participation bet pairs used during genesis dump.
func (Keeper) GetAllParticipationExposures ¶
func (k Keeper) GetAllParticipationExposures(ctx sdk.Context) (list []types.ParticipationExposure, err error)
GetAllParticipationExposures returns all participation exposures used during genesis dump.
func (Keeper) GetAllPayoutLock ¶
GetAllPayoutLock returns all payout locks used during genesis dump.
func (Keeper) GetBatchSettlementCount ¶
GetBatchSettlementCount - number of deposits to be settled in end blocker.
func (Keeper) GetBookOddsExposure ¶
func (k Keeper) GetBookOddsExposure(ctx sdk.Context, bookUID, oddsUID string) (val types.BookOddsExposure, found bool)
GetBookOddsExposure returns a specific book odds exposure.
func (Keeper) GetBookParticipation ¶
func (k Keeper) GetBookParticipation(ctx sdk.Context, bookUID string, index uint64) (val types.BookParticipation, found bool)
GetBook GetBookParticipation a specific participation.
func (Keeper) GetExposureByBookAndOdds ¶
func (k Keeper) GetExposureByBookAndOdds(ctx sdk.Context, bookUID, oddsUID string) (list []types.ParticipationExposure, err error)
GetExposureByBookAndOdds returns all exposures for a book id and odds id
func (Keeper) GetExposureByBookAndParticipationIndex ¶
func (k Keeper) GetExposureByBookAndParticipationIndex(ctx sdk.Context, bookUID string, participationIndex uint64) (list []types.ParticipationExposure, err error)
GetExposureByBookAndParticipationIndex returns all exposures for a book id and participation index
func (Keeper) GetFirstUnsettledResolvedOrderBook ¶
GetFirstUnsettledResolvedOrderBook returns first element of resolved orderbook that have active deposits
func (Keeper) GetMaxBookParticipationsAllowed ¶
GetMaxBookParticipationsAllowed - Max number of book participations allowed.
func (Keeper) GetOddsExposuresByBook ¶
func (k Keeper) GetOddsExposuresByBook(ctx sdk.Context, bookUID string) (list []types.BookOddsExposure, err error)
GetOddsExposuresByBook returns all exposures for a book
func (Keeper) GetOrderBookStats ¶
func (k Keeper) GetOrderBookStats(ctx sdk.Context) (val types.OrderBookStats)
GetOrderBookStats returns order-book stats
func (Keeper) GetParticipationsOfBook ¶
func (k Keeper) GetParticipationsOfBook(ctx sdk.Context, bookUID string) (list []types.BookParticipation, err error)
GetParticipationsOfBook returns all participations for a book
func (Keeper) HistoricalParticipationExposures ¶
func (k Keeper) HistoricalParticipationExposures(c context.Context, req *types.QueryHistoricalParticipationExposuresRequest) (*types.QueryHistoricalParticipationExposuresResponse, error)
HistoricalParticipationExposures queries historical participation exposures info for given orderbook
func (Keeper) InitiateBook ¶
func (k Keeper) InitiateBook(ctx sdk.Context, sportEventUID string, srContribution sdk.Int, oddsUIDs []string) (err error)
InitiateBook initiates a book for a given sport event
func (Keeper) InitiateBookParticipation ¶
func (k Keeper) InitiateBookParticipation( ctx sdk.Context, addr sdk.AccAddress, bookUID string, liquidity, fee sdk.Int, ) (index uint64, err error)
InitiateBookParticipation starts a participation on a book for a certain account.
func (Keeper) LiquidateBookParticipation ¶
func (Keeper) MoveToHistoricalParticipationExposure ¶
func (k Keeper) MoveToHistoricalParticipationExposure(ctx sdk.Context, pe types.ParticipationExposure)
MoveToHistoricalParticipationExposure removes the participation exposures and indices and sets historical participation exposures.
func (Keeper) OrderBook ¶
func (k Keeper) OrderBook(c context.Context, req *types.QueryOrderBookRequest) (*types.QueryOrderBookResponse, error)
OrderBook queries orderbook info for given order book id
func (Keeper) OrderBooks ¶
func (k Keeper) OrderBooks(c context.Context, req *types.QueryOrderBooksRequest) (*types.QueryOrderBooksResponse, error)
OrderBooks queries all order books that match the given status
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns the params of the module
func (Keeper) ParticipationExposure ¶
func (k Keeper) ParticipationExposure(c context.Context, req *types.QueryParticipationExposureRequest) (*types.QueryParticipationExposureResponse, error)
ParticipationExposure queries participation exposure info for given order book id and participation index
func (Keeper) ParticipationExposures ¶
func (k Keeper) ParticipationExposures(c context.Context, req *types.QueryParticipationExposuresRequest) (*types.QueryParticipationExposuresResponse, error)
ParticipationExposures queries participation exposures info for given orderbook
func (Keeper) ParticipationFulfilledBets ¶
func (k Keeper) ParticipationFulfilledBets(c context.Context, req *types.QueryParticipationFulfilledBetsRequest) (*types.QueryParticipationFulfilledBetsResponse, error)
ParticipationFulfilledBets queries participation fulfilled bets info for given order book id and participation index
func (Keeper) ProcessBetPlacement ¶
func (k Keeper) ProcessBetPlacement( ctx sdk.Context, betUID, bookUID, oddsUID string, maxLossMultiplier sdk.Dec, betAmount sdk.Int, payoutProfit sdk.Dec, bettorAddress sdk.AccAddress, betFee sdk.Int, oddsType bettypes.OddsType, oddsVal string, betID uint64, ) (betFulfillments []*bettypes.BetFulfillment, err error)
ProcessBetPlacement processes bet placement
func (Keeper) RefundBettor ¶
func (k Keeper) RefundBettor(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount, payout sdk.Int, uniqueLock string) error
RefundBettor process bets in case sports event gets cancelled or aborted.
func (Keeper) RemoveUnsettledResolvedOrderBook ¶
RemoveUnsettledResolvedOrderBook removes resolved order-book from the statistics
func (*Keeper) SetBetKeeper ¶
SetBetKeeper sets the bet module keeper to the order book keeper.
func (Keeper) SetBookOddsExposure ¶
func (k Keeper) SetBookOddsExposure(ctx sdk.Context, boe types.BookOddsExposure)
SetBookOddsExposure sets a book odds exposure.
func (Keeper) SetBookParticipation ¶
func (k Keeper) SetBookParticipation(ctx sdk.Context, participation types.BookParticipation)
SetBookParticipation sets a book participation.
func (Keeper) SetHistoricalParticipationExposure ¶
func (k Keeper) SetHistoricalParticipationExposure(ctx sdk.Context, pe types.ParticipationExposure)
SetHistoricalParticipationExposure sets a historical participation exposure.
func (Keeper) SetOrderBookStats ¶
func (k Keeper) SetOrderBookStats(ctx sdk.Context, stats types.OrderBookStats)
SetOrderBookStats sets bet statistics in the store
func (Keeper) SetParticipationBetPair ¶
func (k Keeper) SetParticipationBetPair(ctx sdk.Context, bp types.ParticipationBetPair, betID uint64)
SetParticipationBetPair sets a participation bet pair.
func (Keeper) SetParticipationExposure ¶
func (k Keeper) SetParticipationExposure(ctx sdk.Context, pe types.ParticipationExposure)
SetParticipationExposure sets a participation exposure.
func (Keeper) SetParticipationExposureByIndex ¶
func (k Keeper) SetParticipationExposureByIndex(ctx sdk.Context, pe types.ParticipationExposure)
SetParticipationExposureByIndex sets a participation exposure by index.
func (Keeper) SetPayoutLock ¶
SetPayoutLock sets a lock for the payout element
func (*Keeper) SetSportEventKeeper ¶
func (k *Keeper) SetSportEventKeeper(sportEventKeeper types.SportEventKeeper)
SetSportEventKeeper sets the sport-event module keeper to the order book keeper.
type SdkExpectedKeepers ¶
type SdkExpectedKeepers struct { BankKeeper types.BankKeeper AccountKeeper types.AccountKeeper }
SdkExpectedKeepers contains expected keepers parameter needed by NewKeeper