Versions in this module Expand all Collapse all v1 v1.0.0 Nov 15, 2022 Changes in this version + func CalculateInterestFactor(perSecondInterestRate sdk.Dec, secondsElapsed sdk.Int) sdk.Dec + func FilterCDPs(ctx sdk.Context, k Keeper, params types.QueryCdpsParams) (types.AugmentedCDPs, error) + func FindIntersection(x types.CDPs, y types.CDPs) types.CDPs + func GrpcFilterCDPs(ctx sdk.Context, k Keeper, req types.QueryCdpsRequest) (types.CDPResponses, error) + func NewMsgServerImpl(keeper Keeper) types.MsgServer + func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier + func NewQueryServerImpl(keeper Keeper) types.QueryServer + type Keeper struct + func NewKeeper(cdc codec.Codec, key sdk.StoreKey, paramstore paramtypes.Subspace, ...) Keeper + func (k *Keeper) SetHooks(hooks types.CDPHooks) *Keeper + func (k Keeper) AccumulateInterest(ctx sdk.Context, ctype string) error + func (k Keeper) AddCdp(ctx sdk.Context, owner sdk.AccAddress, collateral sdk.Coin, principal sdk.Coin, ...) error + func (k Keeper) AddPrincipal(ctx sdk.Context, owner sdk.AccAddress, collateralType string, ...) error + func (k Keeper) AfterCDPCreated(ctx sdk.Context, cdp types.CDP) + func (k Keeper) ApplyLiquidationPenalty(ctx sdk.Context, collateralType string, debt sdk.Int) sdk.Int + func (k Keeper) AttemptKeeperLiquidation(ctx sdk.Context, keeper, owner sdk.AccAddress, collateralType string) error + func (k Keeper) AuctionCollateral(ctx sdk.Context, deposits types.Deposits, collateralType string, debt sdk.Int, ...) error + func (k Keeper) BeforeCDPModified(ctx sdk.Context, cdp types.CDP) + func (k Keeper) BurnDebtCoins(ctx sdk.Context, moduleAccount string, denom string, paymentCoins sdk.Coin) error + func (k Keeper) CalculateCollateralToDebtRatio(ctx sdk.Context, collateral sdk.Coin, collateralType string, debt sdk.Coin) sdk.Dec + func (k Keeper) CalculateCollateralizationRatio(ctx sdk.Context, collateral sdk.Coin, collateralType string, ...) (sdk.Dec, error) + func (k Keeper) CalculateCollateralizationRatioFromAbsoluteRatio(ctx sdk.Context, collateralType string, absoluteRatio sdk.Dec, ...) (sdk.Dec, error) + func (k Keeper) CalculateNewInterest(ctx sdk.Context, cdp types.CDP) sdk.Coin + func (k Keeper) CdpCollateralRatioIndexIterator(ctx sdk.Context, collateralType string, targetRatio sdk.Dec) sdk.Iterator + func (k Keeper) CdpDenomIndexIterator(ctx sdk.Context, collateralType string) sdk.Iterator + func (k Keeper) CreateAuctionsFromDeposit(ctx sdk.Context, collateral sdk.Coin, collateralType string, ...) error + func (k Keeper) DecrementTotalPrincipal(ctx sdk.Context, collateralType string, principal sdk.Coin) + func (k Keeper) DeleteCDP(ctx sdk.Context, cdp types.CDP) error + func (k Keeper) DeleteCdpAndCollateralRatioIndex(ctx sdk.Context, cdp types.CDP) error + func (k Keeper) DeleteDeposit(ctx sdk.Context, cdpID uint64, depositor sdk.AccAddress) + func (k Keeper) DepositCollateral(ctx sdk.Context, owner, depositor sdk.AccAddress, collateral sdk.Coin, ...) error + func (k Keeper) GetAllCdps(ctx sdk.Context) (cdps types.CDPs) + func (k Keeper) GetAllCdpsByCollateralType(ctx sdk.Context, collateralType string) (cdps types.CDPs) + func (k Keeper) GetAllCdpsByCollateralTypeAndRatio(ctx sdk.Context, collateralType string, targetRatio sdk.Dec) (cdps types.CDPs) + func (k Keeper) GetCDP(ctx sdk.Context, collateralType string, cdpID uint64) (types.CDP, bool) + func (k Keeper) GetCdpByOwnerAndCollateralType(ctx sdk.Context, owner sdk.AccAddress, collateralType string) (types.CDP, bool) + func (k Keeper) GetCdpID(ctx sdk.Context, owner sdk.AccAddress, collateralType string) (uint64, bool) + func (k Keeper) GetCdpIdsByOwner(ctx sdk.Context, owner sdk.AccAddress) ([]uint64, bool) + func (k Keeper) GetCollateral(ctx sdk.Context, collateralType string) (types.CollateralParam, bool) + func (k Keeper) GetCollateralTypes(ctx sdk.Context) []string + func (k Keeper) GetDebtDenom(ctx sdk.Context) string + func (k Keeper) GetDebtParam(ctx sdk.Context, denom string) (types.DebtParam, bool) + func (k Keeper) GetDeposit(ctx sdk.Context, cdpID uint64, depositor sdk.AccAddress) (deposit types.Deposit, found bool) + func (k Keeper) GetDeposits(ctx sdk.Context, cdpID uint64) (deposits types.Deposits) + func (k Keeper) GetGovDenom(ctx sdk.Context) string + func (k Keeper) GetInterestFactor(ctx sdk.Context, ctype string) (sdk.Dec, bool) + func (k Keeper) GetMarketStatus(ctx sdk.Context, marketID string) bool + func (k Keeper) GetNextCdpID(ctx sdk.Context) (id uint64) + func (k Keeper) GetParams(ctx sdk.Context) types.Params + func (k Keeper) GetPreviousAccrualTime(ctx sdk.Context, ctype string) (time.Time, bool) + func (k Keeper) GetSliceOfCDPsByRatioAndType(ctx sdk.Context, cutoffCount sdk.Int, targetRatio sdk.Dec, ...) (cdps types.CDPs) + func (k Keeper) GetTotalDebt(ctx sdk.Context, accountName string) sdk.Int + func (k Keeper) GetTotalPrincipal(ctx sdk.Context, collateralType, principalDenom string) (total sdk.Int) + func (k Keeper) GetTotalSurplus(ctx sdk.Context, accountName string) sdk.Int + func (k Keeper) IncrementTotalPrincipal(ctx sdk.Context, collateralType string, principal sdk.Coin) + func (k Keeper) IndexCdpByCollateralRatio(ctx sdk.Context, collateralType string, id uint64, collateralRatio sdk.Dec) + func (k Keeper) IndexCdpByOwner(ctx sdk.Context, cdp types.CDP) + func (k Keeper) IterateAllCdps(ctx sdk.Context, cb func(cdp types.CDP) (stop bool)) + func (k Keeper) IterateCdpsByCollateralRatio(ctx sdk.Context, collateralType string, targetRatio sdk.Dec, ...) + func (k Keeper) IterateCdpsByCollateralType(ctx sdk.Context, collateralType string, cb func(cdp types.CDP) (stop bool)) + func (k Keeper) IterateDeposits(ctx sdk.Context, cdpID uint64, cb func(deposit types.Deposit) (stop bool)) + func (k Keeper) LiquidateCdps(ctx sdk.Context, marketID string, collateralType string, ...) error + func (k Keeper) LoadAugmentedCDP(ctx sdk.Context, cdp types.CDP) types.AugmentedCDP + func (k Keeper) LoadCDPResponse(ctx sdk.Context, cdp types.CDP) types.CDPResponse + func (k Keeper) MintDebtCoins(ctx sdk.Context, moduleAccount string, denom string, principalCoins sdk.Coin) error + func (k Keeper) NetSurplusAndDebt(ctx sdk.Context) error + func (k Keeper) RemoveCdpCollateralRatioIndex(ctx sdk.Context, collateralType string, id uint64, collateralRatio sdk.Dec) + func (k Keeper) RemoveCdpOwnerIndex(ctx sdk.Context, cdp types.CDP) + func (k Keeper) RepayPrincipal(ctx sdk.Context, owner sdk.AccAddress, collateralType string, payment sdk.Coin) error + func (k Keeper) ReturnCollateral(ctx sdk.Context, cdp types.CDP) + func (k Keeper) RunSurplusAndDebtAuctions(ctx sdk.Context) error + func (k Keeper) SeizeCollateral(ctx sdk.Context, cdp types.CDP) error + func (k Keeper) SetCDP(ctx sdk.Context, cdp types.CDP) error + func (k Keeper) SetCdpAndCollateralRatioIndex(ctx sdk.Context, cdp types.CDP, ratio sdk.Dec) error + func (k Keeper) SetDebtDenom(ctx sdk.Context, denom string) + func (k Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit) + func (k Keeper) SetGovDenom(ctx sdk.Context, denom string) + func (k Keeper) SetInterestFactor(ctx sdk.Context, ctype string, interestFactor sdk.Dec) + func (k Keeper) SetMarketStatus(ctx sdk.Context, marketID string, up bool) + func (k Keeper) SetNextCdpID(ctx sdk.Context, id uint64) + func (k Keeper) SetParams(ctx sdk.Context, params types.Params) + func (k Keeper) SetPreviousAccrualTime(ctx sdk.Context, ctype string, previousAccrualTime time.Time) + func (k Keeper) SetTotalPrincipal(ctx sdk.Context, collateralType, principalDenom string, total sdk.Int) + func (k Keeper) SynchronizeInterest(ctx sdk.Context, cdp types.CDP) types.CDP + func (k Keeper) SynchronizeInterestForRiskyCDPs(ctx sdk.Context, slice sdk.Int, targetRatio sdk.Dec, collateralType string) error + func (k Keeper) UpdateCdpAndCollateralRatioIndex(ctx sdk.Context, cdp types.CDP, ratio sdk.Dec) error + func (k Keeper) UpdatePricefeedStatus(ctx sdk.Context, marketID string) (ok bool) + func (k Keeper) ValidateBalance(ctx sdk.Context, amount sdk.Coin, sender sdk.AccAddress) error + func (k Keeper) ValidateCollateral(ctx sdk.Context, collateral sdk.Coin, collateralType string) error + func (k Keeper) ValidateCollateralizationRatio(ctx sdk.Context, collateral sdk.Coin, collateralType string, ...) error + func (k Keeper) ValidateDebtLimit(ctx sdk.Context, collateralType string, principal sdk.Coin) error + func (k Keeper) ValidateLiquidation(ctx sdk.Context, collateral sdk.Coin, collateralType string, ...) error + func (k Keeper) ValidatePaymentCoins(ctx sdk.Context, cdp types.CDP, payment sdk.Coin) error + func (k Keeper) ValidatePrincipalAdd(ctx sdk.Context, principal sdk.Coin) error + func (k Keeper) ValidatePrincipalDraw(ctx sdk.Context, principal sdk.Coin, expectedDenom string) error + func (k Keeper) WithdrawCollateral(ctx sdk.Context, owner, depositor sdk.AccAddress, collateral sdk.Coin, ...) error + type QueryServer struct + func (s QueryServer) Accounts(c context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) + func (s QueryServer) Cdp(c context.Context, req *types.QueryCdpRequest) (*types.QueryCdpResponse, error) + func (s QueryServer) Cdps(c context.Context, req *types.QueryCdpsRequest) (*types.QueryCdpsResponse, error) + func (s QueryServer) Deposits(c context.Context, req *types.QueryDepositsRequest) (*types.QueryDepositsResponse, error) + func (s QueryServer) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) + func (s QueryServer) TotalCollateral(c context.Context, req *types.QueryTotalCollateralRequest) (*types.QueryTotalCollateralResponse, error) + func (s QueryServer) TotalPrincipal(c context.Context, req *types.QueryTotalPrincipalRequest) (*types.QueryTotalPrincipalResponse, error)