Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func BorrowAPYInvariant(k Keeper) sdk.Invariant
- func BorrowAmountInvariant(k Keeper) sdk.Invariant
- func CollateralAmountInvariant(k Keeper) sdk.Invariant
- func InterestScalarsInvariant(k Keeper) sdk.Invariant
- func Interpolate(x, xMin, yMin, xMax, yMax sdk.Dec) sdk.Dec
- func LendAPYInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func ReserveAmountInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AccrueAllInterest(ctx sdk.Context) error
- func (k Keeper) BorrowAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, borrow sdk.Coin) error
- func (k Keeper) CalculateBorrowLimit(ctx sdk.Context, collateral sdk.Coins) (sdk.Dec, error)
- func (k Keeper) CalculateLiquidationLimit(ctx sdk.Context, collateral sdk.Coins) (sdk.Dec, error)
- func (k Keeper) DeleteRegisteredToken(ctx sdk.Context, denom string)
- func (k Keeper) DeleteRegisteredTokens(ctx sdk.Context) error
- func (k Keeper) DeriveBorrowAPY(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) DeriveBorrowUtilization(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) DeriveExchangeRate(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) DeriveLendAPY(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) EquivalentTokenValue(ctx sdk.Context, fromCoin sdk.Coin, toDenom string) (sdk.Coin, error)
- func (k Keeper) ExchangeToken(ctx sdk.Context, token sdk.Coin) (sdk.Coin, error)
- func (k Keeper) ExchangeUToken(ctx sdk.Context, uToken sdk.Coin) (sdk.Coin, error)
- func (k Keeper) ExchangeUTokens(ctx sdk.Context, uTokens sdk.Coins) (sdk.Coins, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FromTokenToUTokenDenom(ctx sdk.Context, tokenDenom string) string
- func (k Keeper) FromUTokenToTokenDenom(ctx sdk.Context, uTokenDenom string) string
- func (k Keeper) FundOracle(ctx sdk.Context, requested sdk.Coins) error
- func (k Keeper) GetAllBadDebts(ctx sdk.Context) []types.BadDebt
- func (k Keeper) GetAllRegisteredTokens(ctx sdk.Context) []types.Token
- func (k Keeper) GetAllReserves(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetAllUTokenSupply(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetAvailableToBorrow(ctx sdk.Context, denom string) sdk.Int
- func (k Keeper) GetBorrow(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string) sdk.Coin
- func (k Keeper) GetBorrowerBorrows(ctx sdk.Context, borrowerAddr sdk.AccAddress) sdk.Coins
- func (k Keeper) GetBorrowerCollateral(ctx sdk.Context, borrowerAddr sdk.AccAddress) sdk.Coins
- func (k Keeper) GetCollateralAmount(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string) sdk.Coin
- func (k Keeper) GetCollateralSetting(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string) bool
- func (k Keeper) GetCollateralWeight(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetEligibleLiquidationTargets(ctx sdk.Context) ([]sdk.AccAddress, error)
- func (k Keeper) GetInterestAtKink(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetInterestBase(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetInterestKinkUtilization(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetInterestMax(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetLastInterestTime(ctx sdk.Context) int64
- func (k Keeper) GetLenderLoaned(ctx sdk.Context, lenderAddr sdk.AccAddress) (sdk.Coins, error)
- func (k Keeper) GetLiquidationIncentive(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetLiquidationThreshold(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetLoaned(ctx sdk.Context, lenderAddr sdk.AccAddress, denom string) (sdk.Coin, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRegisteredToken(ctx sdk.Context, denom string) (types.Token, error)
- func (k Keeper) GetReserveAmount(ctx sdk.Context, denom string) sdk.Int
- func (k Keeper) GetReserveFactor(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) GetTotalBorrowed(ctx sdk.Context, denom string) sdk.Coin
- func (k Keeper) GetTotalLoaned(ctx sdk.Context, denom string) (sdk.Coin, error)
- func (k Keeper) GetUTokenSupply(ctx sdk.Context, denom string) sdk.Coin
- func (k Keeper) HasCollateral(ctx sdk.Context, borrowerAddr sdk.AccAddress) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IsAcceptedToken(ctx sdk.Context, tokenDenom string) bool
- func (k Keeper) IsAcceptedUToken(ctx sdk.Context, uTokenDenom string) bool
- func (k Keeper) LendAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, loan sdk.Coin) error
- func (k Keeper) LiquidateBorrow(ctx sdk.Context, liquidatorAddr, borrowerAddr sdk.AccAddress, ...) (sdk.Int, sdk.Int, error)
- func (k Keeper) LiquidationParams(ctx sdk.Context, reward string, borrowed sdk.Dec, limit sdk.Dec) (sdk.Dec, sdk.Dec, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ModuleBalance(ctx sdk.Context, denom string) sdk.Int
- func (k Keeper) RepayAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, payment sdk.Coin) (sdk.Int, error)
- func (k Keeper) RepayBadDebt(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string) (bool, error)
- func (k Keeper) SetCollateralSetting(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string, enable bool) error
- func (k *Keeper) SetHooks(h types.Hooks) *Keeper
- func (k *Keeper) SetLastInterestTime(ctx sdk.Context, interestTime int64) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetRegisteredToken(ctx sdk.Context, token types.Token)
- func (k Keeper) SweepBadDebts(ctx sdk.Context) error
- func (k Keeper) TokenPrice(ctx sdk.Context, denom string) (sdk.Dec, error)
- func (k Keeper) TokenValue(ctx sdk.Context, coin sdk.Coin) (sdk.Dec, error)
- func (k Keeper) TotalTokenValue(ctx sdk.Context, coins sdk.Coins) (sdk.Dec, error)
- func (k Keeper) WithdrawAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, withdrawal sdk.Coin) error
- type Querier
- func (q Querier) AvailableBorrow(goCtx context.Context, req *types.QueryAvailableBorrowRequest) (*types.QueryAvailableBorrowResponse, error)
- func (q Querier) BorrowAPY(goCtx context.Context, req *types.QueryBorrowAPYRequest) (*types.QueryBorrowAPYResponse, error)
- func (q Querier) BorrowLimit(goCtx context.Context, req *types.QueryBorrowLimitRequest) (*types.QueryBorrowLimitResponse, error)
- func (q Querier) Borrowed(goCtx context.Context, req *types.QueryBorrowedRequest) (*types.QueryBorrowedResponse, error)
- func (q Querier) BorrowedValue(goCtx context.Context, req *types.QueryBorrowedValueRequest) (*types.QueryBorrowedValueResponse, error)
- func (q Querier) Collateral(goCtx context.Context, req *types.QueryCollateralRequest) (*types.QueryCollateralResponse, error)
- func (q Querier) CollateralSetting(goCtx context.Context, req *types.QueryCollateralSettingRequest) (*types.QueryCollateralSettingResponse, error)
- func (q Querier) CollateralValue(goCtx context.Context, req *types.QueryCollateralValueRequest) (*types.QueryCollateralValueResponse, error)
- func (q Querier) ExchangeRate(goCtx context.Context, req *types.QueryExchangeRateRequest) (*types.QueryExchangeRateResponse, error)
- func (q Querier) LendAPY(goCtx context.Context, req *types.QueryLendAPYRequest) (*types.QueryLendAPYResponse, error)
- func (q Querier) LiquidationLimit(goCtx context.Context, req *types.QueryLiquidationLimitRequest) (*types.QueryLiquidationLimitResponse, error)
- func (q Querier) LiquidationTargets(goCtx context.Context, req *types.QueryLiquidationTargetsRequest) (*types.QueryLiquidationTargetsResponse, error)
- func (q Querier) Loaned(goCtx context.Context, req *types.QueryLoanedRequest) (*types.QueryLoanedResponse, error)
- func (q Querier) LoanedValue(goCtx context.Context, req *types.QueryLoanedValueRequest) (*types.QueryLoanedValueResponse, error)
- func (q Querier) MarketSize(goCtx context.Context, req *types.QueryMarketSizeRequest) (*types.QueryMarketSizeResponse, error)
- func (q Querier) MarketSummary(goCtx context.Context, req *types.QueryMarketSummaryRequest) (*types.QueryMarketSummaryResponse, error)
- func (q Querier) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (q Querier) RegisteredTokens(goCtx context.Context, req *types.QueryRegisteredTokens) (*types.QueryRegisteredTokensResponse, error)
- func (q Querier) ReserveAmount(goCtx context.Context, req *types.QueryReserveAmountRequest) (*types.QueryReserveAmountResponse, error)
- func (q Querier) TokenMarketSize(goCtx context.Context, req *types.QueryTokenMarketSizeRequest) (*types.QueryTokenMarketSizeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the x/leverage module.
func BorrowAPYInvariant ¶
BorrowAPYInvariant checks that Borrow APY have all positive values
func BorrowAmountInvariant ¶
BorrowAmountInvariant checks that borrow amounts have all positive values
func CollateralAmountInvariant ¶
CollateralAmountInvariant checks that collateral amounts have all positive values
func InterestScalarsInvariant ¶
InterestScalarsInvariant checks that all denoms have an interest scalar >= 1
func Interpolate ¶
Interpolate takes a line defined by two points (xMin, yMin) and (xMax, yMax), then finds the y-value of the point on that line for an input x-value. It will return yMin if xMin = xMax (i.e. a vertical line). While this function is intended for interpolation (xMin < x < xMax), it works correctly even when x is outside that range or when xMin > xMax.
func LendAPYInvariant ¶
LendAPYInvariant checks that Lend APY have all positive values
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of MsgServer for the x/leverage module.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the leverage module invariants
func ReserveAmountInvariant ¶
ReserveAmountInvariant checks that reserve amounts have non-negative balances
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, bk types.BankKeeper, ok types.OracleKeeper, ) Keeper
func (Keeper) AccrueAllInterest ¶
AccrueAllInterest is called by EndBlock when BlockHeight % InterestEpoch == 0. It should accrue interest on all open borrows, increase reserves, and set LastInterestTime to BlockTime.
func (Keeper) BorrowAsset ¶
BorrowAsset attempts to borrow tokens from the leverage module account using collateral uTokens. If asset type is invalid, collateral is insufficient, or module balance is insufficient, we return an error.
func (Keeper) CalculateBorrowLimit ¶
CalculateBorrowLimit uses the price oracle to determine the borrow limit (in USD) provided by collateral sdk.Coins, using each token's uToken exchange rate and collateral weight. An error is returned if any input coins are not uTokens or if value calculation fails.
func (Keeper) CalculateLiquidationLimit ¶
CalculateLiquidationLimit uses the price oracle to determine the liquidation limit (in USD) provided by collateral sdk.Coins, using each token's uToken exchange rate and liquidation threshold. An error is returned if any input coins are not uTokens or if value calculation fails.
func (Keeper) DeleteRegisteredToken ¶
DeleteRegisteredToken deletes a registered Token by base denomination from the x/leverage KVStore.
func (Keeper) DeleteRegisteredTokens ¶
DeleteRegisteredTokens deletes all registered tokens from the x/leverage module's KVStore.
func (Keeper) DeriveBorrowAPY ¶
DeriveBorrowAPY derives the current borrow interest rate on a token denom using its borrow utilization and token-specific params. Returns zero on invalid asset.
func (Keeper) DeriveBorrowUtilization ¶
DeriveBorrowUtilization derives the current borrow utilization of a token denom.
func (Keeper) DeriveExchangeRate ¶
DeriveExchangeRate calculated the token:uToken exchange rate of a base token denom.
func (Keeper) DeriveLendAPY ¶
DeriveLendAPY derives the current lend interest rate on a token denom using its borrow utilization borrow APY. Returns zero on invalid asset.
func (Keeper) EquivalentTokenValue ¶
func (k Keeper) EquivalentTokenValue(ctx sdk.Context, fromCoin sdk.Coin, toDenom string) (sdk.Coin, error)
EquivalentValue returns the amount of a selected denom which would have equal USD value to a provided sdk.Coin
func (Keeper) ExchangeToken ¶
ExchangeToken converts an sdk.Coin containing a base asset to its value as a uToken.
func (Keeper) ExchangeUToken ¶
ExchangeUToken converts an sdk.Coin containing a uToken to its value in a base token.
func (Keeper) ExchangeUTokens ¶
ExchangeUTokens converts an sdk.Coins containing uTokens to their values in base tokens.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the x/leverage module's exported genesis state.
func (Keeper) FromTokenToUTokenDenom ¶
FromTokenToUTokenDenom adds the uToken prefix ("u/") to an input denom. An empty string is returned if the input token denom is not an accepted asset type.
func (Keeper) FromUTokenToTokenDenom ¶
FromUTokenToTokenDenom strips the uToken prefix ("u/") from an input denom. An empty string is returned if the prefix is not present or if the resulting token denom is not an accepted asset type.
func (Keeper) FundOracle ¶
FundOracle transfers requested coins to the oracle module account, as long as the leverage module account has sufficient unreserved assets.
func (Keeper) GetAllBadDebts ¶
GetAllBadDebts gets bad debt instances across all borrowers.
func (Keeper) GetAllRegisteredTokens ¶
GetAllRegisteredTokens returns all the registered tokens from the x/leverage module's KVStore.
func (Keeper) GetAllReserves ¶
GetAllReserves returns all reserves.
func (Keeper) GetAllUTokenSupply ¶
GetAllUTokenSupply returns total supply of all uToken denoms.
func (Keeper) GetAvailableToBorrow ¶
GetAvailableToBorrow gets the amount available to borrow of a given token.
func (Keeper) GetBorrow ¶
GetBorrow returns an sdk.Coin representing how much of a given denom a borrower currently owes.
func (Keeper) GetBorrowerBorrows ¶
GetBorrowerBorrows returns an sdk.Coins object containing all open borrows associated with an address.
func (Keeper) GetBorrowerCollateral ¶
GetBorrowerCollateral returns an sdk.Coins containing all of a borrower's collateral.
func (Keeper) GetCollateralAmount ¶
func (k Keeper) GetCollateralAmount(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string) sdk.Coin
GetCollateralAmount returns an sdk.Coin representing how much of a given denom the x/leverage module account currently holds as collateral for a given borrower.
func (Keeper) GetCollateralSetting ¶
func (k Keeper) GetCollateralSetting(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string) bool
GetCollateralSetting checks if a uToken denom is enabled for use as collateral by a single borrower.
func (Keeper) GetCollateralWeight ¶
GetCollateralWeight gets collateral weight of a given token.
func (Keeper) GetEligibleLiquidationTargets ¶
GetEligibleLiquidationTargets returns a list of borrower addresses eligible for liquidation.
func (Keeper) GetInterestAtKink ¶
GetInterestAtKink gets the interest rate at the "kink" in the utilization:interest graph for a given token.
func (Keeper) GetInterestBase ¶
GetInterestBase gets the base interest rate for a given token.
func (Keeper) GetInterestKinkUtilization ¶
GetInterestKinkUtilization gets the utilization at the "kink" in the utilization:interest graph for a given token.
func (Keeper) GetInterestMax ¶
GetInterestMax gets the maximum interest rate for a given token.
func (Keeper) GetLastInterestTime ¶
GetLastInterestTime gets last time at which interest was accrued
func (Keeper) GetLenderLoaned ¶
GetLenderLoaned returns the total tokens loaned by a lender across all denoms, including any interest accrued.
func (Keeper) GetLiquidationIncentive ¶
GetLiquidationIncentive gets liquidation incentive of a given token.
func (Keeper) GetLiquidationThreshold ¶
GetLiquidationThreshold gets liquidation threshold of a given token.
func (Keeper) GetLoaned ¶
func (k Keeper) GetLoaned(ctx sdk.Context, lenderAddr sdk.AccAddress, denom string) (sdk.Coin, error)
GetLoaned returns an sdk.Coin representing how much of a given denom a lender has loaned, including interest accrued.
func (Keeper) GetRegisteredToken ¶
GetRegisteredToken gets a token from the x/leverage module's KVStore.
func (Keeper) GetReserveAmount ¶
GetReserveAmount gets the amount reserved of a specified token. On invalid asset, the reserved amount is zero.
func (Keeper) GetReserveFactor ¶
GetReserveFactor gets the reserve factor for a given token.
func (Keeper) GetTotalBorrowed ¶
GetTotalBorrowed returns the total borrowed in a given denom.
func (Keeper) GetTotalLoaned ¶
GetTotalLoaned returns the total loaned by all lenders in a given denom, including any interest accrued.
func (Keeper) GetUTokenSupply ¶
GetUTokenSupply gets the total supply of a specified utoken, as tracked by module state. On invalid asset or non-uToken, the supply is zero.
func (Keeper) HasCollateral ¶
HasCollateral returns true if a borrower has any collateral.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the x/leverage module state from a provided genesis state.
func (Keeper) IsAcceptedToken ¶
IsAcceptedToken returns true if a given (non-UToken) token denom is an accepted asset type.
func (Keeper) IsAcceptedUToken ¶
IsAcceptedUToken returns true if a given uToken denom is associated with an accepted base asset type.
func (Keeper) LendAsset ¶
LendAsset attempts to deposit assets into the leverage module account in exchange for uTokens. If asset type is invalid or account balance is insufficient, we return an error.
func (Keeper) LiquidateBorrow ¶
func (k Keeper) LiquidateBorrow( ctx sdk.Context, liquidatorAddr, borrowerAddr sdk.AccAddress, desiredRepayment, desiredReward sdk.Coin, ) (sdk.Int, sdk.Int, error)
LiquidateBorrow attempts to repay one of an eligible borrower's borrows (in part or in full) in exchange for a selected denomination of uToken collateral, specified by its associated token denom. The liquidator may also specify a minimum reward amount, again in base token denom that will be adjusted by uToken exchange rate, they would accept for the specified repayment. If the borrower is not over their liquidation limit, or the repayment or reward denominations are invalid, an error is returned. If the attempted repayment is greater than the amount owed or the maximum that can be repaid due to parameters (close factor) then a partial liquidation, equal to the maximum valid amount, is performed. The same occurs if the value of collateral in the selected reward denomination cannot cover the proposed repayment. Because partial liquidation is possible and exchange rates vary, LiquidateBorrow returns the actual amount of tokens repaid and uTokens rewarded (in that order).
func (Keeper) LiquidationParams ¶
func (k Keeper) LiquidationParams( ctx sdk.Context, reward string, borrowed sdk.Dec, limit sdk.Dec, ) (sdk.Dec, sdk.Dec, error)
LiquidationParams computes dynamic liquidation parameters based on collateral denomination, borrowed value, and liquidation limit. Returns liquidationIncentive (the ratio of bonus collateral awarded during Liquidate transactions, and closeFactor (the fraction of a borrower's total borrowed value that can be repaid by a liquidator in a single liquidation event.)
func (Keeper) ModuleBalance ¶
ModuleBalance returns the amount of a given token held in the x/leverage module account
func (Keeper) RepayAsset ¶
func (k Keeper) RepayAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, payment sdk.Coin) (sdk.Int, error)
RepayAsset attempts to repay an open borrow position with base assets. If asset type is invalid, account balance is insufficient, or no open borrow position exists, we return an error. Additionally, if the amount provided is greater than the full repayment amount, only the necessary amount is transferred. Because amount repaid may be less than the repayment attempted, RepayAsset returns the actual amount repaid.
func (Keeper) RepayBadDebt ¶
func (k Keeper) RepayBadDebt(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string) (bool, error)
RepayBadDebt uses reserves to repay borrower's debts of a given denom. It returns a boolean representing whether full repayment was achieved.
func (Keeper) SetCollateralSetting ¶
func (k Keeper) SetCollateralSetting(ctx sdk.Context, borrowerAddr sdk.AccAddress, denom string, enable bool) error
SetCollateralSetting enables or disables a uToken denom for use as collateral by a single borrower.
func (*Keeper) SetLastInterestTime ¶
SetLastInterestTime sets LastInterestTime to a given value
func (Keeper) SetRegisteredToken ¶
SetRegisteredToken stores a Token into the x/leverage module's KVStore.
func (Keeper) SweepBadDebts ¶
SweepBadDebts attempts to repay all bad debts in the system.
func (Keeper) TokenPrice ¶
TokenPrice returns the USD value of a base token. Note, the token's denomination must be the base denomination, e.g. uumee. The x/oracle module must know of the base and display/symbol denominations for each exchange pair. E.g. it must know about the UMEE/USD exchange rate along with the uumee base denomination and the exponent. This function will not return non-positive exchange rates, preferring to error instead.
func (Keeper) TokenValue ¶
TokenValue returns the total token value given a Coin. An error is returned if we cannot get the token's price or if it's not an accepted token.
func (Keeper) TotalTokenValue ¶
TotalTokenValue returns the total value of all supplied tokens. It is equivalent to calling GetTokenValue on each coin individually.
func (Keeper) WithdrawAsset ¶
func (k Keeper) WithdrawAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, withdrawal sdk.Coin) error
WithdrawAsset attempts to deposit uTokens into the leverage module in exchange for the original tokens loaned. Accepts either a uToken amount to withdraw or an equivalent base token amount to be converted automatically via exchange rate. If the token or uToken denom is invalid or account balance insufficient for either lender or module, we return an error.
type Querier ¶
type Querier struct {
Keeper
}
Querier implements a QueryServer for the x/leverage module.
func NewQuerier ¶
func (Querier) AvailableBorrow ¶
func (q Querier) AvailableBorrow( goCtx context.Context, req *types.QueryAvailableBorrowRequest, ) (*types.QueryAvailableBorrowResponse, error)
func (Querier) BorrowAPY ¶
func (q Querier) BorrowAPY( goCtx context.Context, req *types.QueryBorrowAPYRequest, ) (*types.QueryBorrowAPYResponse, error)
func (Querier) BorrowLimit ¶
func (q Querier) BorrowLimit( goCtx context.Context, req *types.QueryBorrowLimitRequest, ) (*types.QueryBorrowLimitResponse, error)
func (Querier) Borrowed ¶
func (q Querier) Borrowed( goCtx context.Context, req *types.QueryBorrowedRequest, ) (*types.QueryBorrowedResponse, error)
func (Querier) BorrowedValue ¶
func (q Querier) BorrowedValue( goCtx context.Context, req *types.QueryBorrowedValueRequest, ) (*types.QueryBorrowedValueResponse, error)
func (Querier) Collateral ¶
func (q Querier) Collateral( goCtx context.Context, req *types.QueryCollateralRequest, ) (*types.QueryCollateralResponse, error)
func (Querier) CollateralSetting ¶
func (q Querier) CollateralSetting( goCtx context.Context, req *types.QueryCollateralSettingRequest, ) (*types.QueryCollateralSettingResponse, error)
func (Querier) CollateralValue ¶
func (q Querier) CollateralValue( goCtx context.Context, req *types.QueryCollateralValueRequest, ) (*types.QueryCollateralValueResponse, error)
func (Querier) ExchangeRate ¶
func (q Querier) ExchangeRate( goCtx context.Context, req *types.QueryExchangeRateRequest, ) (*types.QueryExchangeRateResponse, error)
func (Querier) LendAPY ¶
func (q Querier) LendAPY( goCtx context.Context, req *types.QueryLendAPYRequest, ) (*types.QueryLendAPYResponse, error)
func (Querier) LiquidationLimit ¶
func (q Querier) LiquidationLimit( goCtx context.Context, req *types.QueryLiquidationLimitRequest, ) (*types.QueryLiquidationLimitResponse, error)
func (Querier) LiquidationTargets ¶
func (q Querier) LiquidationTargets( goCtx context.Context, req *types.QueryLiquidationTargetsRequest, ) (*types.QueryLiquidationTargetsResponse, error)
func (Querier) Loaned ¶
func (q Querier) Loaned( goCtx context.Context, req *types.QueryLoanedRequest, ) (*types.QueryLoanedResponse, error)
func (Querier) LoanedValue ¶
func (q Querier) LoanedValue( goCtx context.Context, req *types.QueryLoanedValueRequest, ) (*types.QueryLoanedValueResponse, error)
func (Querier) MarketSize ¶
func (q Querier) MarketSize( goCtx context.Context, req *types.QueryMarketSizeRequest, ) (*types.QueryMarketSizeResponse, error)
func (Querier) MarketSummary ¶ added in v2.0.2
func (q Querier) MarketSummary( goCtx context.Context, req *types.QueryMarketSummaryRequest, ) (*types.QueryMarketSummaryResponse, error)
func (Querier) Params ¶
func (q Querier) Params( goCtx context.Context, req *types.QueryParamsRequest, ) (*types.QueryParamsResponse, error)
func (Querier) RegisteredTokens ¶
func (q Querier) RegisteredTokens( goCtx context.Context, req *types.QueryRegisteredTokens, ) (*types.QueryRegisteredTokensResponse, error)
func (Querier) ReserveAmount ¶
func (q Querier) ReserveAmount( goCtx context.Context, req *types.QueryReserveAmountRequest, ) (*types.QueryReserveAmountResponse, error)
func (Querier) TokenMarketSize ¶
func (q Querier) TokenMarketSize( goCtx context.Context, req *types.QueryTokenMarketSizeRequest, ) (*types.QueryTokenMarketSizeResponse, error)