Documentation ¶
Index ¶
- func CdpsForExistingPrice(k Keeper) sdk.Invariant
- func LiquidityPoolAmountEqualsCdps(k Keeper) sdk.Invariant
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Keeper
- func (k Keeper) AddCdp(ctx sdk.Context, cdp types.Cdp)
- func (k Keeper) CloseCdp(ctx sdk.Context, user sdk.AccAddress, timestamp int64) sdk.Error
- func (k Keeper) GetCdpByOwnerAndTimeStamp(ctx sdk.Context, owner sdk.AccAddress, timestamp int64) (cdp types.Cdp, found bool)
- func (k Keeper) GetCdps(ctx sdk.Context) types.Cdps
- func (k Keeper) GetCdpsByOwner(ctx sdk.Context, owner sdk.AccAddress) (cdps types.Cdps)
- func (k Keeper) GetCreditsDenom(ctx sdk.Context) string
- func (k Keeper) GetLiquidityPoolAmount(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetMintModuleAccount(ctx sdk.Context) exported.ModuleAccountI
- func (k Keeper) OpenCdp(ctx sdk.Context, depositor sdk.AccAddress, depositAmount sdk.Coins) sdk.Error
- func (k Keeper) SetCreditsDenom(ctx sdk.Context, den string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CdpsForExistingPrice ¶ added in v1.5.0
CdpsForExistingPrice checks that each Cdp currently opened refers to an existing token priced by x/pricefeed.
func LiquidityPoolAmountEqualsCdps ¶ added in v1.5.0
LiquidityPoolAmountEqualsCdps checks that the value of all the opened cdps equals the liquidity pool amount.
func NewHandler ¶
func NewQuerier ¶
func RegisterInvariants ¶ added in v1.5.0
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) CloseCdp ¶
CloseCdp subtract the Cdp's liquidity amount (commercio cash credits) from user's wallet, after that sends the deposited amount back to it. If these two operations ends without errors, the Cdp get closed. Errors occurs if:k.GetCdpsByOwner(ctx, testCdpOwner) - cdp doesnt exist - subtracting or adding fund to account don't end well
func (Keeper) GetCdpByOwnerAndTimeStamp ¶
func (Keeper) GetCdpsByOwner ¶
func (Keeper) GetLiquidityPoolAmount ¶
GetLiquidityPoolAmount returns the current liquidity pool amount
func (Keeper) GetMintModuleAccount ¶
func (k Keeper) GetMintModuleAccount(ctx sdk.Context) exported.ModuleAccountI
GetMintModuleAccount returns the commerciomint ModuleAccount
func (Keeper) OpenCdp ¶
func (k Keeper) OpenCdp(ctx sdk.Context, depositor sdk.AccAddress, depositAmount sdk.Coins) sdk.Error
OpenCdp subtract the given token's amount from user's wallet and deposit it into the liquidity pool then, sending him the corresponding credits amount. If all these operations are done correctly, a Collateralized Debt Position is opened. Errors occurs if: 1) deposited tokens haven't been priced yet, or are negatives or invalid; 2) signer's funds are not enough