keeper

package
v0.0.2-0...-13a971e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

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 (k Keeper) AddCollateralParam(ctx sdk.Context, nominee string, collateralParam types.CollateralParam) sdk.Error

func (Keeper) DeleteCSDT

func (k Keeper) DeleteCSDT(ctx sdk.Context, csdt types.CSDT)

func (Keeper) GetCSDT

func (k Keeper) GetCSDT(ctx sdk.Context, owner sdk.AccAddress, collateralDenom string) (types.CSDT, bool)

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 (k Keeper) GetCollateralState(ctx sdk.Context, collateralDenom string) (types.CollateralState, bool)

func (Keeper) GetGlobalDebt

func (k Keeper) GetGlobalDebt(ctx sdk.Context) sdk.Int

func (Keeper) GetGovDenom

func (k Keeper) GetGovDenom() string

func (Keeper) GetOracle

func (k Keeper) GetOracle() types.OracleKeeper

GetOracle allows testing

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

---------- Module Parameters ---------- GetParams returns the params from the store

func (Keeper) GetStableDenom

func (k Keeper) GetStableDenom() string

func (Keeper) GetSupply

func (k Keeper) GetSupply() types.SupplyKeeper

GetOracle allows testing

func (Keeper) IsNominee

func (k Keeper) IsNominee(ctx sdk.Context, nominee string) bool

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

func (k Keeper) ReduceGlobalDebt(ctx sdk.Context, amount sdk.Int) sdk.Error

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) SetCSDT

func (k Keeper) SetCSDT(ctx sdk.Context, csdt types.CSDT)

Potentially change this logic to use the account interface?

func (Keeper) SetCollateralParam

func (k Keeper) SetCollateralParam(ctx sdk.Context, nominee string, collateralParam types.CollateralParam) sdk.Error

func (Keeper) SetCollateralState

func (k Keeper) SetCollateralState(ctx sdk.Context, collateralstate types.CollateralState)

func (Keeper) SetGlobalDebt

func (k Keeper) SetGlobalDebt(ctx sdk.Context, globalDebt sdk.Int)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets params on the store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL