Documentation ¶
Index ¶
- Variables
- func CalculatGrowRatePercent(backing_ratio sdk.Int) (sdk.Int, error)
- func CheckCoinDenom(coins sdk.Coins, denom string) error
- func CheckCoinsLen(coins sdk.Coins, amt int) error
- func GetLendAssetIDBytes(id uint64) []byte
- func GetLendAssetIDFromBytes(bz []byte) uint64
- func GetLiquidatorPositionIDBytes(id uint64) []byte
- func GetLiquidatorPositionIDFromBytes(bz []byte) uint64
- func GetLoanIDBytes(id uint64) []byte
- func GetLoanIDFromBytes(bz []byte) uint64
- func GetPairIDBytes(id uint64) []byte
- func GetPairIDFromBytes(bz []byte) uint64
- func GetPositionIDBytes(id uint64) []byte
- func GetPositionIDFromBytes(bz []byte) uint64
- type Data
- type Keeper
- func (k Keeper) AddressEmptyCheck(ctx sdk.Context) bool
- func (k Keeper) AllFundAddress(goCtx context.Context, req *types.QueryAllFundAddressRequest) (*types.QueryAllFundAddressResponse, error)
- func (k Keeper) AllLiquidatorPosition(goCtx context.Context, req *types.QueryAllLiquidatorPositionRequest) (*types.QueryAllLiquidatorPositionResponse, error)
- func (k Keeper) AllPairs(goCtx context.Context, req *types.AllPairsRequest) (*types.AllPairsResponse, error)
- func (k Keeper) AllPosition(goCtx context.Context, req *types.QueryAllPositionRequest) (*types.QueryAllPositionResponse, error)
- func (k Keeper) AppendLendAsset(ctx sdk.Context, LendAsset types.LendAsset) uint64
- func (k Keeper) AppendLiquidatorPosition(ctx sdk.Context, LiquidatorPosition types.LiquidatorPosition) uint64
- func (k Keeper) AppendLoan(ctx sdk.Context, loan types.Loan) uint64
- func (k Keeper) AppendPair(ctx sdk.Context, pair types.GTokenPair) uint64
- func (k Keeper) AppendPosition(ctx sdk.Context, Position types.Position) uint64
- func (k Keeper) CalculateAddToReserveValue(ctx sdk.Context, val sdk.Int, gTokenPair types.GTokenPair) (sdk.Int, bool)
- func (k Keeper) CalculateAmountForRemoveFromCollateral(amt sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateAmountLiquidate(ctx sdk.Context, collateral sdk.Int, borrow sdk.Int) sdk.Int
- func (k Keeper) CalculateCreateLendAmountOut(amount sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateDeleteLendAmountOut(amount sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateDepositId(address string, denom string) string
- func (k Keeper) CalculateGTokenAPY(lastAmount sdk.Int, growRate sdk.Int, day sdk.Int) sdk.Int
- func (k Keeper) CalculateGTokenAmountOut(amount sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateGrowRate(ctx sdk.Context, gTokenPair types.GTokenPair) (sdk.Int, error)
- func (k Keeper) CalculateGrowYield(ctx sdk.Context, gTokenPair types.GTokenPair) (sdk.Int, error)
- func (k Keeper) CalculateNeedAmountToGet(borrow_amount sdk.Int, borrow_time sdk.Int) sdk.Int
- func (k Keeper) CalculatePremiumAmount(ctx sdk.Context, amount sdk.Int, price sdk.Int, premium int64) (sdk.Int, sdk.Int)
- func (k Keeper) CalculateRealYield(ctx sdk.Context, gTokenPair types.GTokenPair) (sdk.Int, error)
- func (k Keeper) CalculateReturnQubeStableAmountOut(amount sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateRiskRate(collateral sdk.Int, price sdk.Int, borrow sdk.Int) (sdk.Int, error)
- func (k Keeper) ChangeGrowStakingReserveAddress(ctx sdk.Context, address sdk.AccAddress) error
- func (k Keeper) ChangeGrowStatus()
- func (k Keeper) ChangeGrowYieldReserveAddress(ctx sdk.Context, address sdk.AccAddress) error
- func (k Keeper) ChangeUSQReserveAddress(ctx sdk.Context, address sdk.AccAddress) error
- func (k Keeper) CheckDepositAmount(ctx sdk.Context, msgAmountIn string, pair types.GTokenPair) error
- func (k Keeper) CheckGrowStatus(ctx sdk.Context) error
- func (k Keeper) CheckIfLiquidatorPositionAlredyCreate(ctx sdk.Context, depositor string, denom string) error
- func (k Keeper) CheckIfPositionAlredyCreate(ctx sdk.Context, depositor string, denom string) error
- func (k Keeper) CheckLiquidator(liq sdk.Address, pos types.LiquidatorPosition) error
- func (k Keeper) CheckLoanIdInPosition(ctx sdk.Context, loanId string, position types.Position) bool
- func (k Keeper) CheckOracleAssetId(ctx sdk.Context, LendAsset types.LendAsset) error
- func (k Keeper) CheckRiskRate(collateral sdk.Int, price sdk.Int, borrow sdk.Int, desiredAmount sdk.Int) error
- func (k Keeper) CheckWithdrawalAmount(msgAmountIn string, pair types.GTokenPair) error
- func (k Keeper) CheckYieldRate(ctx sdk.Context, gTokenPair types.GTokenPair) (string, sdk.Int, error)
- func (k Keeper) CloseLiquidationPosition(goCtx context.Context, msg *types.MsgCloseLiquidationPosition) (*types.MsgCloseLiquidationPositionResponse, error)
- func (k Keeper) CreateLend(goCtx context.Context, msg *types.MsgCreateLend) (*types.MsgCreateLendResponse, error)
- func (k Keeper) DeleteLend(goCtx context.Context, msg *types.MsgDeleteLend) (*types.MsgDeleteLendResponse, error)
- func (k Keeper) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types.MsgDepositResponse, error)
- func (k Keeper) DepositCollateral(goCtx context.Context, msg *types.MsgDepositCollateral) (*types.MsgDepositCollateralResponse, error)
- func (k Keeper) ExecuteCloseLiqPosition(ctx sdk.Context, msg *types.MsgCloseLiquidationPosition) (error, sdk.Coin)
- func (k Keeper) ExecuteCreateLiqPosition(ctx sdk.Context, msg *types.MsgOpenLiquidationPosition, ...) (error, string)
- func (k Keeper) ExecuteDeleteLend(ctx sdk.Context, msg *types.MsgDeleteLend, LendAsset types.LendAsset) (error, string)
- func (k Keeper) ExecuteDeposit(ctx sdk.Context, msg *types.MsgDeposit, gTokenPair types.GTokenPair) (error, sdk.Coin)
- func (k Keeper) ExecuteDepositCollateral(ctx sdk.Context, msg *types.MsgDepositCollateral, LendAsset types.LendAsset) (error, string)
- func (k Keeper) ExecuteLend(ctx sdk.Context, msg *types.MsgCreateLend, LendAsset types.LendAsset) (error, sdk.Coin, string)
- func (k Keeper) ExecuteLiquidation(ctx sdk.Context, liquidateLendPositionList []string) error
- func (k Keeper) ExecuteWithdrawal(ctx sdk.Context, msg *types.MsgWithdrawal, gTokenPair types.GTokenPair) (error, sdk.Coin)
- func (k Keeper) ExecuteWithdrawalCollateral(ctx sdk.Context, msg *types.MsgWithdrawalCollateral, LendAsset types.LendAsset) (error, sdk.Coin)
- func (k Keeper) FastCoins(denom string, amt sdk.Int) sdk.Coins
- func (k Keeper) GenerateDenomIdHash(denom1 string) string
- func (k Keeper) GenerateLendAssetIdHash(denom1 string) string
- func (k Keeper) GenerateLiquidatorPositionId(address string, denom string, amount string, premium string) string
- func (k Keeper) GenerateLoadIdHash(denom1 string, denom2 string, amount string, borrower string, time string) string
- func (k Keeper) GetAllLendAsset(ctx sdk.Context) (list []types.LendAsset)
- func (k Keeper) GetAllLiquidatorPosition(ctx sdk.Context) (list []types.LiquidatorPosition)
- func (k Keeper) GetAllLoan(ctx sdk.Context) (list []types.Loan)
- func (k Keeper) GetAllPair(ctx sdk.Context) (list []types.GTokenPair)
- func (k Keeper) GetAllPosition(ctx sdk.Context) (list []types.Position)
- func (k Keeper) GetAmountIntFromCoins(coins string) (sdk.Int, string, error)
- func (k Keeper) GetBorrowRate(ctx sdk.Context) sdk.Int
- func (k Keeper) GetDenomIdWithdrawal(amountIn string) (string, error)
- func (k Keeper) GetGTokenPrice(ctx sdk.Context, denomID string) (sdk.Int, error)
- func (k Keeper) GetGrowStakingReserveAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetGrowYieldReserveAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetLendAssetByID(ctx sdk.Context, id uint64) (val types.LendAsset, found bool)
- func (k Keeper) GetLendAssetByLendAssetId(ctx sdk.Context, LendAssetId string) (val types.LendAsset, found bool)
- func (k Keeper) GetLendAssetByOracleAssetId(ctx sdk.Context, oracleAssetId string) (val types.LendAsset, err error)
- func (k Keeper) GetLendAssetCount(ctx sdk.Context) uint64
- func (k Keeper) GetLendAssetIdByCoins(amountIn string) (string, error)
- func (k Keeper) GetLiquidatorPositionByID(ctx sdk.Context, id uint64) (val types.LiquidatorPosition, found bool)
- func (k Keeper) GetLiquidatorPositionByLiquidatorPositionId(ctx sdk.Context, LiquidatorPositionId string) (val types.LiquidatorPosition, found bool)
- func (k Keeper) GetLiquidatorPositionCount(ctx sdk.Context) uint64
- func (k Keeper) GetLoadByLoadId(ctx sdk.Context, loadId string) (val types.Loan, found bool)
- func (k Keeper) GetLoan(ctx sdk.Context, id uint64) (val types.Loan, found bool)
- func (k Keeper) GetLoanCount(ctx sdk.Context) uint64
- func (k Keeper) GetPairByDenomID(ctx sdk.Context, denomID string) (val types.GTokenPair, found bool)
- func (k Keeper) GetPairByID(ctx sdk.Context, id uint64) (val types.GTokenPair, found bool)
- func (k Keeper) GetPairByPairID(ctx sdk.Context, id string) (stabletypes.Pair, bool)
- func (k Keeper) GetPairCount(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPositionByID(ctx sdk.Context, id uint64) (val types.Position, found bool)
- func (k Keeper) GetPositionByPositionId(ctx sdk.Context, PositionId string) (val types.Position, found bool)
- func (k Keeper) GetPositionCount(ctx sdk.Context) uint64
- func (k Keeper) GetPriceByDenom(ctx sdk.Context, denom string) (sdk.Int, error)
- func (k Keeper) GetRealRate(ctx sdk.Context) sdk.Int
- func (k Keeper) GetUSQReserveAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) IncreaseBorrowedAmountInUSDInPosition(ctx sdk.Context, position types.Position, amt sdk.Int) types.Position
- func (k Keeper) IncreaseGrowStakingReserve(ctx sdk.Context, amountIn sdk.Coins, gTokenPair types.GTokenPair, ...) (types.GTokenPair, error)
- func (k Keeper) LendAssetByLendAssetId(goCtx context.Context, req *types.QueryLendAssetByLendAssetIdRequest) (*types.QueryLendAssetByLendAssetIdResponse, error)
- func (k Keeper) LiquidatePosition(ctx sdk.Context, liqPosition types.LiquidatorPosition, posId string) (bool, error)
- func (k Keeper) LiquidatorPositionByCreator(goCtx context.Context, req *types.QueryLiquidatorPositionByCreatorRequest) (*types.QueryLiquidatorPositionByCreatorResponse, error)
- func (k Keeper) LiquidatorPositionById(goCtx context.Context, req *types.QueryLiquidatorPositionByIdRequest) (*types.QueryLiquidatorPositionByCreatorResponse, error)
- func (k Keeper) LoanById(goCtx context.Context, req *types.QueryLoanByIdRequest) (*types.QueryLoanByIdResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OpenLiquidationPosition(goCtx context.Context, msg *types.MsgOpenLiquidationPosition) (*types.MsgOpenLiquidationPositionResponse, error)
- func (k Keeper) PairByDenomId(goCtx context.Context, req *types.PairByDenomIdRequest) (*types.PairByDenomIdResponse, error)
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ParseAndCheckPremium(amount string) (sdk.Int, error)
- func (k Keeper) PositionByCreator(goCtx context.Context, req *types.QueryPositionByCreatorRequest) (*types.QueryPositionResponse, error)
- func (k Keeper) PositionById(goCtx context.Context, req *types.QueryPositionByIdRequest) (*types.QueryPositionResponse, error)
- func (k Keeper) PushLoanToPosition(ctx sdk.Context, loanId string, position types.Position) types.Position
- func (k Keeper) ReduceBorrowedAmountInUSDInPosition(ctx sdk.Context, position types.Position, amt sdk.Int) types.Position
- func (k Keeper) ReduceCollateralInPosition(ctx sdk.Context, position types.Position, amt sdk.Int) types.Position
- func (k Keeper) ReduceGrowStakingReserve(ctx sdk.Context, amountIn sdk.Coins, gTokenPair types.GTokenPair) (types.GTokenPair, error)
- func (k Keeper) RegisterLendAsset(ctx sdk.Context, p types.LendAsset) error
- func (k Keeper) RegisterPair(ctx sdk.Context, p types.GTokenPair) error
- func (k Keeper) RemoveLendAsset(ctx sdk.Context, id uint64)
- func (k Keeper) RemoveLiquidatorPosition(ctx sdk.Context, id uint64)
- func (k Keeper) RemoveLoan(ctx sdk.Context, id uint64)
- func (k Keeper) RemoveLoanInPosition(ctx sdk.Context, loanId string, position types.Position) types.Position
- func (k Keeper) RemovePair(ctx sdk.Context, id uint64)
- func (k Keeper) RemovePosition(ctx sdk.Context, id uint64)
- func (k Keeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, ...) error
- func (k Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SetBorrowRate(ctx sdk.Context, val sdk.Int) error
- func (k Keeper) SetGrowStakingReserveAddress(ctx sdk.Context, newUSQStakingReserveAddress sdk.AccAddress)
- func (k Keeper) SetGrowYieldReserveAddress(ctx sdk.Context, newGrowYieldReserveAddress sdk.AccAddress)
- func (k Keeper) SetLastTimeUpdateReserve(ctx sdk.Context, val sdk.Int) error
- func (k Keeper) SetLendAsset(ctx sdk.Context, LendAsset types.LendAsset)
- func (k Keeper) SetLendAssetCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetLiquidatorPosition(ctx sdk.Context, LiquidatorPosition types.LiquidatorPosition)
- func (k Keeper) SetLiquidatorPositionCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetLoan(ctx sdk.Context, loan types.Loan)
- func (k Keeper) SetLoanCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetPair(ctx sdk.Context, Pair types.GTokenPair)
- func (k Keeper) SetPairCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPosition(ctx sdk.Context, Position types.Position)
- func (k Keeper) SetPositionCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetRealRate(ctx sdk.Context, val sdk.Int) error
- func (k Keeper) SetUSQReserveAddress(ctx sdk.Context, newUSQReserveAddress sdk.AccAddress)
- func (k Keeper) UpdateGTokenPrice(ctx sdk.Context, gTokenPair types.GTokenPair) error
- func (k Keeper) Withdrawal(goCtx context.Context, msg *types.MsgWithdrawal) (*types.MsgWithdrawalResponse, error)
- func (k Keeper) WithdrawalCollateral(goCtx context.Context, msg *types.MsgWithdrawalCollateral) (*types.MsgWithdrawalCollateralResponse, error)
- func (k Keeper) YieldPercentage(goCtx context.Context, req *types.QueryYieldPercentageRequest) (*types.QueryYieldPercentageResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ( USQReserveAddress sdk.AccAddress GrowYieldReserveAddress sdk.AccAddress GrowStakingReserveAddress sdk.AccAddress )
var ( RealRate sdk.Int BorrowRate sdk.Int )
var (
GrowStatus bool = false
)
Functions ¶
func GetLendAssetIDBytes ¶
func GetLendAssetIDFromBytes ¶
func GetLoanIDBytes ¶
GetLoanIDBytes returns the byte representation of the ID
func GetLoanIDFromBytes ¶
GetLoanIDFromBytes returns ID in uint64 format from a byte array
func GetPairIDBytes ¶
func GetPairIDFromBytes ¶
func GetPositionIDBytes ¶
func GetPositionIDFromBytes ¶
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, oracleKeeper types.OracleKeeper, stableKeeper types.StableKeeper, ) *Keeper
func (Keeper) AddressEmptyCheck ¶ added in v0.1.2
func (Keeper) AllFundAddress ¶
func (k Keeper) AllFundAddress(goCtx context.Context, req *types.QueryAllFundAddressRequest) (*types.QueryAllFundAddressResponse, error)
func (Keeper) AllLiquidatorPosition ¶
func (k Keeper) AllLiquidatorPosition(goCtx context.Context, req *types.QueryAllLiquidatorPositionRequest) (*types.QueryAllLiquidatorPositionResponse, error)
func (Keeper) AllPairs ¶ added in v0.2.0
func (k Keeper) AllPairs(goCtx context.Context, req *types.AllPairsRequest) (*types.AllPairsResponse, error)
func (Keeper) AllPosition ¶
func (k Keeper) AllPosition(goCtx context.Context, req *types.QueryAllPositionRequest) (*types.QueryAllPositionResponse, error)
func (Keeper) AppendLendAsset ¶
func (Keeper) AppendLiquidatorPosition ¶
func (Keeper) AppendLoan ¶
AppendLoan appends a loan in the store with a new id and update the count
func (Keeper) AppendPair ¶
func (Keeper) AppendPosition ¶
func (Keeper) CalculateAddToReserveValue ¶
func (Keeper) CalculateAmountForRemoveFromCollateral ¶
func (Keeper) CalculateAmountLiquidate ¶
func (k Keeper) CalculateAmountLiquidate(ctx sdk.Context, collateral sdk.Int, borrow sdk.Int) sdk.Int
#nosec
func (Keeper) CalculateCreateLendAmountOut ¶
func (Keeper) CalculateDeleteLendAmountOut ¶
func (Keeper) CalculateDepositId ¶
func (Keeper) CalculateGTokenAPY ¶
#nosec
func (Keeper) CalculateGTokenAmountOut ¶
func (Keeper) CalculateGrowRate ¶
func (Keeper) CalculateGrowYield ¶
func (Keeper) CalculateNeedAmountToGet ¶
func (Keeper) CalculatePremiumAmount ¶
func (Keeper) CalculateRealYield ¶
func (Keeper) CalculateReturnQubeStableAmountOut ¶
func (Keeper) CalculateRiskRate ¶
func (k Keeper) CalculateRiskRate(collateral sdk.Int, price sdk.Int, borrow sdk.Int) (sdk.Int, error)
#nosec
func (Keeper) ChangeGrowStakingReserveAddress ¶
func (Keeper) ChangeGrowYieldReserveAddress ¶
func (Keeper) ChangeUSQReserveAddress ¶
func (Keeper) CheckDepositAmount ¶
func (k Keeper) CheckDepositAmount(ctx sdk.Context, msgAmountIn string, pair types.GTokenPair) error
Deposit Helpers
func (Keeper) CheckIfLiquidatorPositionAlredyCreate ¶
func (Keeper) CheckIfPositionAlredyCreate ¶
func (Keeper) CheckLiquidator ¶
func (Keeper) CheckLoanIdInPosition ¶
func (Keeper) CheckOracleAssetId ¶
Lend Helpers
func (Keeper) CheckRiskRate ¶
func (Keeper) CheckWithdrawalAmount ¶
func (k Keeper) CheckWithdrawalAmount(msgAmountIn string, pair types.GTokenPair) error
func (Keeper) CheckYieldRate ¶
func (Keeper) CloseLiquidationPosition ¶
func (k Keeper) CloseLiquidationPosition(goCtx context.Context, msg *types.MsgCloseLiquidationPosition) (*types.MsgCloseLiquidationPositionResponse, error)
Msg for close liquidation postion
func (Keeper) CreateLend ¶
func (k Keeper) CreateLend(goCtx context.Context, msg *types.MsgCreateLend) (*types.MsgCreateLendResponse, error)
Msg for lend asset
func (Keeper) DeleteLend ¶
func (k Keeper) DeleteLend(goCtx context.Context, msg *types.MsgDeleteLend) (*types.MsgDeleteLendResponse, error)
Msg for delete lend
func (Keeper) Deposit ¶
func (k Keeper) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types.MsgDepositResponse, error)
Msg for USQ deposit
func (Keeper) DepositCollateral ¶
func (k Keeper) DepositCollateral(goCtx context.Context, msg *types.MsgDepositCollateral) (*types.MsgDepositCollateralResponse, error)
Msg of deposit collateral for borrowing money from x/grow
func (Keeper) ExecuteCloseLiqPosition ¶
func (Keeper) ExecuteCreateLiqPosition ¶
func (Keeper) ExecuteDeleteLend ¶
func (k Keeper) ExecuteDeleteLend(ctx sdk.Context, msg *types.MsgDeleteLend, LendAsset types.LendAsset) (error, string)
#nosec
func (Keeper) ExecuteDeposit ¶
func (k Keeper) ExecuteDeposit(ctx sdk.Context, msg *types.MsgDeposit, gTokenPair types.GTokenPair) (error, sdk.Coin)
func (Keeper) ExecuteDepositCollateral ¶
func (Keeper) ExecuteLend ¶
func (k Keeper) ExecuteLend(ctx sdk.Context, msg *types.MsgCreateLend, LendAsset types.LendAsset) (error, sdk.Coin, string)
#nosec
func (Keeper) ExecuteLiquidation ¶
#nosec
func (Keeper) ExecuteWithdrawal ¶
func (k Keeper) ExecuteWithdrawal(ctx sdk.Context, msg *types.MsgWithdrawal, gTokenPair types.GTokenPair) (error, sdk.Coin)
func (Keeper) ExecuteWithdrawalCollateral ¶
func (Keeper) GenerateDenomIdHash ¶
func (Keeper) GenerateLendAssetIdHash ¶
func (Keeper) GenerateLiquidatorPositionId ¶
func (Keeper) GenerateLoadIdHash ¶
func (Keeper) GetAllLendAsset ¶
func (Keeper) GetAllLiquidatorPosition ¶
func (k Keeper) GetAllLiquidatorPosition(ctx sdk.Context) (list []types.LiquidatorPosition)
func (Keeper) GetAllLoan ¶
GetAllLoan returns all loan
func (Keeper) GetAllPair ¶
func (k Keeper) GetAllPair(ctx sdk.Context) (list []types.GTokenPair)
func (Keeper) GetAllPosition ¶
func (Keeper) GetAmountIntFromCoins ¶
func (Keeper) GetDenomIdWithdrawal ¶
func (Keeper) GetGTokenPrice ¶
func (Keeper) GetGrowStakingReserveAddress ¶
func (k Keeper) GetGrowStakingReserveAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetGrowYieldReserveAddress ¶
func (k Keeper) GetGrowYieldReserveAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetLendAssetByID ¶
func (Keeper) GetLendAssetByLendAssetId ¶
func (Keeper) GetLendAssetByOracleAssetId ¶
func (Keeper) GetLendAssetIdByCoins ¶
func (Keeper) GetLiquidatorPositionByID ¶
func (Keeper) GetLiquidatorPositionByLiquidatorPositionId ¶
func (Keeper) GetLiquidatorPositionCount ¶
func (Keeper) GetLoadByLoadId ¶
func (Keeper) GetLoanCount ¶
GetLoanCount get the total number of loan
func (Keeper) GetPairByDenomID ¶
func (Keeper) GetPairByID ¶
func (Keeper) GetPairByPairID ¶
func (Keeper) GetPositionByID ¶
func (Keeper) GetPositionByPositionId ¶
func (Keeper) GetPriceByDenom ¶
Price Helpers
func (Keeper) GetUSQReserveAddress ¶
func (k Keeper) GetUSQReserveAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) IncreaseBorrowedAmountInUSDInPosition ¶
func (Keeper) IncreaseGrowStakingReserve ¶
func (k Keeper) IncreaseGrowStakingReserve(ctx sdk.Context, amountIn sdk.Coins, gTokenPair types.GTokenPair, qStablePair stabletypes.Pair) (types.GTokenPair, error)
func (Keeper) LendAssetByLendAssetId ¶
func (k Keeper) LendAssetByLendAssetId(goCtx context.Context, req *types.QueryLendAssetByLendAssetIdRequest) (*types.QueryLendAssetByLendAssetIdResponse, error)
func (Keeper) LiquidatePosition ¶
func (k Keeper) LiquidatePosition(ctx sdk.Context, liqPosition types.LiquidatorPosition, posId string) (bool, error)
#nosec
func (Keeper) LiquidatorPositionByCreator ¶
func (k Keeper) LiquidatorPositionByCreator(goCtx context.Context, req *types.QueryLiquidatorPositionByCreatorRequest) (*types.QueryLiquidatorPositionByCreatorResponse, error)
func (Keeper) LiquidatorPositionById ¶
func (k Keeper) LiquidatorPositionById(goCtx context.Context, req *types.QueryLiquidatorPositionByIdRequest) (*types.QueryLiquidatorPositionByCreatorResponse, error)
func (Keeper) LoanById ¶
func (k Keeper) LoanById(goCtx context.Context, req *types.QueryLoanByIdRequest) (*types.QueryLoanByIdResponse, error)
func (Keeper) OpenLiquidationPosition ¶
func (k Keeper) OpenLiquidationPosition(goCtx context.Context, msg *types.MsgOpenLiquidationPosition) (*types.MsgOpenLiquidationPositionResponse, error)
Msg for open liquidation postion
func (Keeper) PairByDenomId ¶ added in v0.2.0
func (k Keeper) PairByDenomId(goCtx context.Context, req *types.PairByDenomIdRequest) (*types.PairByDenomIdResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) ParseAndCheckPremium ¶
func (Keeper) PositionByCreator ¶
func (k Keeper) PositionByCreator(goCtx context.Context, req *types.QueryPositionByCreatorRequest) (*types.QueryPositionResponse, error)
func (Keeper) PositionById ¶
func (k Keeper) PositionById(goCtx context.Context, req *types.QueryPositionByIdRequest) (*types.QueryPositionResponse, error)
func (Keeper) PushLoanToPosition ¶
func (Keeper) ReduceBorrowedAmountInUSDInPosition ¶
func (Keeper) ReduceCollateralInPosition ¶
func (Keeper) ReduceGrowStakingReserve ¶
func (k Keeper) ReduceGrowStakingReserve(ctx sdk.Context, amountIn sdk.Coins, gTokenPair types.GTokenPair) (types.GTokenPair, error)
func (Keeper) RegisterLendAsset ¶
func for gov proposal
func (Keeper) RegisterPair ¶
#nosec
func (Keeper) RemoveLiquidatorPosition ¶
func (Keeper) RemoveLoan ¶
RemoveLoan removes a loan from the store
func (Keeper) RemoveLoanInPosition ¶
func (Keeper) SendCoinsFromAccountToModule ¶
func (Keeper) SendCoinsFromModuleToAccount ¶
func (k Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
EndBlocker Helpers
func (Keeper) SetGrowStakingReserveAddress ¶
func (k Keeper) SetGrowStakingReserveAddress(ctx sdk.Context, newUSQStakingReserveAddress sdk.AccAddress)
func (Keeper) SetGrowYieldReserveAddress ¶
func (k Keeper) SetGrowYieldReserveAddress(ctx sdk.Context, newGrowYieldReserveAddress sdk.AccAddress)
func (Keeper) SetLastTimeUpdateReserve ¶
func (Keeper) SetLendAsset ¶
func (Keeper) SetLiquidatorPosition ¶
func (k Keeper) SetLiquidatorPosition(ctx sdk.Context, LiquidatorPosition types.LiquidatorPosition)
func (Keeper) SetLiquidatorPositionCount ¶
func (Keeper) SetLoanCount ¶
SetLoanCount set the total number of loan
func (Keeper) SetUSQReserveAddress ¶
func (k Keeper) SetUSQReserveAddress(ctx sdk.Context, newUSQReserveAddress sdk.AccAddress)
func (Keeper) UpdateGTokenPrice ¶
func (Keeper) Withdrawal ¶
func (k Keeper) Withdrawal(goCtx context.Context, msg *types.MsgWithdrawal) (*types.MsgWithdrawalResponse, error)
Msg for USQ withdrawal
func (Keeper) WithdrawalCollateral ¶
func (k Keeper) WithdrawalCollateral(goCtx context.Context, msg *types.MsgWithdrawalCollateral) (*types.MsgWithdrawalCollateralResponse, error)
Msg of withdrawal collateral from x/grow
func (Keeper) YieldPercentage ¶
func (k Keeper) YieldPercentage(goCtx context.Context, req *types.QueryYieldPercentageRequest) (*types.QueryYieldPercentageResponse, error)