Documentation ¶
Index ¶
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (k Keeper) AddCollateralParam(ctx sdk.Context, nominee string, collateralParam types.CollateralParam) sdk.Error
- func (k Keeper) DeleteCSDT(ctx sdk.Context, csdt types.CSDT)
- func (k Keeper) GetCSDT(ctx sdk.Context, owner sdk.AccAddress, collateralDenom string) (types.CSDT, bool)
- func (k Keeper) GetCSDTs(ctx sdk.Context, collateralDenom string, price sdk.Dec) (types.CSDTs, sdk.Error)
- func (k Keeper) GetCollateralState(ctx sdk.Context, collateralDenom string) (types.CollateralState, bool)
- func (k Keeper) GetGlobalDebt(ctx sdk.Context) sdk.Int
- func (k Keeper) GetGovDenom() string
- func (k Keeper) GetOracle() types.OracleKeeper
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetStableDenom() string
- func (k Keeper) GetSupply() types.SupplyKeeper
- func (k Keeper) IsNominee(ctx sdk.Context, nominee string) bool
- func (k Keeper) ModifyCSDT(ctx sdk.Context, owner sdk.AccAddress, collateralDenom string, ...) sdk.Error
- func (k Keeper) PartialSeizeCSDT(ctx sdk.Context, owner sdk.AccAddress, collateralDenom string, ...) sdk.Error
- func (k Keeper) ReduceGlobalDebt(ctx sdk.Context, amount sdk.Int) sdk.Error
- func (k Keeper) SetCSDT(ctx sdk.Context, csdt types.CSDT)
- func (k Keeper) SetCollateralParam(ctx sdk.Context, nominee string, collateralParam types.CollateralParam) sdk.Error
- func (k Keeper) SetCollateralState(ctx sdk.Context, collateralstate types.CollateralState)
- func (k Keeper) SetGlobalDebt(ctx sdk.Context, globalDebt sdk.Int)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper csdt Keeper
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, storeKey sdk.StoreKey, subspace params.Subspace, oracle types.OracleKeeper, bank types.BankKeeper, supply types.SupplyKeeper, ) Keeper
NewKeeper creates a new keeper
func (Keeper) AddCollateralParam ¶
func (Keeper) GetCSDTs ¶
func (k Keeper) GetCSDTs(ctx sdk.Context, collateralDenom string, price sdk.Dec) (types.CSDTs, sdk.Error)
GetCSDTs returns all CSDTs, optionally filtered by collateral type and liquidation price. `price` filters for CSDTs that will be below the liquidation ratio when the collateral is at that specified price.
func (Keeper) GetCollateralState ¶
func (Keeper) GetGovDenom ¶
func (Keeper) GetParams ¶
---------- Module Parameters ---------- GetParams returns the params from the store
func (Keeper) GetStableDenom ¶
func (Keeper) ModifyCSDT ¶
func (k Keeper) ModifyCSDT(ctx sdk.Context, owner sdk.AccAddress, collateralDenom string, changeInCollateral sdk.Int, changeInDebt sdk.Int) sdk.Error
ModifyCSDT creates, changes, or deletes a CSDT TODO can/should this function be split up?
func (Keeper) PartialSeizeCSDT ¶
func (k Keeper) PartialSeizeCSDT(ctx sdk.Context, owner sdk.AccAddress, collateralDenom string, collateralToSeize sdk.Int, debtToSeize sdk.Int) sdk.Error
PartialSeizeCSDT removes collateral and debt from a CSDT and decrements global debt counters. It does not move collateral to another account so is unsafe. TODO should this be made safer by moving collateral to liquidatorModuleAccount ? If so how should debt be moved?
func (Keeper) ReduceGlobalDebt ¶
ReduceGlobalDebt decreases the stored global debt counter. It is used by the liquidator when it annihilates debt and stable coin. TODO Can the interface between csdt and liquidator modules be improved so that this function doesn't exist?
func (Keeper) SetCollateralParam ¶
func (Keeper) SetCollateralState ¶
func (k Keeper) SetCollateralState(ctx sdk.Context, collateralstate types.CollateralState)