Documentation ¶
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k Keeper)
- func InitGenesis(ctx sdk.Context, k Keeper, pk types.PricefeedKeeper, sk types.SupplyKeeper, ...)
- func NewHandler(k Keeper) sdk.Handler
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState)
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent
- func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type AugmentedCDP
- type AugmentedCDPs
- type CDP
- type CDPs
- type CollateralParam
- type CollateralParams
- type DebtParam
- type DebtParams
- type Deposit
- type Deposits
- type GenesisState
- type Keeper
- type MsgCreateCDP
- type MsgDeposit
- type MsgDrawDebt
- type MsgRepayDebt
- type MsgWithdraw
- type Params
- type QueryCdpDeposits
- type QueryCdpParams
- type QueryCdpsByRatioParams
- type QueryCdpsParams
Constants ¶
const ( BaseDigitFactor = keeper.BaseDigitFactor EventTypeCreateCdp = types.EventTypeCreateCdp EventTypeCdpDeposit = types.EventTypeCdpDeposit EventTypeCdpDraw = types.EventTypeCdpDraw EventTypeCdpRepay = types.EventTypeCdpRepay EventTypeCdpClose = types.EventTypeCdpClose EventTypeCdpWithdrawal = types.EventTypeCdpWithdrawal EventTypeCdpLiquidation = types.EventTypeCdpLiquidation EventTypeBeginBlockerFatal = types.EventTypeBeginBlockerFatal AttributeKeyCdpID = types.AttributeKeyCdpID AttributeKeyDeposit = types.AttributeKeyDeposit AttributeValueCategory = types.AttributeValueCategory AttributeKeyError = types.AttributeKeyError ModuleName = types.ModuleName StoreKey = types.StoreKey RouterKey = types.RouterKey QuerierRoute = types.QuerierRoute DefaultParamspace = types.DefaultParamspace LiquidatorMacc = types.LiquidatorMacc SavingsRateMacc = types.SavingsRateMacc QueryGetCdp = types.QueryGetCdp QueryGetCdpDeposits = types.QueryGetCdpDeposits QueryGetCdps = types.QueryGetCdps QueryGetCdpsByCollateralization = types.QueryGetCdpsByCollateralization QueryGetParams = types.QueryGetParams RestOwner = types.RestOwner RestCollateralDenom = types.RestCollateralDenom RestRatio = types.RestRatio )
Variables ¶
var ( // functions aliases NewKeeper = keeper.NewKeeper NewQuerier = keeper.NewQuerier NewCDP = types.NewCDP NewAugmentedCDP = types.NewAugmentedCDP RegisterCodec = types.RegisterCodec NewDeposit = types.NewDeposit NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState GetCdpIDBytes = types.GetCdpIDBytes GetCdpIDFromBytes = types.GetCdpIDFromBytes CdpKey = types.CdpKey SplitCdpKey = types.SplitCdpKey DenomIterKey = types.DenomIterKey SplitDenomIterKey = types.SplitDenomIterKey DepositKey = types.DepositKey SplitDepositKey = types.SplitDepositKey DepositIterKey = types.DepositIterKey SplitDepositIterKey = types.SplitDepositIterKey CollateralRatioBytes = types.CollateralRatioBytes CollateralRatioKey = types.CollateralRatioKey SplitCollateralRatioKey = types.SplitCollateralRatioKey CollateralRatioIterKey = types.CollateralRatioIterKey SplitCollateralRatioIterKey = types.SplitCollateralRatioIterKey NewMsgCreateCDP = types.NewMsgCreateCDP NewMsgDeposit = types.NewMsgDeposit NewMsgWithdraw = types.NewMsgWithdraw NewMsgDrawDebt = types.NewMsgDrawDebt NewMsgRepayDebt = types.NewMsgRepayDebt NewParams = types.NewParams DefaultParams = types.DefaultParams ParamKeyTable = types.ParamKeyTable NewQueryCdpsParams = types.NewQueryCdpsParams NewQueryCdpParams = types.NewQueryCdpParams NewQueryCdpDeposits = types.NewQueryCdpDeposits NewQueryCdpsByRatioParams = types.NewQueryCdpsByRatioParams ValidSortableDec = types.ValidSortableDec SortableDecBytes = types.SortableDecBytes ParseDecBytes = types.ParseDecBytes RelativePow = types.RelativePow // variable aliases ModuleCdc = types.ModuleCdc ErrCdpAlreadyExists = types.ErrCdpAlreadyExists ErrInvalidCollateralLength = types.ErrInvalidCollateralLength ErrCollateralNotSupported = types.ErrCollateralNotSupported ErrDebtNotSupported = types.ErrDebtNotSupported ErrExceedsDebtLimit = types.ErrExceedsDebtLimit ErrInvalidCollateralRatio = types.ErrInvalidCollateralRatio ErrCdpNotFound = types.ErrCdpNotFound ErrDepositNotFound = types.ErrDepositNotFound ErrInvalidDeposit = types.ErrInvalidDeposit ErrInvalidPayment = types.ErrInvalidPayment ErrDepositNotAvailable = types.ErrDepositNotAvailable ErrInvalidWithdrawAmount = types.ErrInvalidWithdrawAmount ErrCdpNotAvailable = types.ErrCdpNotAvailable ErrBelowDebtFloor = types.ErrBelowDebtFloor ErrLoadingAugmentedCDP = types.ErrLoadingAugmentedCDP ErrInvalidDebtRequest = types.ErrInvalidDebtRequest ErrDenomPrefixNotFound = types.ErrDenomPrefixNotFound ErrPricefeedDown = types.ErrPricefeedDown CdpIDKeyPrefix = types.CdpIDKeyPrefix CdpKeyPrefix = types.CdpKeyPrefix CollateralRatioIndexPrefix = types.CollateralRatioIndexPrefix CdpIDKey = types.CdpIDKey DebtDenomKey = types.DebtDenomKey GovDenomKey = types.GovDenomKey DepositKeyPrefix = types.DepositKeyPrefix PrincipalKeyPrefix = types.PrincipalKeyPrefix PreviousDistributionTimeKey = types.PreviousDistributionTimeKey PricefeedStatusKeyPrefix = types.PricefeedStatusKeyPrefix KeyGlobalDebtLimit = types.KeyGlobalDebtLimit KeyCollateralParams = types.KeyCollateralParams KeyDebtParam = types.KeyDebtParam KeyDistributionFrequency = types.KeyDistributionFrequency KeyCircuitBreaker = types.KeyCircuitBreaker KeyDebtThreshold = types.KeyDebtThreshold KeyDebtLot = types.KeyDebtLot KeySurplusThreshold = types.KeySurplusThreshold KeySurplusLot = types.KeySurplusLot DefaultGlobalDebt = types.DefaultGlobalDebt DefaultCircuitBreaker = types.DefaultCircuitBreaker DefaultCollateralParams = types.DefaultCollateralParams DefaultDebtParam = types.DefaultDebtParam DefaultCdpStartingID = types.DefaultCdpStartingID DefaultDebtDenom = types.DefaultDebtDenom DefaultGovDenom = types.DefaultGovDenom DefaultStableDenom = types.DefaultStableDenom DefaultSurplusThreshold = types.DefaultSurplusThreshold DefaultDebtThreshold = types.DefaultDebtThreshold DefaultSurplusLot = types.DefaultSurplusLot DefaultDebtLot = types.DefaultDebtLot DefaultPreviousDistributionTime = types.DefaultPreviousDistributionTime DefaultSavingsDistributionFrequency = types.DefaultSavingsDistributionFrequency MaxSortableDec = types.MaxSortableDec )
Functions ¶
func BeginBlocker ¶
func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k Keeper)
BeginBlocker compounds the debt in outstanding cdps and liquidates cdps that are below the required collateralization ratio
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, pk types.PricefeedKeeper, sk types.SupplyKeeper, gs GenesisState)
InitGenesis sets initial genesis state for cdp module
func NewHandler ¶
NewHandler creates an sdk.Handler for cdp messages
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule app module type
func NewAppModule ¶
func NewAppModule(keeper Keeper, accountKeeper types.AccountKeeper, pricefeedKeeper types.PricefeedKeeper, supplyKeeper types.SupplyKeeper) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock module begin-block
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock module end-block
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis module export genesis
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis module init-genesis
func (AppModule) NewHandler ¶
NewHandler module handler
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler module querier
func (AppModule) QuerierRoute ¶
QuerierRoute module querier route name
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
RegisterInvariants register module invariants
func (AppModule) WeightedOperations ¶ added in v0.8.0
func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation
WeightedOperations returns the all the cdp module operations with their respective weights.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis default genesis state
func (AppModuleBasic) GenerateGenesisState ¶ added in v0.8.0
func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState)
GenerateGenesisState creates a randomized GenState of the cdp module
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns the root query command for the auction module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd returns the root tx command for the cdp module.
func (AppModuleBasic) ProposalContents ¶ added in v0.8.0
func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent
ProposalContents doesn't return any content functions for governance proposals.
func (AppModuleBasic) RandomizedParams ¶ added in v0.8.0
func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange
RandomizedParams returns nil because cdp has no params.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the cdp module.
func (AppModuleBasic) RegisterStoreDecoder ¶ added in v0.8.0
func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)
RegisterStoreDecoder registers a decoder for cdp module's types
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis module validate genesis
type AugmentedCDP ¶
type AugmentedCDP = types.AugmentedCDP
type AugmentedCDPs ¶
type AugmentedCDPs = types.AugmentedCDPs
type CollateralParam ¶
type CollateralParam = types.CollateralParam
type CollateralParams ¶
type CollateralParams = types.CollateralParams
type DebtParams ¶
type DebtParams = types.DebtParams
type GenesisState ¶
type GenesisState = types.GenesisState
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis export genesis state for cdp module
type MsgCreateCDP ¶
type MsgCreateCDP = types.MsgCreateCDP
type MsgDeposit ¶
type MsgDeposit = types.MsgDeposit
type MsgDrawDebt ¶
type MsgDrawDebt = types.MsgDrawDebt
type MsgRepayDebt ¶
type MsgRepayDebt = types.MsgRepayDebt
type MsgWithdraw ¶
type MsgWithdraw = types.MsgWithdraw
type QueryCdpDeposits ¶ added in v0.5.0
type QueryCdpDeposits = types.QueryCdpDeposits
type QueryCdpParams ¶
type QueryCdpParams = types.QueryCdpParams
type QueryCdpsByRatioParams ¶
type QueryCdpsByRatioParams = types.QueryCdpsByRatioParams
type QueryCdpsParams ¶
type QueryCdpsParams = types.QueryCdpsParams