Documentation
¶
Index ¶
- 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 GetAssetIDBytes(id uint64) []byte
- func GetAssetIDFromBytes(bz []byte) uint64
- func GetLendIDBytes(id uint64) []byte
- func GetLendIDFromBytes(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 Keeper
- func (k Keeper) AddressEmptyCheck(ctx sdk.Context) bool
- 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) AppendAsset(ctx sdk.Context, Asset types.Asset) uint64
- func (k Keeper) AppendLend(ctx sdk.Context, Lend types.Lend) 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) AssetByAssetId(goCtx context.Context, req *types.QueryAssetByAssetIdRequest) (*types.QueryAssetByAssetIdResponse, error)
- func (k Keeper) CalculateAddToReserveValue(ctx sdk.Context, val sdk.Int, gTokenPair types.GTokenPair) (sdk.Int, bool)
- func (k Keeper) CalculateAmountByPriceAndAmountIn(amount sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateAmountForRemoveFromCollateral(amt sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateAmountLiquidate(ctx sdk.Context, collateral int64, borrow int64) sdk.Int
- func (k Keeper) CalculateDeleteLendAmountOut(amount sdk.Int, price sdk.Int) sdk.Int
- func (k Keeper) CalculateDepositId(address 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) CalculateLendId(address string, denom string, positionId string) string
- func (k Keeper) CalculateNeedAmountToGet(borrow_amount sdk.Int, borrow_time sdk.Int) sdk.Int
- func (k Keeper) CalculatePremiumAmount(ctx sdk.Context, amount sdk.Int, premium int64, price sdk.Int, price1 sdk.Int) (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, borrow sdk.Int) (sdk.Int, error)
- func (k Keeper) ChangeBorrowMethodStatus(ctx sdk.Context)
- func (k Keeper) ChangeCollateralMethodStatus(ctx sdk.Context)
- func (k Keeper) ChangeDepositMethodStatus(ctx sdk.Context)
- func (k Keeper) ChangeGrowStakingReserveAddress(ctx sdk.Context, address sdk.AccAddress) error
- 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) CheckBorrowMethodStatus(ctx sdk.Context) error
- func (k Keeper) CheckCollateralMethodStatus(ctx sdk.Context) error
- func (k Keeper) CheckDepositAmount(ctx sdk.Context, msgAmountIn string, pair types.GTokenPair) error
- func (k Keeper) CheckDepositMethodStatus(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) error
- func (k Keeper) CheckLendIdInPosition(ctx sdk.Context, lendId string, position types.Position) bool
- func (k Keeper) CheckLiquidator(address 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, Asset types.Asset) error
- func (k Keeper) CheckRiskRate(collateral 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) CreateBorrow(goCtx context.Context, msg *types.MsgCreateBorrow) (*types.MsgCreateBorrowResponse, error)
- func (k Keeper) CreateLend(goCtx context.Context, msg *types.MsgCreateLend) (*types.MsgCreateLendResponse, error)
- func (k Keeper) DeleteBorrow(goCtx context.Context, msg *types.MsgDeleteBorrow) (*types.MsgDeleteBorrowResponse, error)
- func (k Keeper) ExecuteCloseLiqPosition(ctx sdk.Context, msg *types.MsgCloseLiquidationPosition) (error, sdk.Coin)
- func (k Keeper) ExecuteCreateBorrow(ctx sdk.Context, msg *types.MsgCreateBorrow, Asset types.Asset) (error, sdk.Coin, string)
- func (k Keeper) ExecuteCreateLend(ctx sdk.Context, msg *types.MsgCreateLend, Asset types.Asset) (error, string)
- func (k Keeper) ExecuteCreateLiqPosition(ctx sdk.Context, msg *types.MsgOpenLiquidationPosition, Asset types.Asset) (error, string)
- func (k Keeper) ExecuteDeleteBorrow(ctx sdk.Context, msg *types.MsgDeleteBorrow, Asset types.Asset) (error, string)
- func (k Keeper) ExecuteDeposit(ctx sdk.Context, msg *types.MsgGrowDeposit, gTokenPair types.GTokenPair) (error, sdk.Coin)
- func (k Keeper) ExecuteLiquidation(ctx sdk.Context, liquidateLendPositionList []string) error
- func (k Keeper) ExecuteWithdrawal(ctx sdk.Context, msg *types.MsgGrowWithdrawal, gTokenPair types.GTokenPair) (error, sdk.Coin)
- func (k Keeper) ExecuteWithdrawalLend(ctx sdk.Context, msg *types.MsgWithdrawalLend, Asset types.Asset) (error, sdk.Coin)
- func (k Keeper) FastCoins(denom string, amt sdk.Int) sdk.Coins
- func (k Keeper) GenerateAssetIdHash(denom1 string) string
- func (k Keeper) GenerateDenomIdHash(denom1 string) string
- func (k Keeper) GenerateLendIdHash(denom1 string, amount string, borrower string, time string) string
- func (k Keeper) GenerateLiquidatorPositionId(address string, denom1 string, asset1 string, amount string, premium string) string
- func (k Keeper) GenerateLoanIdHash(denom string, borrower string) string
- func (k Keeper) GetAllAsset(ctx sdk.Context) (list []types.Asset)
- func (k Keeper) GetAllAssets(goCtx context.Context, req *types.QueryGetAllAssetsRequest) (*types.QueryGetAllAssetsResponse, error)
- func (k Keeper) GetAllLend(ctx sdk.Context) (list []types.Lend)
- 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) GetAssetByAssetId(ctx sdk.Context, AssetId string) (val types.Asset, found bool)
- func (k Keeper) GetAssetByDenom(ctx sdk.Context, denom string) (types.Asset, bool)
- func (k Keeper) GetAssetByID(ctx sdk.Context, id uint64) (val types.Asset, found bool)
- func (k Keeper) GetAssetByOracleAssetId(ctx sdk.Context, oracleAssetId string) (val types.Asset, err error)
- func (k Keeper) GetAssetCount(ctx sdk.Context) uint64
- func (k Keeper) GetAssetIdByCoins(amountIn string) (string, error)
- func (k Keeper) GetBorrowRate(ctx sdk.Context, id string) 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) GetLastTimeUpdateReserve(ctx sdk.Context) sdk.Int
- func (k Keeper) GetLend(ctx sdk.Context, id uint64) (val types.Lend, found bool)
- func (k Keeper) GetLendByLendId(ctx sdk.Context, lend_id string) (val types.Lend, found bool)
- func (k Keeper) GetLendCount(ctx sdk.Context) uint64
- 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) GetLiquidatorPositionsByAssetAndDenom(ctx sdk.Context, wantAssetId string, provideAssetId string) []types.LiquidatorPosition
- func (k Keeper) GetLoadByLoanId(ctx sdk.Context, loanId 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) (params 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) GetRatesByUtilizationRate(ctx sdk.Context, utilization_rate float64, asset types.Asset) (float64, float64, error)
- func (k Keeper) GetRealRate(ctx sdk.Context, id string) sdk.Int
- func (k Keeper) GetUSQReserveAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GrowDeposit(goCtx context.Context, msg *types.MsgGrowDeposit) (*types.MsgGrowDepositResponse, error)
- func (k Keeper) GrowWithdrawal(goCtx context.Context, msg *types.MsgGrowWithdrawal) (*types.MsgGrowWithdrawalResponse, error)
- 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) LendById(goCtx context.Context, req *types.QueryLendByIdRequest) (*types.QueryLendByIdResponse, error)
- func (k Keeper) LiquidatePositionByLiquidators(ctx sdk.Context, lendOracleId string, borrowOracleId string, amount sdk.Int, ...) (sdk.Int, 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.QueryLiquidatorPositionByIdResponse, 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) PushLendToPosition(ctx sdk.Context, lendId string, position types.Position) types.Position
- func (k Keeper) PushLoanToPosition(ctx sdk.Context, loanId string, position types.Position) types.Position
- func (k Keeper) ReCalculateLendLoanAmountsInUsd(ctx sdk.Context, position types.Position)
- func (k Keeper) ReduceBorrowedAmountInUSDInPosition(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) RegisterAsset(ctx sdk.Context, p types.Asset) error
- func (k Keeper) RegisterPair(ctx sdk.Context, p types.GTokenPair) error
- func (k Keeper) RemoveAsset(ctx sdk.Context, id uint64)
- func (k Keeper) RemoveLend(ctx sdk.Context, id uint64)
- func (k Keeper) RemoveLendInPosition(ctx sdk.Context, lendId string, position types.Position) types.Position
- 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) SetAsset(ctx sdk.Context, Asset types.Asset)
- func (k Keeper) SetAssetCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetBorrowRate(ctx sdk.Context, val sdk.Int, id string) error
- func (k Keeper) SetGrowStakingReserveAddress(ctx sdk.Context, newGrowStakingReserveAddress 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) SetLend(ctx sdk.Context, Lend types.Lend)
- func (k Keeper) SetLendCount(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, id string) error
- func (k Keeper) SetUSQReserveAddress(ctx sdk.Context, newUSQReserveAddress sdk.AccAddress)
- func (k Keeper) SortLiquidatorPositionsByPremium(ctx sdk.Context, lps []types.LiquidatorPosition) []types.LiquidatorPosition
- func (k Keeper) UpdateGTokenPrice(ctx sdk.Context, gTokenPair types.GTokenPair) error
- func (k Keeper) WithdrawalLend(goCtx context.Context, msg *types.MsgWithdrawalLend) (*types.MsgWithdrawalLendResponse, error)
- func (k Keeper) YieldPercentage(goCtx context.Context, req *types.QueryYieldPercentageRequest) (*types.QueryYieldPercentageResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatGrowRatePercent ¶
MATH
func GetAssetIDBytes ¶ added in v0.2.5
func GetAssetIDFromBytes ¶ added in v0.2.5
func GetLendIDBytes ¶ added in v0.2.5
GetLendIDBytes returns the byte representation of the ID
func GetLendIDFromBytes ¶ added in v0.2.5
GetLendIDFromBytes returns ID in uint64 format from a byte array
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) 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) AppendAsset ¶ added in v0.2.5
func (Keeper) AppendLend ¶ added in v0.2.5
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) AssetByAssetId ¶ added in v0.2.5
func (k Keeper) AssetByAssetId(goCtx context.Context, req *types.QueryAssetByAssetIdRequest) (*types.QueryAssetByAssetIdResponse, error)
func (Keeper) CalculateAddToReserveValue ¶
func (Keeper) CalculateAmountByPriceAndAmountIn ¶ added in v0.2.5
func (Keeper) CalculateAmountForRemoveFromCollateral ¶
func (Keeper) CalculateAmountLiquidate ¶
#nosec
func (Keeper) CalculateDeleteLendAmountOut ¶
func (Keeper) CalculateDepositId ¶
func (Keeper) CalculateGTokenAPY ¶
#nosec
func (Keeper) CalculateGTokenAmountOut ¶
func (Keeper) CalculateGrowRate ¶
func (Keeper) CalculateGrowYield ¶
func (Keeper) CalculateLendId ¶ added in v0.2.5
func (Keeper) CalculateNeedAmountToGet ¶
func (Keeper) CalculatePremiumAmount ¶
func (Keeper) CalculateRealYield ¶
func (Keeper) CalculateReturnQubeStableAmountOut ¶
func (Keeper) CalculateRiskRate ¶
#nosec
func (Keeper) ChangeBorrowMethodStatus ¶ added in v0.2.1
func (Keeper) ChangeCollateralMethodStatus ¶ added in v0.2.1
func (Keeper) ChangeDepositMethodStatus ¶ added in v0.2.1
Grow Helper
func (Keeper) ChangeGrowStakingReserveAddress ¶
func (Keeper) ChangeGrowYieldReserveAddress ¶
func (Keeper) ChangeUSQReserveAddress ¶
func (Keeper) CheckBorrowMethodStatus ¶ added in v0.2.1
func (Keeper) CheckCollateralMethodStatus ¶ added in v0.2.1
func (Keeper) CheckDepositAmount ¶
func (k Keeper) CheckDepositAmount(ctx sdk.Context, msgAmountIn string, pair types.GTokenPair) error
Deposit Helpers
func (Keeper) CheckDepositMethodStatus ¶ added in v0.2.1
func (Keeper) CheckIfLiquidatorPositionAlredyCreate ¶
func (Keeper) CheckIfPositionAlredyCreate ¶
func (Keeper) CheckLendIdInPosition ¶ added in v0.2.5
Lend ID
func (Keeper) CheckLiquidator ¶
func (Keeper) CheckLoanIdInPosition ¶
Loan ID
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) CreateBorrow ¶ added in v0.2.5
func (k Keeper) CreateBorrow(goCtx context.Context, msg *types.MsgCreateBorrow) (*types.MsgCreateBorrowResponse, error)
Msg for lend asset
func (Keeper) CreateLend ¶
func (k Keeper) CreateLend(goCtx context.Context, msg *types.MsgCreateLend) (*types.MsgCreateLendResponse, error)
Msg of deposit collateral for borrowing money from x/grow
func (Keeper) DeleteBorrow ¶ added in v0.2.5
func (k Keeper) DeleteBorrow(goCtx context.Context, msg *types.MsgDeleteBorrow) (*types.MsgDeleteBorrowResponse, error)
Msg for delete lend
func (Keeper) ExecuteCloseLiqPosition ¶
func (Keeper) ExecuteCreateBorrow ¶ added in v0.2.5
func (k Keeper) ExecuteCreateBorrow(ctx sdk.Context, msg *types.MsgCreateBorrow, Asset types.Asset) (error, sdk.Coin, string)
#nosec
func (Keeper) ExecuteCreateLend ¶ added in v0.2.5
func (k Keeper) ExecuteCreateLend(ctx sdk.Context, msg *types.MsgCreateLend, Asset types.Asset) (error, string)
#nosec
func (Keeper) ExecuteCreateLiqPosition ¶
func (Keeper) ExecuteDeleteBorrow ¶ added in v0.2.5
func (k Keeper) ExecuteDeleteBorrow(ctx sdk.Context, msg *types.MsgDeleteBorrow, Asset types.Asset) (error, string)
#nosec
func (Keeper) ExecuteDeposit ¶
func (k Keeper) ExecuteDeposit(ctx sdk.Context, msg *types.MsgGrowDeposit, gTokenPair types.GTokenPair) (error, sdk.Coin)
func (Keeper) ExecuteLiquidation ¶
#nosec
func (Keeper) ExecuteWithdrawal ¶
func (k Keeper) ExecuteWithdrawal(ctx sdk.Context, msg *types.MsgGrowWithdrawal, gTokenPair types.GTokenPair) (error, sdk.Coin)
func (Keeper) ExecuteWithdrawalLend ¶ added in v0.2.5
func (k Keeper) ExecuteWithdrawalLend(ctx sdk.Context, msg *types.MsgWithdrawalLend, Asset types.Asset) (error, sdk.Coin)
#nosec
func (Keeper) GenerateAssetIdHash ¶ added in v0.2.5
func (Keeper) GenerateDenomIdHash ¶
func (Keeper) GenerateLendIdHash ¶ added in v0.2.5
func (Keeper) GenerateLiquidatorPositionId ¶
func (Keeper) GenerateLoanIdHash ¶ added in v0.2.5
func (Keeper) GetAllAsset ¶ added in v0.2.5
func (Keeper) GetAllAssets ¶ added in v0.2.5
func (k Keeper) GetAllAssets(goCtx context.Context, req *types.QueryGetAllAssetsRequest) (*types.QueryGetAllAssetsResponse, error)
func (Keeper) GetAllLend ¶ added in v0.2.5
GetAllLend returns all Lend
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) GetAssetByAssetId ¶ added in v0.2.5
func (Keeper) GetAssetByDenom ¶ added in v0.2.5
func (Keeper) GetAssetByID ¶ added in v0.2.5
func (Keeper) GetAssetByOracleAssetId ¶ added in v0.2.5
func (Keeper) GetAssetIdByCoins ¶ added in v0.2.5
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) GetLastTimeUpdateReserve ¶ added in v0.2.0
func (Keeper) GetLendByLendId ¶ added in v0.2.5
func (Keeper) GetLiquidatorPositionByID ¶
func (Keeper) GetLiquidatorPositionByLiquidatorPositionId ¶
func (Keeper) GetLiquidatorPositionCount ¶
func (Keeper) GetLiquidatorPositionsByAssetAndDenom ¶ added in v0.2.5
func (k Keeper) GetLiquidatorPositionsByAssetAndDenom(ctx sdk.Context, wantAssetId string, provideAssetId string) []types.LiquidatorPosition
#nosec
func (Keeper) GetLoadByLoanId ¶ added in v0.2.5
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) GetRatesByUtilizationRate ¶ added in v0.2.5
func (Keeper) GetUSQReserveAddress ¶
func (k Keeper) GetUSQReserveAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GrowDeposit ¶ added in v0.2.1
func (k Keeper) GrowDeposit(goCtx context.Context, msg *types.MsgGrowDeposit) (*types.MsgGrowDepositResponse, error)
Msg for deposit
func (Keeper) GrowWithdrawal ¶ added in v0.2.1
func (k Keeper) GrowWithdrawal(goCtx context.Context, msg *types.MsgGrowWithdrawal) (*types.MsgGrowWithdrawalResponse, error)
Msg for withdrawal
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) LendById ¶ added in v0.2.5
func (k Keeper) LendById(goCtx context.Context, req *types.QueryLendByIdRequest) (*types.QueryLendByIdResponse, error)
func (Keeper) LiquidatePositionByLiquidators ¶ added in v0.2.5
func (k Keeper) LiquidatePositionByLiquidators(ctx sdk.Context, lendOracleId string, borrowOracleId string, amount sdk.Int, price sdk.Int, price1 sdk.Int) (sdk.Int, 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.QueryLiquidatorPositionByIdResponse, 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) PushLendToPosition ¶ added in v0.2.5
func (Keeper) PushLoanToPosition ¶
func (Keeper) ReCalculateLendLoanAmountsInUsd ¶ added in v0.2.5
func (Keeper) ReduceBorrowedAmountInUSDInPosition ¶
func (Keeper) ReduceGrowStakingReserve ¶
func (k Keeper) ReduceGrowStakingReserve(ctx sdk.Context, amountIn sdk.Coins, gTokenPair types.GTokenPair) (types.GTokenPair, error)
func (Keeper) RegisterAsset ¶ added in v0.2.5
func for gov proposal
func (Keeper) RegisterPair ¶
#nosec
func (Keeper) RemoveLend ¶ added in v0.2.5
RemoveLend removes a Lend from the store
func (Keeper) RemoveLendInPosition ¶ added in v0.2.5
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) SetAssetCount ¶ added in v0.2.5
func (Keeper) SetBorrowRate ¶
Borrow Rate
func (Keeper) SetGrowStakingReserveAddress ¶
func (k Keeper) SetGrowStakingReserveAddress(ctx sdk.Context, newGrowStakingReserveAddress sdk.AccAddress)
func (Keeper) SetGrowYieldReserveAddress ¶
func (k Keeper) SetGrowYieldReserveAddress(ctx sdk.Context, newGrowYieldReserveAddress sdk.AccAddress)
func (Keeper) SetLastTimeUpdateReserve ¶
LastTimeUpdateReserve
func (Keeper) SetLendCount ¶ added in v0.2.5
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) SetRealRate ¶
Real Rate
func (Keeper) SetUSQReserveAddress ¶
func (k Keeper) SetUSQReserveAddress(ctx sdk.Context, newUSQReserveAddress sdk.AccAddress)
func (Keeper) SortLiquidatorPositionsByPremium ¶ added in v0.2.5
func (k Keeper) SortLiquidatorPositionsByPremium(ctx sdk.Context, lps []types.LiquidatorPosition) []types.LiquidatorPosition
#nosec
func (Keeper) UpdateGTokenPrice ¶
func (Keeper) WithdrawalLend ¶ added in v0.2.5
func (k Keeper) WithdrawalLend(goCtx context.Context, msg *types.MsgWithdrawalLend) (*types.MsgWithdrawalLendResponse, error)
Msg of withdrawal collateral from x/grow
func (Keeper) YieldPercentage ¶
func (k Keeper) YieldPercentage(goCtx context.Context, req *types.QueryYieldPercentageRequest) (*types.QueryYieldPercentageResponse, error)
Source Files
¶
- asset_type.go
- borrow_logic.go
- deposit_logic.go
- fund_type.go
- gToken_type.go
- keeper.go
- lend_logic.go
- lend_type.go
- liquidation_logic.go
- liquidation_position_logic.go
- liquidation_position_type.go
- loan_type.go
- math.go
- msg_server.go
- pair_type.go
- params.go
- position_type.go
- query.go
- rates.go
- utils.go
- yield.go