From 1a7e6d89edcbb7a3897a3093973829fca2b7c8d4 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 13 May 2022 23:23:53 +0200 Subject: [PATCH 01/24] liquidation review --- docs/architecture/ADR-005-liquidation.md | 47 ++++++++++++----------- x/leverage/keeper/keeper.go | 48 ++++++++++-------------- x/leverage/types/errors.go | 2 +- 3 files changed, 46 insertions(+), 51 deletions(-) diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index 010e8ba2b5..919549dddf 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -22,11 +22,13 @@ Additional parameters will be required which define the liquidation incentive an Liquidation will require one message type `MsgLiquidate`, one per-token parameter `LiquidationIncentive`, and two global parameters `MinimumCloseFactor` and `CompleteLiquidationThreshold`. -There is no event type for when a borrower becomes a valid liquidation target, nor a list of valid targets stored in the module. Liquidators will have to use an off-chain tool to query their nodes periodically. +The blockchain doesn't issue any event to signal that a borrow position can be liquidated, nor provide a list of valid targets. Liquidators will have to use an off-chain tools to query their nodes periodically. ## Detailed Design -A function `IsLiquidationEligible(borrowerAddr)` can be created to determine if a borrower is currently exceeding their borrow limit. Any liquidation attempt against a borrower not over their limit will fail. +We don't provide a function that checks if a given borrower can be liquidated to avoid spamming an app with periodical queries. Any liquidation attempt against a borrower not eligible for liquidation will fail. + +A borrow position is represented by a pair `(borrower_address, coin)`, where borrower address is an entity requesting a loan. A borrower's total borrowed value (expressed in USD) can be computed from their total borrowed tokens and the `x/oracle` price oracle module. @@ -42,8 +44,8 @@ To implement the liquidation functionality of the Asset Facility, one message ty type MsgLiquidate struct { Liquidator sdk.AccAddress Borrower sdk.AccAddress - Repayment sdk.Coin // denom + amount - RewardDenom string + Repayment sdk.Coin // borrow denom + amount + RewardDenom string // collateral denom } ``` @@ -52,7 +54,7 @@ Its amount is the maximum amount of asset the liquidator is willing to repay. Th RewardDenom is the collateral type which the liquidator will receive in exchange for repaying the borrower's loan. It is always a uToken denomination. -It is necessary that messages be signed by the liquidator's account. Thus the method `GetSigners` should return the `Liquidator` address for the message type above. +`Liquidator` is the signer of the message and the account which will do repayment and receive reward. ### Partial Liquidation @@ -68,7 +70,7 @@ In the above scenarios, the `MsgLiquidate` should succeed with the maximum amoun ### Token Parameters -In order to incentivize liquidators to target certain collateral types for liquidation first, the token parameter `LiquidationIncentive` is used. +In order to incentivize liquidators to target certain collateral types for liquidation first, we introduce a `LiquidationIncentive` parameter - defined for each supported borrowed denom. When a `MsgLiquidate` causes liquidation to occur, the liquidator receives collateral equal to (100% + `RewardDenom.LiquidationIncentive`) of the repaid value worth of collateral. @@ -76,21 +78,18 @@ For example, if the liquidation incentive for `uatom` is `0.15`, then the liquid ### Calculating Liquidation Amounts -When a `MsgLiquidate` is received, the `x/leverage` module must determine if the targeted borrow address is eligible for liquidation. +When a `MsgLiquidate` is received, the `x/leverage` module must determine if the targeted borrow position is eligible for liquidation. ```go // from MsgLiquidate (liquidatorAddr, borrowerAddr, repayDenom, repayAmount, rewardDenom) borrowed := GetTotalBorrows(borrowerAddr) - // sum over the value of every sdk.Coin in the total borrowed sdk.Coins borrowValue := TotalValue(borrowed) // price oracle collateral := GetCollateralBalance(borrowerAddr) - collateral = MultiplyByCollateralWeight(collateral) - // sum over the value of every sdk.Coin in the total collateral sdk.Coins - collateralValue := TotalValue(collateral) // price oracle + maxBorrowValue := CalculateLiquidationLimit(collateral) - if borrowValue > collateralValue { + if borrowValue > maxBorrowValue { // borrower is over borrow limit, and therefore eligible for liquidation } ``` @@ -149,10 +148,11 @@ Then the borrow can be repaid and the collateral rewarded using the liquidator's > the existing liquidation designs well incentivize liquidators but sell excessive amounts of discounted collateral at the borrowers’ expenses. Examining one existing liquidation scheme ([Compound](https://zengo.com/understanding-compounds-liquidation/)), two main parameters define maximum borrower losses due to liquidation: + - Liquidation Incentive (10%) - Close Factor (50%) -When a borrower is even 0.0001% over their borrow limit, they stand to lose value equal to 5% of their borrowed value in a single liquidation event. -That is, the liquidator pays off 50% of their borrow and receives collateral worth 55% of its value. + When a borrower is even 0.0001% over their borrow limit, they stand to lose value equal to 5% of their borrowed value in a single liquidation event. + That is, the liquidator pays off 50% of their borrow and receives collateral worth 55% of its value. It should be possible to improve upon this aspect of the system by scaling one of the two parameters shown above, based on how far a borrower is over their borrow limit. @@ -160,13 +160,13 @@ It should be possible to improve upon this aspect of the system by scaling one o > > Close factor ranges from `0.0 = MinimumCloseFactor` to 1.0 when the borrower is between 0% and `20% = CompleteLiquidationThreshold` over borrow limit, then stays at 1.0 > -> | Borrow Limit (BL) |Borrowed Value (BV) | BV / BL | Close Factor | -> | - | - | - | - | -> | 100 | 100.1 | 1.001 | 0.005 | -> | 100 | 102 | 1.02 | 0.1 | -> | 100 | 110 | 1.1 | 0.5 | -> | 100 | 130 | 1.2 | 1.0 | -> | 100 | 140 | 1.4 | 1.0 | +> | Borrow Limit (BL) | Borrowed Value (BV) | BV / BL | Close Factor | +> | ----------------- | ------------------- | ------- | ------------ | +> | 100 | 100.1 | 1.001 | 0.005 | +> | 100 | 102 | 1.02 | 0.1 | +> | 100 | 110 | 1.1 | 0.5 | +> | 100 | 130 | 1.2 | 1.0 | +> | 100 | 140 | 1.4 | 1.0 | The Dynamic Close Factor takes advantage of market forces to reduce excessive collateral selloffs, by reducing the portion of collateral initially eligible for liquidation. Liquidators would have the chance to liquidate smaller portions of the borrow if profitable and bring the position back into health. @@ -189,12 +189,15 @@ In addition to the above, the liquidation tool should be able to read any global ## Consequences ### Positive + - Dynamic close factors reduce excessive risk to collateral ### Negative + - Offchain tool required to effectively scan for liquidation opportunities ### Neutral + - New message type `MsgLiquidate` is created - New per-token parameter `LiquidationIncentive` will be created to determine liquidation incentives - New global parameters `MinimumCloseFactor` and `CompleteLiquidationThreshold` will be created for close factors @@ -202,4 +205,4 @@ In addition to the above, the liquidation tool should be able to read any global ## References - [An Empirical Study of DeFi Liquidations:Incentives, Risks, and Instabilities](https://arxiv.org/pdf/2106.06389.pdf) -- [Understanding Compound's Liquidation](https://zengo.com/understanding-compounds-liquidation/) \ No newline at end of file +- [Understanding Compound's Liquidation](https://zengo.com/understanding-compounds-liquidation/) diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 63d471b760..74537a6032 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -217,18 +217,18 @@ func (k Keeper) WithdrawAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, withdr // or module balance is insufficient, we return an error. func (k Keeper) BorrowAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, borrow sdk.Coin) error { if !borrow.IsValid() { - return sdkerrors.Wrap(types.ErrInvalidAsset, borrow.String()) + return types.ErrInvalidAsset.Wrap(borrow.String()) } if !k.IsAcceptedToken(ctx, borrow.Denom) { - return sdkerrors.Wrap(types.ErrInvalidAsset, borrow.String()) + return types.ErrInvalidAsset.Wrap(borrow.String()) } // Ensure module account has sufficient unreserved tokens to loan out reservedAmount := k.GetReserveAmount(ctx, borrow.Denom) availableAmount := k.bankKeeper.GetBalance(ctx, authtypes.NewModuleAddress(types.ModuleName), borrow.Denom).Amount if borrow.Amount.GT(availableAmount.Sub(reservedAmount)) { - return sdkerrors.Wrap(types.ErrLendingPoolInsufficient, borrow.String()) + return types.ErrLendingPoolInsufficient.Wrap(borrow.String()) } // Determine amount of all tokens currently borrowed @@ -249,7 +249,8 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, borrow // Return error if borrowed value would exceed borrow limit if newBorrowedValue.GT(borrowLimit) { - return sdkerrors.Wrap(types.ErrBorrowLimitLow, borrowLimit.String()) + return types.ErrBorrowLimitLow.Wrapf("limit: %s, already borrowed: %s", + borrowLimit, borrowed) } loanTokens := sdk.NewCoins(borrow) @@ -265,32 +266,29 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, borrow return nil } -// 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. +// RepayAsset attempts to repay an open borrow position. Payment denom must be one of the +// borrowed asset. 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 (k Keeper) RepayAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, payment sdk.Coin) (sdk.Int, error) { if !payment.IsValid() { - return sdk.ZeroInt(), sdkerrors.Wrap(types.ErrInvalidAsset, payment.String()) - } - - if !k.IsAcceptedToken(ctx, payment.Denom) { - return sdk.ZeroInt(), sdkerrors.Wrap(types.ErrInvalidAsset, payment.String()) + return sdk.ZeroInt(), types.ErrInvalidAsset.Wrap(payment.String()) } // Determine amount of selected denom currently owed owed := k.GetBorrow(ctx, borrowerAddr, payment.Denom) if owed.IsZero() { // Borrower has no open borrows in the denom presented as payment - return sdk.ZeroInt(), sdkerrors.Wrap(types.ErrInvalidRepayment, payment.String()) + return sdk.ZeroInt(), types.ErrInvalidRepayment.Wrap( + "Borrower doesn't have active position in " + payment.Denom) } // Prevent overpaying payment.Amount = sdk.MinInt(owed.Amount, payment.Amount) - if !payment.IsValid() { - // Catch invalid payments (e.g. from payment.Amount < 0) - return sdk.ZeroInt(), sdkerrors.Wrap(types.ErrInvalidRepayment, payment.String()) + if err := payment.Validate(); err != nil { + return sdk.ZeroInt(), types.ErrInvalidRepayment.Wrap(err.Error()) } // send payment to leverage module account @@ -302,10 +300,8 @@ func (k Keeper) RepayAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, payment return sdk.ZeroInt(), err } - // Subtract repaid amount from borrowed amount + // Update the owed amount owed.Amount = owed.Amount.Sub(payment.Amount) - - // Store the remaining borrowed amount in keeper if err := k.setBorrow(ctx, borrowerAddr, owed); err != nil { return sdk.ZeroInt(), err } @@ -406,30 +402,26 @@ func (k Keeper) LiquidateBorrow( // get total borrowed by borrower (all denoms) borrowed := k.GetBorrowerBorrows(ctx, borrowerAddr) - - // get borrower uToken balances, for all uToken denoms enabled as collateral collateral := k.GetBorrowerCollateral(ctx, borrowerAddr) - - // use oracle helper functions to find total borrowed value in USD - borrowValue, err := k.TotalTokenValue(ctx, borrowed) + borrowValue, err := k.TotalTokenValue(ctx, borrowed) // total borrowed value in USD if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } - // compute liquidation limit from enabled collateral - liquidationLimit, err := k.CalculateLiquidationLimit(ctx, collateral) + maxBorrowValue, err := k.CalculateLiquidationLimit(ctx, collateral) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } // confirm borrower's eligibility for liquidation - if liquidationLimit.GTE(borrowValue) { - return sdk.ZeroInt(), sdk.ZeroInt(), sdkerrors.Wrap(types.ErrLiquidationIneligible, borrowerAddr.String()) + if maxBorrowValue.GTE(borrowValue) { + return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrLiquidationIneligible.Wrapf( + "%s borrowed value is below the liquidation threshold %s", borrowerAddr, maxBorrowValue) } // get reward-specific incentive and dynamic close factor baseRewardDenom := desiredReward.Denom - liquidationIncentive, closeFactor, err := k.LiquidationParams(ctx, baseRewardDenom, borrowValue, liquidationLimit) + liquidationIncentive, closeFactor, err := k.LiquidationParams(ctx, baseRewardDenom, borrowValue, maxBorrowValue) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } diff --git a/x/leverage/types/errors.go b/x/leverage/types/errors.go index 572c5ed919..eab939b680 100644 --- a/x/leverage/types/errors.go +++ b/x/leverage/types/errors.go @@ -9,7 +9,7 @@ import ( var ( ErrInvalidAsset = sdkerrors.Register(ModuleName, 1100, "invalid asset") ErrInsufficientBalance = sdkerrors.Register(ModuleName, 1101, "insufficient balance") - ErrBorrowLimitLow = sdkerrors.Register(ModuleName, 1102, "borrow limit too low") + ErrBorrowLimitLow = sdkerrors.Register(ModuleName, 1102, "borrowing over the limit") ErrLendingPoolInsufficient = sdkerrors.Register(ModuleName, 1103, "lending pool insufficient") ErrInvalidRepayment = sdkerrors.Register(ModuleName, 1104, "invalid repayment") ErrInvalidAddress = sdkerrors.Register(ModuleName, 1105, "invalid address") From a98588c443ae0341aa4539326473ac84d87cbf9d Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 13 May 2022 23:27:01 +0200 Subject: [PATCH 02/24] rename CalculateLiquidationLimit -> CalculateMaxBorrow\n\nLiquidationLimit sounds like a limit for the liquidation size. --- docs/architecture/ADR-005-liquidation.md | 2 +- x/leverage/keeper/borrows.go | 8 ++++---- x/leverage/keeper/grpc_query.go | 2 +- x/leverage/keeper/iter.go | 2 +- x/leverage/keeper/keeper.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index 919549dddf..6ae954fef7 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -87,7 +87,7 @@ When a `MsgLiquidate` is received, the `x/leverage` module must determine if the borrowValue := TotalValue(borrowed) // price oracle collateral := GetCollateralBalance(borrowerAddr) - maxBorrowValue := CalculateLiquidationLimit(collateral) + maxBorrowValue := CalculateMaxBorrow(collateral) if borrowValue > maxBorrowValue { // borrower is over borrow limit, and therefore eligible for liquidation diff --git a/x/leverage/keeper/borrows.go b/x/leverage/keeper/borrows.go index fd23c04589..f2162ad775 100644 --- a/x/leverage/keeper/borrows.go +++ b/x/leverage/keeper/borrows.go @@ -108,11 +108,11 @@ func (k Keeper) CalculateBorrowLimit(ctx sdk.Context, collateral sdk.Coins) (sdk return limit, nil } -// 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 +// CalculateMaxBorrow uses the price oracle to determine the maximum borrow (in USD) before a +// liquidation call, 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 (k Keeper) CalculateLiquidationLimit(ctx sdk.Context, collateral sdk.Coins) (sdk.Dec, error) { +func (k Keeper) CalculateMaxBorrow(ctx sdk.Context, collateral sdk.Coins) (sdk.Dec, error) { threshold := sdk.ZeroDec() for _, coin := range collateral { diff --git a/x/leverage/keeper/grpc_query.go b/x/leverage/keeper/grpc_query.go index e1178bfa5d..fe830c326a 100644 --- a/x/leverage/keeper/grpc_query.go +++ b/x/leverage/keeper/grpc_query.go @@ -528,7 +528,7 @@ func (q Querier) LiquidationLimit( collateral := q.Keeper.GetBorrowerCollateral(ctx, borrower) - limit, err := q.Keeper.CalculateLiquidationLimit(ctx, collateral) + limit, err := q.Keeper.CalculateMaxBorrow(ctx, collateral) if err != nil { return nil, err } diff --git a/x/leverage/keeper/iter.go b/x/leverage/keeper/iter.go index 0139744a0d..fbe586911d 100644 --- a/x/leverage/keeper/iter.go +++ b/x/leverage/keeper/iter.go @@ -197,7 +197,7 @@ func (k Keeper) GetEligibleLiquidationTargets(ctx sdk.Context) ([]sdk.AccAddress } // compute liquidation limit from enabled collateral - liquidationLimit, err := k.CalculateLiquidationLimit(ctx, collateral) + liquidationLimit, err := k.CalculateMaxBorrow(ctx, collateral) if err != nil { return err } diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 74537a6032..ad629bf8c0 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -408,7 +408,7 @@ func (k Keeper) LiquidateBorrow( return sdk.ZeroInt(), sdk.ZeroInt(), err } - maxBorrowValue, err := k.CalculateLiquidationLimit(ctx, collateral) + maxBorrowValue, err := k.CalculateMaxBorrow(ctx, collateral) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } From 0660d7c1452d504f914d8f00a7d3030eb8d33da1 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Sat, 14 May 2022 00:45:22 +0200 Subject: [PATCH 03/24] few more updates --- docs/architecture/ADR-005-liquidation.md | 10 +++---- x/leverage/keeper/keeper.go | 35 ++++++++++++------------ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index 6ae954fef7..6a3b9e7648 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -74,7 +74,7 @@ In order to incentivize liquidators to target certain collateral types for liqui When a `MsgLiquidate` causes liquidation to occur, the liquidator receives collateral equal to (100% + `RewardDenom.LiquidationIncentive`) of the repaid value worth of collateral. -For example, if the liquidation incentive for `uatom` is `0.15`, then the liquidator receives `u/uatom` collateral worth 115% of the borrowed base assets they repaid. The denom of the base assets does not affect this calculation. +For example, if the liquidation incentive for `atom` is `0.15`, then the liquidator receives `u/atom` collateral worth 115% of the borrowed base assets they repaid. The denom of the base assets does not affect this calculation. ### Calculating Liquidation Amounts @@ -102,10 +102,10 @@ After eligibility is confirmed, parameters governing liquidation can be fetched: liquidationIncentive, closeFactor := GetLiquidationParameters(rewardDenom, borrowValue, collateralValue) ``` -The liquidation incentive is the bonus collateral received when a liquidator repays a borrowed position -(e.g. incentive=`0.2` means liquidator receives 120% the value of their repayment back in collateral). +The liquidation incentive is a collateral bonus received when a liquidator repays a borrowed position +(e.g. incentive=`0.2` means liquidator receives 20% extra of the liquidated collateral). -The close factor is the portion of a borrow position eligible for liquidation in this single liquidation event. +The close factor is the maximum portion of a borrow position eligible for liquidation in a single liquidation event. See _Dynamic Liquidation Parameters_ section at the bottom of this document. @@ -152,7 +152,7 @@ Examining one existing liquidation scheme ([Compound](https://zengo.com/understa - Liquidation Incentive (10%) - Close Factor (50%) When a borrower is even 0.0001% over their borrow limit, they stand to lose value equal to 5% of their borrowed value in a single liquidation event. - That is, the liquidator pays off 50% of their borrow and receives collateral worth 55% of its value. + That is, the liquidator liquidates 50% of the borrowed value and receives 5% extra in collateral. It should be possible to improve upon this aspect of the system by scaling one of the two parameters shown above, based on how far a borrower is over their borrow limit. diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index ad629bf8c0..0a93cad2cd 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -394,15 +394,20 @@ func (k Keeper) LiquidateBorrow( ctx sdk.Context, liquidatorAddr, borrowerAddr sdk.AccAddress, desiredRepayment, desiredReward sdk.Coin, ) (sdk.Int, sdk.Int, error) { if !desiredRepayment.IsValid() { - return sdk.ZeroInt(), sdk.ZeroInt(), sdkerrors.Wrap(types.ErrInvalidAsset, desiredRepayment.String()) + return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrInvalidAsset.Wrap(desiredRepayment.String()) } if !k.IsAcceptedToken(ctx, desiredReward.Denom) { - return sdk.ZeroInt(), sdk.ZeroInt(), sdkerrors.Wrap(types.ErrInvalidAsset, desiredReward.String()) + return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrInvalidAsset.Wrap(desiredReward.String()) } + collateral := k.GetBorrowerCollateral(ctx, borrowerAddr) + maxCollateral := collateral.AmountOf(desiredReward.Denom) + if maxCollateral.IsZero() { + return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrInvalidAsset.Wrapf( + "borrower doesn't have %s as a collateral", desiredReward.Denom) + } // get total borrowed by borrower (all denoms) borrowed := k.GetBorrowerBorrows(ctx, borrowerAddr) - collateral := k.GetBorrowerCollateral(ctx, borrowerAddr) borrowValue, err := k.TotalTokenValue(ctx, borrowed) // total borrowed value in USD if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err @@ -450,8 +455,7 @@ func (k Keeper) LiquidateBorrow( repayment.Amount = repayment.Amount.ToDec().Mul(maxRepayValue).Quo(repayValue).TruncateInt() } - // Given repay denom and amount, use oracle to find equivalent amount of - // rewardDenom's base asset. + // Given repay denom and amount, use oracle to find equivalent amount of rewardDenom. baseReward, err := k.EquivalentTokenValue(ctx, repayment, baseRewardDenom) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err @@ -467,20 +471,19 @@ func (k Keeper) LiquidateBorrow( reward.Amount = reward.Amount.ToDec().Mul(sdk.OneDec().Add(liquidationIncentive)).TruncateInt() // reward amount cannot exceed available collateral - if reward.Amount.GT(collateral.AmountOf(reward.Denom)) { + if reward.Amount.GT(maxCollateral) { // reduce repayment.Amount to the maximum value permitted by the available collateral reward - repayment.Amount = repayment.Amount.Mul(collateral.AmountOf(reward.Denom)).Quo(reward.Amount) - // use all collateral of reward denom - reward.Amount = collateral.AmountOf(reward.Denom) + repayment.Amount = repayment.Amount.Mul(maxCollateral).Quo(reward.Amount) + reward.Amount = maxCollateral } // final check for invalid liquidation (negative/zero value after reductions above) if !repayment.Amount.IsPositive() { - return sdk.ZeroInt(), sdk.ZeroInt(), sdkerrors.Wrap(types.ErrInvalidAsset, repayment.String()) + return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrInvalidAsset.Wrap(repayment.String()) } if desiredReward.Amount.IsPositive() { - // user-controlled minimum ratio of reward to repayment, expressed in base:base assets (not uTokens) + // user-controlled minimum ratio of reward to repayment, expressed in collateral base assets (not uTokens) rewardTokenEquivalent, err := k.ExchangeUToken(ctx, reward) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err @@ -502,28 +505,26 @@ func (k Keeper) LiquidateBorrow( return sdk.ZeroInt(), sdk.ZeroInt(), err } - // store the remaining borrowed amount in keeper + // update the remaining borrowed amount owed := borrowed.AmountOf(repayment.Denom).Sub(repayment.Amount) if err = k.setBorrow(ctx, borrowerAddr, sdk.NewCoin(repayment.Denom, owed)); err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } // Reduce borrower collateral by reward amount - newBorrowerCollateral := sdk.NewCoin(reward.Denom, collateral.AmountOf(reward.Denom).Sub(reward.Amount)) + newBorrowerCollateral := sdk.NewCoin(reward.Denom, maxCollateral.Sub(reward.Amount)) if err = k.setCollateralAmount(ctx, borrowerAddr, newBorrowerCollateral); err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } - // Transfer uToken collateral reward from module account to liquidator + // If liquidator enabled the liquidated denom (uTokens) as his collateral, then we will automatically + // stake the reward. Otherwise we will send them to his account. if k.GetCollateralSetting(ctx, liquidatorAddr, reward.Denom) { - // For uToken denoms enabled as collateral by liquidator, the uTokens remain in the - // module account and the keeper tracks the amount liquidatorCollateral := k.GetCollateralAmount(ctx, liquidatorAddr, reward.Denom) if err = k.setCollateralAmount(ctx, liquidatorAddr, liquidatorCollateral.Add(reward)); err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } } else { - // For uToken denoms not enabled as collateral by liquidator, the uTokens are sent to their address err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, liquidatorAddr, sdk.NewCoins(reward)) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err From 5e5bf1e8de7b4113f67f9f4f915ad58de93e0d25 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Sat, 14 May 2022 00:52:09 +0200 Subject: [PATCH 04/24] changelog update --- CHANGELOG.md | 1 + docs/architecture/ADR-005-liquidation.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 025c3f24b6..8812c798f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking - [870](https://github.com/umee-network/umee/pull/870) Move proto v1beta1 to v1. +- [903](https://github.com/umee-network/umee/pull/903) (leverage) Renamed `Keeper.CalculateLiquidationLimit` to `CalculateMaxBorrow`. ## [v2.0.1](https://github.com/umee-network/umee/releases/tag/v2.0.1) - 2022-04-25 diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index 6a3b9e7648..8cbbb5e1c5 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -3,10 +3,11 @@ ## Changelog - November 19, 2021: Initial Draft (@toteki) +- May 2022: documentation updates (@robert-zaremba) ## Status -Proposed +Accepted ## Context From 72959e1893e1971c1e814b83de49b026329045cd Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Sat, 14 May 2022 01:20:02 +0200 Subject: [PATCH 05/24] more adr updates --- docs/architecture/ADR-005-liquidation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index 8cbbb5e1c5..72ca6594f5 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -13,7 +13,7 @@ Accepted When borrowers on Umee exceed their borrow limit due to interest accrual or asset price fluctuations, their positions become eligible for liquidation. -Third party liquidators pay off part of all of the borrower's loan, in exchange for a value of collateral equal to the amount paid off plus an additional percentage (the liquidation incentive). +Third party liquidators pay off part of all of the borrower's loan, in exchange for a value of collateral equal to the amount paid off plus an additional bonus (the liquidation incentive). We must build the features necessary for liquidators to continuously look out for liquidation opportunities, then carry out chosen liquidations. @@ -29,11 +29,11 @@ The blockchain doesn't issue any event to signal that a borrow position can be l We don't provide a function that checks if a given borrower can be liquidated to avoid spamming an app with periodical queries. Any liquidation attempt against a borrower not eligible for liquidation will fail. -A borrow position is represented by a pair `(borrower_address, coin)`, where borrower address is an entity requesting a loan. +A borrow position is represented by a pair `(borrower_address, coin)`, where borrower address is an entity requesting a loan. A borrower's total borrowed value (expressed in USD) can be computed from their total borrowed tokens and the `x/oracle` price oracle module. -A borrower's total borrowed value (expressed in USD) can be computed from their total borrowed tokens and the `x/oracle` price oracle module. +Their borrow limit is calculated similarly using the borrower's uToken balance, their collateral settings, current uToken exchange rates, and token collateral weights. Liquidation happens when a sum of borrower loans is bigger than the `CalculateMaxBorrow(borrower_collateral)`. -Their borrow limit is calculated similarly using the borrower's uToken balance, their collateral settings, current uToken exchange rates, and token collateral weights. +During liquidation any of the borrower's collateral token can be liquidated to pay off any borrower's loan denom. ### Message Types From d78079efa51dfa2e8f92dbb241d1ca91c79a7c43 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Mon, 16 May 2022 13:40:31 +0200 Subject: [PATCH 06/24] rename ErrBorrowLimitLow to ErrUndercollaterized --- x/leverage/client/tests/suite.go | 2 +- x/leverage/keeper/keeper.go | 7 ++++--- x/leverage/types/errors.go | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/x/leverage/client/tests/suite.go b/x/leverage/client/tests/suite.go index decf83b593..317dcb5012 100644 --- a/x/leverage/client/tests/suite.go +++ b/x/leverage/client/tests/suite.go @@ -1551,7 +1551,7 @@ func (s *IntegrationTestSuite) TestCmdBorrow() { val.Address.String(), "70uumee", }, - types.ErrBorrowLimitLow, + types.ErrUndercollaterized, }, { "borrow", diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 0a93cad2cd..177e329d8a 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -175,7 +175,8 @@ func (k Keeper) WithdrawAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, withdr // Return error if borrow limit would drop below borrowed value if borrowedValue.GT(newBorrowLimit) { - return sdkerrors.Wrap(types.ErrBorrowLimitLow, newBorrowLimit.String()) + return types.ErrUndercollaterized.Wrapf( + "withdraw updates the borrow limit to %s and causes liquidation", newBorrowLimit) } // reduce the lender's collateral by amountFromCollateral @@ -249,7 +250,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, borrow // Return error if borrowed value would exceed borrow limit if newBorrowedValue.GT(borrowLimit) { - return types.ErrBorrowLimitLow.Wrapf("limit: %s, already borrowed: %s", + return types.ErrUndercollaterized.Wrapf("borrow limit: %s, already borrowed: %s", borrowLimit, borrowed) } @@ -348,7 +349,7 @@ func (k Keeper) SetCollateralSetting(ctx sdk.Context, borrowerAddr sdk.AccAddres // Return error if borrow limit would drop below borrowed value if newBorrowLimit.LT(borrowedValue) { - return sdkerrors.Wrap(types.ErrBorrowLimitLow, newBorrowLimit.String()) + return types.ErrUndercollaterized.Wrap("new borrow limit: " + newBorrowLimit.String()) } // Disabling uTokens as collateral withdraws any stored collateral of the denom in question diff --git a/x/leverage/types/errors.go b/x/leverage/types/errors.go index eab939b680..3b0a6376f4 100644 --- a/x/leverage/types/errors.go +++ b/x/leverage/types/errors.go @@ -9,7 +9,7 @@ import ( var ( ErrInvalidAsset = sdkerrors.Register(ModuleName, 1100, "invalid asset") ErrInsufficientBalance = sdkerrors.Register(ModuleName, 1101, "insufficient balance") - ErrBorrowLimitLow = sdkerrors.Register(ModuleName, 1102, "borrowing over the limit") + ErrUndercollaterized = sdkerrors.Register(ModuleName, 1102, "Borrow positions are undercollaterized") ErrLendingPoolInsufficient = sdkerrors.Register(ModuleName, 1103, "lending pool insufficient") ErrInvalidRepayment = sdkerrors.Register(ModuleName, 1104, "invalid repayment") ErrInvalidAddress = sdkerrors.Register(ModuleName, 1105, "invalid address") From dc2856cf9e807bcae82a2374d77095412e6959eb Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Mon, 16 May 2022 13:45:33 +0200 Subject: [PATCH 07/24] rename CalculateMaxBorrow to CalculateLiquidationThreshold --- CHANGELOG.md | 2 +- docs/architecture/ADR-005-liquidation.md | 4 ++-- x/leverage/keeper/borrows.go | 4 ++-- x/leverage/keeper/grpc_query.go | 2 +- x/leverage/keeper/iter.go | 2 +- x/leverage/keeper/keeper.go | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a25f58501..4d338aeb29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking - [870](https://github.com/umee-network/umee/pull/870) Move proto v1beta1 to v1. -- [903](https://github.com/umee-network/umee/pull/903) (leverage) Renamed `Keeper.CalculateLiquidationLimit` to `CalculateMaxBorrow`. +- [903](https://github.com/umee-network/umee/pull/903) (leverage) Renamed `Keeper.CalculateLiquidationLimit` to `CalculateLiquidationThreshold`. ## [v2.0.1](https://github.com/umee-network/umee/releases/tag/v2.0.1) - 2022-04-25 diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index 72ca6594f5..8f7169bd18 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -31,7 +31,7 @@ We don't provide a function that checks if a given borrower can be liquidated to A borrow position is represented by a pair `(borrower_address, coin)`, where borrower address is an entity requesting a loan. A borrower's total borrowed value (expressed in USD) can be computed from their total borrowed tokens and the `x/oracle` price oracle module. -Their borrow limit is calculated similarly using the borrower's uToken balance, their collateral settings, current uToken exchange rates, and token collateral weights. Liquidation happens when a sum of borrower loans is bigger than the `CalculateMaxBorrow(borrower_collateral)`. +Their borrow limit is calculated similarly using the borrower's uToken balance, their collateral settings, current uToken exchange rates, and token collateral weights. Liquidation happens when a sum of borrower loans is bigger than the `CalculateLiquidationThreshold(borrower_collateral)`. During liquidation any of the borrower's collateral token can be liquidated to pay off any borrower's loan denom. @@ -88,7 +88,7 @@ When a `MsgLiquidate` is received, the `x/leverage` module must determine if the borrowValue := TotalValue(borrowed) // price oracle collateral := GetCollateralBalance(borrowerAddr) - maxBorrowValue := CalculateMaxBorrow(collateral) + maxBorrowValue := CalculateLiquidationThreshold(collateral) if borrowValue > maxBorrowValue { // borrower is over borrow limit, and therefore eligible for liquidation diff --git a/x/leverage/keeper/borrows.go b/x/leverage/keeper/borrows.go index f2162ad775..e7fc6f086c 100644 --- a/x/leverage/keeper/borrows.go +++ b/x/leverage/keeper/borrows.go @@ -108,11 +108,11 @@ func (k Keeper) CalculateBorrowLimit(ctx sdk.Context, collateral sdk.Coins) (sdk return limit, nil } -// CalculateMaxBorrow uses the price oracle to determine the maximum borrow (in USD) before a +// CalculateLiquidationThreshold uses the price oracle to determine the maximum borrow (in USD) before a // liquidation call, 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 (k Keeper) CalculateMaxBorrow(ctx sdk.Context, collateral sdk.Coins) (sdk.Dec, error) { +func (k Keeper) CalculateLiquidationThreshold(ctx sdk.Context, collateral sdk.Coins) (sdk.Dec, error) { threshold := sdk.ZeroDec() for _, coin := range collateral { diff --git a/x/leverage/keeper/grpc_query.go b/x/leverage/keeper/grpc_query.go index 30c08726fd..2b89481371 100644 --- a/x/leverage/keeper/grpc_query.go +++ b/x/leverage/keeper/grpc_query.go @@ -528,7 +528,7 @@ func (q Querier) LiquidationLimit( collateral := q.Keeper.GetBorrowerCollateral(ctx, borrower) - limit, err := q.Keeper.CalculateMaxBorrow(ctx, collateral) + limit, err := q.Keeper.CalculateLiquidationThreshold(ctx, collateral) if err != nil { return nil, err } diff --git a/x/leverage/keeper/iter.go b/x/leverage/keeper/iter.go index fbe586911d..6dfeab23cf 100644 --- a/x/leverage/keeper/iter.go +++ b/x/leverage/keeper/iter.go @@ -197,7 +197,7 @@ func (k Keeper) GetEligibleLiquidationTargets(ctx sdk.Context) ([]sdk.AccAddress } // compute liquidation limit from enabled collateral - liquidationLimit, err := k.CalculateMaxBorrow(ctx, collateral) + liquidationLimit, err := k.CalculateLiquidationThreshold(ctx, collateral) if err != nil { return err } diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 177e329d8a..045414faa0 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -414,7 +414,7 @@ func (k Keeper) LiquidateBorrow( return sdk.ZeroInt(), sdk.ZeroInt(), err } - maxBorrowValue, err := k.CalculateMaxBorrow(ctx, collateral) + maxBorrowValue, err := k.CalculateLiquidationThreshold(ctx, collateral) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } From 89bd956b12df4f391a7a95f51b42b7a3fea35af2 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 06:19:01 -0700 Subject: [PATCH 08/24] commit suggestion --- docs/architecture/ADR-005-liquidation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index 8f7169bd18..c5524e2584 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -33,7 +33,7 @@ A borrow position is represented by a pair `(borrower_address, coin)`, where bor Their borrow limit is calculated similarly using the borrower's uToken balance, their collateral settings, current uToken exchange rates, and token collateral weights. Liquidation happens when a sum of borrower loans is bigger than the `CalculateLiquidationThreshold(borrower_collateral)`. -During liquidation any of the borrower's collateral token can be liquidated to pay off any borrower's loan denom. +During liquidation any of the borrower's collateral tokens can be liquidated to pay off any of their loans. ### Message Types From 1a7623ababe11da40f792c27fdcbf23b36c0dd98 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 06:25:34 -0700 Subject: [PATCH 09/24] update comment --- x/leverage/keeper/iter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/leverage/keeper/iter.go b/x/leverage/keeper/iter.go index 6dfeab23cf..f0ee75c172 100644 --- a/x/leverage/keeper/iter.go +++ b/x/leverage/keeper/iter.go @@ -196,7 +196,7 @@ func (k Keeper) GetEligibleLiquidationTargets(ctx sdk.Context) ([]sdk.AccAddress return err } - // compute liquidation limit from enabled collateral + // compute liquidation threshold from enabled collateral liquidationLimit, err := k.CalculateLiquidationThreshold(ctx, collateral) if err != nil { return err From 829ea8888dc9e32840fe1b1af0f39855e6f16c89 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 17 May 2022 00:09:56 +0200 Subject: [PATCH 10/24] fix simtest --- x/leverage/simulation/operations_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/leverage/simulation/operations_test.go b/x/leverage/simulation/operations_test.go index 02ce2d03e3..c73c781824 100644 --- a/x/leverage/simulation/operations_test.go +++ b/x/leverage/simulation/operations_test.go @@ -297,7 +297,7 @@ func (s *SimTestSuite) TestSimulateMsgLiquidate() { op := simulation.SimulateMsgLiquidate(s.app.AccountKeeper, s.app.BankKeeper, s.app.LeverageKeeper) operationMsg, futureOperations, err := op(r, s.app.BaseApp, s.ctx, accs, "") s.Require().EqualError(err, - "failed to execute message; message index: 0: umee1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7wrm6ea: borrower not eligible for liquidation", + "failed to execute message; message index: 0: borrower doesn't have uumee as a collateral: invalid asset", ) var msg types.MsgLiquidate From dd8b1195821b9613613ad679a81a59c28315d538 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 17 May 2022 02:09:55 +0200 Subject: [PATCH 11/24] fix tests --- x/leverage/client/tests/suite.go | 6 +++--- x/leverage/keeper/keeper.go | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/x/leverage/client/tests/suite.go b/x/leverage/client/tests/suite.go index 317dcb5012..f965d8ba53 100644 --- a/x/leverage/client/tests/suite.go +++ b/x/leverage/client/tests/suite.go @@ -75,7 +75,7 @@ func runTestTransactions(s *IntegrationTestSuite, tcs []testTransaction) { s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), resp), out.String()) if tc.expectedErr == nil { - s.Require().Equal(0, int(resp.Code)) + s.Require().Equal(0, int(resp.Code), "events %v", resp.Events) } else { s.Require().Equal(int(tc.expectedErr.ABCICode()), int(resp.Code)) } @@ -1722,7 +1722,7 @@ func (s *IntegrationTestSuite) TestCmdRepay() { val.Address.String(), "10xyz", }, - types.ErrInvalidAsset, + types.ErrInvalidRepayment, }, { "invalid asset (uToken)", @@ -1731,7 +1731,7 @@ func (s *IntegrationTestSuite) TestCmdRepay() { val.Address.String(), "10u/umee", }, - types.ErrInvalidAsset, + types.ErrInvalidRepayment, }, { "repay", diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 045414faa0..2792a329f2 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -301,7 +301,6 @@ func (k Keeper) RepayAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, payment return sdk.ZeroInt(), err } - // Update the owed amount owed.Amount = owed.Amount.Sub(payment.Amount) if err := k.setBorrow(ctx, borrowerAddr, owed); err != nil { return sdk.ZeroInt(), err @@ -402,11 +401,6 @@ func (k Keeper) LiquidateBorrow( } collateral := k.GetBorrowerCollateral(ctx, borrowerAddr) - maxCollateral := collateral.AmountOf(desiredReward.Denom) - if maxCollateral.IsZero() { - return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrInvalidAsset.Wrapf( - "borrower doesn't have %s as a collateral", desiredReward.Denom) - } // get total borrowed by borrower (all denoms) borrowed := k.GetBorrowerBorrows(ctx, borrowerAddr) borrowValue, err := k.TotalTokenValue(ctx, borrowed) // total borrowed value in USD @@ -471,11 +465,17 @@ func (k Keeper) LiquidateBorrow( // apply liquidation incentive reward.Amount = reward.Amount.ToDec().Mul(sdk.OneDec().Add(liquidationIncentive)).TruncateInt() + maxReward := collateral.AmountOf(reward.Denom) + if maxReward.IsZero() { + return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrInvalidAsset.Wrapf( + "borrower doesn't have %s as a collateral", desiredReward.Denom) + } + // reward amount cannot exceed available collateral - if reward.Amount.GT(maxCollateral) { + if reward.Amount.GT(maxReward) { // reduce repayment.Amount to the maximum value permitted by the available collateral reward - repayment.Amount = repayment.Amount.Mul(maxCollateral).Quo(reward.Amount) - reward.Amount = maxCollateral + repayment.Amount = repayment.Amount.Mul(maxReward).Quo(reward.Amount) + reward.Amount = maxReward } // final check for invalid liquidation (negative/zero value after reductions above) @@ -513,7 +513,7 @@ func (k Keeper) LiquidateBorrow( } // Reduce borrower collateral by reward amount - newBorrowerCollateral := sdk.NewCoin(reward.Denom, maxCollateral.Sub(reward.Amount)) + newBorrowerCollateral := sdk.NewCoin(reward.Denom, maxReward.Sub(reward.Amount)) if err = k.setCollateralAmount(ctx, borrowerAddr, newBorrowerCollateral); err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } From 7a09ef304ac71b9e71a2497be6ff5e8307255af8 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 18:30:32 -0700 Subject: [PATCH 12/24] comment++ --- x/leverage/keeper/keeper.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 2792a329f2..28482c1b5d 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -267,9 +267,8 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, borrow return nil } -// RepayAsset attempts to repay an open borrow position. Payment denom must be one of the -// borrowed asset. If asset type is invalid, account balance is insufficient, or no open -// borrow position exists, we return an error. +// RepayAsset attempts to repay a borrow position. If asset type is invalid, account balance +// is insufficient, or borrower has no borrows in payment denom to repay, 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. From 91b3288e8aabf3e055348909e2d290d9791a65f6 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 18:36:24 -0700 Subject: [PATCH 13/24] comment++ --- x/leverage/keeper/borrows.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/leverage/keeper/borrows.go b/x/leverage/keeper/borrows.go index e7fc6f086c..11b6c9e8e1 100644 --- a/x/leverage/keeper/borrows.go +++ b/x/leverage/keeper/borrows.go @@ -108,8 +108,9 @@ func (k Keeper) CalculateBorrowLimit(ctx sdk.Context, collateral sdk.Coins) (sdk return limit, nil } -// CalculateLiquidationThreshold uses the price oracle to determine the maximum borrow (in USD) before a -// liquidation call, using each token's uToken exchange rate and liquidation threshold. +// CalculateLiquidationThreshold determines the maximum borrowed value (in USD) that a +// borrower with given collateral could reach before being eligible for liquidation, using +// each token's oracle price, uToken exchange rate, and liquidation threshold. // An error is returned if any input coins are not uTokens or if value // calculation fails. func (k Keeper) CalculateLiquidationThreshold(ctx sdk.Context, collateral sdk.Coins) (sdk.Dec, error) { From ab4efb639ed6e65e391058aa68cd5637a079e80a Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 18:38:46 -0700 Subject: [PATCH 14/24] clarify withdraw undercollateralized error --- x/leverage/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 28482c1b5d..1978b3d796 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -176,7 +176,7 @@ func (k Keeper) WithdrawAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, withdr // Return error if borrow limit would drop below borrowed value if borrowedValue.GT(newBorrowLimit) { return types.ErrUndercollaterized.Wrapf( - "withdraw updates the borrow limit to %s and causes liquidation", newBorrowLimit) + "withdraw would update borrow limit to %s with borrowed value %s", newBorrowLimit, borrowedValue) } // reduce the lender's collateral by amountFromCollateral From 53364b4a1a1d03e9dc854ed92f142bc01d736966 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 18:42:10 -0700 Subject: [PATCH 15/24] clarify borrow undercollateralized error --- x/leverage/keeper/keeper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 1978b3d796..29e11046c7 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -250,8 +250,8 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, borrowerAddr sdk.AccAddress, borrow // Return error if borrowed value would exceed borrow limit if newBorrowedValue.GT(borrowLimit) { - return types.ErrUndercollaterized.Wrapf("borrow limit: %s, already borrowed: %s", - borrowLimit, borrowed) + return types.ErrUndercollaterized.Wrapf("new borrowed value would be %s with borrow limit %s", + newBorrowedValue, borrowLimit) } loanTokens := sdk.NewCoins(borrow) From 8b9d2ac712b4a5b1c56650c36c7ba68ef828a521 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 19:01:53 -0700 Subject: [PATCH 16/24] update operations test expected error message --- x/leverage/simulation/operations_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/leverage/simulation/operations_test.go b/x/leverage/simulation/operations_test.go index c73c781824..f4c340be9c 100644 --- a/x/leverage/simulation/operations_test.go +++ b/x/leverage/simulation/operations_test.go @@ -297,7 +297,7 @@ func (s *SimTestSuite) TestSimulateMsgLiquidate() { op := simulation.SimulateMsgLiquidate(s.app.AccountKeeper, s.app.BankKeeper, s.app.LeverageKeeper) operationMsg, futureOperations, err := op(r, s.app.BaseApp, s.ctx, accs, "") s.Require().EqualError(err, - "failed to execute message; message index: 0: borrower doesn't have uumee as a collateral: invalid asset", + "failed to execute message; message index: 0: umee1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7wrm6ea borrowed value is below the liquidation threshold 0.005000000000000000: borrower not eligible for liquidation", ) var msg types.MsgLiquidate From 1966115b2a13459f1f46cf5e0fef30becaa2c061 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 16 May 2022 19:10:57 -0700 Subject: [PATCH 17/24] rename LiquidationLimit to LiquidationThreshold in a few more placed in spec and code --- x/leverage/keeper/keeper.go | 14 +++++++------- x/leverage/spec/01_concepts.md | 10 +++++----- x/leverage/spec/04_messages.md | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 29e11046c7..cd3baab620 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -407,20 +407,20 @@ func (k Keeper) LiquidateBorrow( return sdk.ZeroInt(), sdk.ZeroInt(), err } - maxBorrowValue, err := k.CalculateLiquidationThreshold(ctx, collateral) + liquidationThreshold, err := k.CalculateLiquidationThreshold(ctx, collateral) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } // confirm borrower's eligibility for liquidation - if maxBorrowValue.GTE(borrowValue) { + if liquidationThreshold.GTE(borrowValue) { return sdk.ZeroInt(), sdk.ZeroInt(), types.ErrLiquidationIneligible.Wrapf( - "%s borrowed value is below the liquidation threshold %s", borrowerAddr, maxBorrowValue) + "%s borrowed value is below the liquidation threshold %s", borrowerAddr, liquidationThreshold) } // get reward-specific incentive and dynamic close factor baseRewardDenom := desiredReward.Denom - liquidationIncentive, closeFactor, err := k.LiquidationParams(ctx, baseRewardDenom, borrowValue, maxBorrowValue) + liquidationIncentive, closeFactor, err := k.LiquidationParams(ctx, baseRewardDenom, borrowValue, liquidationThreshold) if err != nil { return sdk.ZeroInt(), sdk.ZeroInt(), err } @@ -549,7 +549,7 @@ func (k Keeper) LiquidateBorrow( } // LiquidationParams computes dynamic liquidation parameters based on collateral denomination, -// borrowed value, and liquidation limit. Returns liquidationIncentive (the ratio of bonus collateral +// borrowed value, and liquidation threshold. 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 (k Keeper) LiquidationParams( @@ -571,7 +571,7 @@ func (k Keeper) LiquidationParams( return sdk.ZeroDec(), sdk.ZeroDec(), err } - // special case: If liquidation limit is zero, close factor is always 1 + // special case: If liquidation threshold is zero, close factor is always 1 if limit.IsZero() { return liquidationIncentive, sdk.OneDec(), nil } @@ -590,7 +590,7 @@ func (k Keeper) LiquidationParams( } // outside of special cases, close factor scales linearly between MinimumCloseFactor and 1.0, - // reaching max value when (borrowed / limit) = 1 + CompleteLiquidationThreshold + // reaching max value when (borrowed / threshold) = 1 + CompleteLiquidationThreshold var closeFactor sdk.Dec closeFactor = Interpolate( borrowed.Quo(limit).Sub(sdk.OneDec()), // x diff --git a/x/leverage/spec/01_concepts.md b/x/leverage/spec/01_concepts.md index 68f66004a0..076334b9e7 100644 --- a/x/leverage/spec/01_concepts.md +++ b/x/leverage/spec/01_concepts.md @@ -46,7 +46,7 @@ Users have the following actions available to them: Repayments that exceed a borrower's amount owed in the selected denomination succeed at paying the reduced amount rather than failing outright. -- [Liquidate](04_messages.md#MsgLiquidate) undercollateralized borrows a different user whose total borrowed value is greater than their [Borrow Limit](01_concepts.md#Borrow-Limit). +- [Liquidate](04_messages.md#MsgLiquidate) undercollateralized borrows a different user whose total borrowed value is greater than their [Liquidation Threshold](01_concepts.md#Liquidation_Threshold). The liquidator must select a reward denomination present in the borrower's uToken collateral. Liquidation is limited by [Close Factor](01_concepts.md#Close-Factor) and available balances, and will succeed at a reduced amount rather than fail outright when possible. @@ -124,16 +124,16 @@ A user's borrow limit is the sum of the contributions from each denomination of } ``` -### Liquidation Limit +### Liquidation Threshold -Each token in the `Token Registry` has a parameter called `LiquidationThreshold`, always greater than or equal to collateral weight, but less than 1, which determines the portion of the token's value that goes towards a user's liquidation limit, when the token is used as collateral. +Each token in the `Token Registry` has a parameter called `LiquidationThreshold`, always greater than or equal to collateral weight, but less than 1, which determines the portion of the token's value that goes towards a _borrower's_ liquidation threshold, when the token is used as collateral. -A user's liquidation limit is the sum of the contributions from each denomination of collateral they have deposited. Any user whose borrow value is above their liquidation limit is eligible to be liquidated. +A user's liquidation threshold is the sum of the contributions from each denomination of collateral they have deposited. Any user whose borrow value is above their liquidation threshold is eligible to be liquidated. ```go collateral := GetBorrowerCollateral(borrower) // sdk.Coins for _, coin := range collateral { - liquidationLimit += GetLiquidationThreshold(coin.Denom) * TokenValue(coin) // TokenValue is in usd + liquidationThreshold += GetLiquidationThreshold(coin.Denom) * TokenValue(coin) // TokenValue is in usd } ``` diff --git a/x/leverage/spec/04_messages.md b/x/leverage/spec/04_messages.md index 86e95444ea..8583b8e3eb 100644 --- a/x/leverage/spec/04_messages.md +++ b/x/leverage/spec/04_messages.md @@ -107,7 +107,7 @@ The message will fail under the following conditions: - `reward` is not a valid amount of an accepted base asset - `borrower` has not borrowed any of the specified asset to repay - `borrower` has no collateral of the requested reward denom -- `borrower`'s total borrowed value does not exceed their `BorrowLimit` +- `borrower`'s total borrowed value does not exceed their `LiquidationThreshold` - `liquidator` balance is insufficient - the message's ratio of `reward` to `repayment` is higher than the ratio that would result from liquidation at the current oracle prices and liquidation incentives -- Borrowed value or `BorrowLimit` cannot be computed due to a missing `x/oracle` price \ No newline at end of file +- Borrowed value or `LiquidationThreshold` cannot be computed due to a missing `x/oracle` price \ No newline at end of file From 3bd47160f1aefb423cec64f9d832946c017df1cb Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 18 May 2022 12:55:24 +0200 Subject: [PATCH 18/24] update proto: rename LiquidationLimit -> LiquidationThreshold --- proto/umee/leverage/v1/query.proto | 328 ++++++++++++++++------------- 1 file changed, 187 insertions(+), 141 deletions(-) diff --git a/proto/umee/leverage/v1/query.proto b/proto/umee/leverage/v1/query.proto index 7fbdc904e2..76a05dff94 100644 --- a/proto/umee/leverage/v1/query.proto +++ b/proto/umee/leverage/v1/query.proto @@ -11,7 +11,8 @@ option go_package = "github.com/umee-network/umee/v2/x/leverage/types"; // Query defines the gRPC querier service. service Query { // RegisteredTokens queries for all the registered tokens. - rpc RegisteredTokens(QueryRegisteredTokens) returns (QueryRegisteredTokensResponse) { + rpc RegisteredTokens(QueryRegisteredTokens) + returns (QueryRegisteredTokensResponse) { option (google.api.http).get = "/umee/leverage/v1/registered_tokens"; } @@ -30,7 +31,8 @@ service Query { // BorrowedValue queries for the usd value of the borrowed amount of a user // by token denomination. If the denomination is not supplied, the sum across // all borrowed tokens is returned. - rpc BorrowedValue(QueryBorrowedValueRequest) returns (QueryBorrowedValueResponse) { + rpc BorrowedValue(QueryBorrowedValueRequest) + returns (QueryBorrowedValueResponse) { option (google.api.http).get = "/umee/leverage/v1/borrowed_value"; } @@ -48,8 +50,10 @@ service Query { option (google.api.http).get = "/umee/leverage/v1/loaned_value"; } - // AvailableBorrow queries for the available amount to borrow of a specified denomination. - rpc AvailableBorrow(QueryAvailableBorrowRequest) returns (QueryAvailableBorrowResponse) { + // AvailableBorrow queries for the available amount to borrow of a specified + // denomination. + rpc AvailableBorrow(QueryAvailableBorrowRequest) + returns (QueryAvailableBorrowResponse) { option (google.api.http).get = "/umee/leverage/v1/available_borrow"; } @@ -63,28 +67,32 @@ service Query { option (google.api.http).get = "/umee/leverage/v1/lend_apy"; } - // MarketSize queries for the Market Size in USD of a specified denomination, which - // is the USD value of total tokens loaned by all users plus borrow interest owed - // by all users. + // MarketSize queries for the Market Size in USD of a specified denomination, + // which is the USD value of total tokens loaned by all users plus borrow + // interest owed by all users. rpc MarketSize(QueryMarketSizeRequest) returns (QueryMarketSizeResponse) { option (google.api.http).get = "/umee/leverage/v1/market_size"; } - // TokenMarketSize queries for the Market Size in base tokens of a specified denomination, - // which is the total tokens loaned by all users plus borrow interest owed by all users. - rpc TokenMarketSize(QueryTokenMarketSizeRequest) returns (QueryTokenMarketSizeResponse) { + // TokenMarketSize queries for the Market Size in base tokens of a specified + // denomination, which is the total tokens loaned by all users plus borrow + // interest owed by all users. + rpc TokenMarketSize(QueryTokenMarketSizeRequest) + returns (QueryTokenMarketSizeResponse) { option (google.api.http).get = "/umee/leverage/v1/token_market_size"; } // ReserveAmount queries for the amount reserved of a specified denomination. // If the token is not valid, the reserved amount is zero. - rpc ReserveAmount(QueryReserveAmountRequest) returns (QueryReserveAmountResponse) { + rpc ReserveAmount(QueryReserveAmountRequest) + returns (QueryReserveAmountResponse) { option (google.api.http).get = "/umee/leverage/v1/reserve_amount"; } - // CollateralSetting queries a borrower's collateral setting (enabled or disabled) - // for a specified uToken denomination. - rpc CollateralSetting(QueryCollateralSettingRequest) returns (QueryCollateralSettingResponse) { + // CollateralSetting queries a borrower's collateral setting (enabled or + // disabled) for a specified uToken denomination. + rpc CollateralSetting(QueryCollateralSettingRequest) + returns (QueryCollateralSettingResponse) { option (google.api.http).get = "/umee/leverage/v1/collateral_setting"; } @@ -97,12 +105,15 @@ service Query { // CollateralValue queries for the total USD value of a user's collateral, or // the USD value held as a given base asset's associated uToken denomination. - rpc CollateralValue(QueryCollateralValueRequest) returns (QueryCollateralValueResponse) { + rpc CollateralValue(QueryCollateralValueRequest) + returns (QueryCollateralValueResponse) { option (google.api.http).get = "/umee/leverage/v1/collateral_value"; } - // ExchangeRate queries the uToken exchange rate of a given uToken denomination. - rpc ExchangeRate(QueryExchangeRateRequest) returns (QueryExchangeRateResponse) { + // ExchangeRate queries the uToken exchange rate of a given uToken + // denomination. + rpc ExchangeRate(QueryExchangeRateRequest) + returns (QueryExchangeRateResponse) { option (google.api.http).get = "/umee/leverage/v1/exchange_rate"; } @@ -111,18 +122,24 @@ service Query { option (google.api.http).get = "/umee/leverage/v1/borrow_limit"; } - // LiquidationLimit queries the limit in USD above which a given borrower is eligible for liquidation. - rpc LiquidationLimit(QueryLiquidationLimitRequest) returns (QueryLiquidationLimitResponse) { - option (google.api.http).get = "/umee/leverage/v1/liquidation_limit"; + // LiquidationThreshold returns a maximum borrow value in USD above which a + // given borrower is eligible for liquidation. + rpc LiquidationThreshold(QueryLiquidationThresholdRequest) + returns (QueryLiquidationThresholdResponse) { + option (google.api.http).get = "/umee/leverage/v1/liquidation_threshold"; } - // LiquidationTargets queries a list of all borrower addresses eligible for liquidation. - rpc LiquidationTargets(QueryLiquidationTargetsRequest) returns (QueryLiquidationTargetsResponse) { + // LiquidationTargets queries a list of all borrower addresses eligible for + // liquidation. + rpc LiquidationTargets(QueryLiquidationTargetsRequest) + returns (QueryLiquidationTargetsResponse) { option (google.api.http).get = "/umee/leverage/v1/liquidation_targets"; } - // MarketSummary queries a base asset's current borrowing and lending conditions. - rpc MarketSummary(QueryMarketSummaryRequest) returns (QueryMarketSummaryResponse) { + // MarketSummary queries a base asset's current borrowing and lending + // conditions. + rpc MarketSummary(QueryMarketSummaryRequest) + returns (QueryMarketSummaryResponse) { option (google.api.http).get = "/umee/leverage/v1/market_summary"; } } @@ -133,73 +150,73 @@ message QueryRegisteredTokens {} // QueryAvailableBorrowRequest defines the request structure for the // AvailableBorrow gRPC service handler. -message QueryAvailableBorrowRequest { - string denom = 1; -} +message QueryAvailableBorrowRequest { string denom = 1; } // QueryAvailableBorrowResponse defines the response structure for the // AvailableBorrow gRPC service handler. message QueryAvailableBorrowResponse { - string amount = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string amount = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } // QueryBorrowAPYRequest defines the request structure for the BorrowAPY // gRPC service handler. -message QueryBorrowAPYRequest { - string denom = 1; -} +message QueryBorrowAPYRequest { string denom = 1; } // QueryBorrowAPYResponse defines the response structure for the BorrowAPY // gRPC service handler. message QueryBorrowAPYResponse { - string APY = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string APY = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // QueryLendAPYRequest defines the request structure for the LendAPY // gRPC service handler. -message QueryLendAPYRequest { - string denom = 1; -} +message QueryLendAPYRequest { string denom = 1; } // QueryLendAPYResponse defines the response structure for the LendAPY // gRPC service handler. message QueryLendAPYResponse { - string APY = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string APY = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } -// QueryMarketSizeRequest defines the request structure for the Market Size in USD -// gRPC service handler. -message QueryMarketSizeRequest { - string denom = 1; -} +// QueryMarketSizeRequest defines the request structure for the Market Size in +// USD gRPC service handler. +message QueryMarketSizeRequest { string denom = 1; } -// QueryMarketSizeResponse defines the response structure for the Market Size in USD -// gRPC service handler. +// QueryMarketSizeResponse defines the response structure for the Market Size in +// USD gRPC service handler. message QueryMarketSizeResponse { - string market_size_usd = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string market_size_usd = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } -// QueryTokenMarketSizeRequest defines the request structure for the Token Market Size -// gRPC service handler. -message QueryTokenMarketSizeRequest { - string denom = 1; -} +// QueryTokenMarketSizeRequest defines the request structure for the Token +// Market Size gRPC service handler. +message QueryTokenMarketSizeRequest { string denom = 1; } -// QueryTokenMarketSizeResponse defines the response structure for the Token Market Size -// gRPC service handler. +// QueryTokenMarketSizeResponse defines the response structure for the Token +// Market Size gRPC service handler. message QueryTokenMarketSizeResponse { - string market_size = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string market_size = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } // QueryRegisteredTokensResponse defines the response structure for the // RegisteredTokens gRPC service handler. message QueryRegisteredTokensResponse { - repeated Token registry = 1 [(gogoproto.nullable) = false]; + repeated Token registry = 1 [ (gogoproto.nullable) = false ]; } // QueryParamsRequest defines the request structure for the Params gRPC service @@ -209,81 +226,100 @@ message QueryParamsRequest {} // QueryParamsResponse defines the response structure for the Params gRPC // service handler. message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [ (gogoproto.nullable) = false ]; } // QueryBorrowedRequest defines the request structure for the Borrowed gRPC // service handler. message QueryBorrowedRequest { string address = 1; - string denom = 2; + string denom = 2; } // QueryBorrowedResponse defines the response structure for the Borrowed gRPC // service handler. message QueryBorrowedResponse { - repeated cosmos.base.v1beta1.Coin borrowed = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin borrowed = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } -// QueryBorrowedValueRequest defines the request structure for the BorrowedValue gRPC service handler. +// QueryBorrowedValueRequest defines the request structure for the BorrowedValue +// gRPC service handler. message QueryBorrowedValueRequest { string address = 1; - string denom = 2; + string denom = 2; } -// QueryBorrowedValueResponse defines the response structure for the BorrowedValue gRPC service handler. +// QueryBorrowedValueResponse defines the response structure for the +// BorrowedValue gRPC service handler. message QueryBorrowedValueResponse { - string borrowed_value = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string borrowed_value = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } -// QueryCollateralValueRequest defines the request structure for the CollateralValue gRPC service handler. +// QueryCollateralValueRequest defines the request structure for the +// CollateralValue gRPC service handler. message QueryCollateralValueRequest { string address = 1; - string denom = 2; + string denom = 2; } -// QueryCollateralValueResponse defines the response structure for the CollateralValue gRPC service handler. +// QueryCollateralValueResponse defines the response structure for the +// CollateralValue gRPC service handler. message QueryCollateralValueResponse { - string collateral_value = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string collateral_value = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } -// QueryLoanedRequest defines the request structure for the Loaned gRPC service handler. +// QueryLoanedRequest defines the request structure for the Loaned gRPC service +// handler. message QueryLoanedRequest { string address = 1; - string denom = 2; + string denom = 2; } -// QueryLoanedResponse defines the response structure for the Loaned gRPC service handler. +// QueryLoanedResponse defines the response structure for the Loaned gRPC +// service handler. message QueryLoanedResponse { - repeated cosmos.base.v1beta1.Coin loaned = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin loaned = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } -// QueryLoanedValueRequest defines the request structure for the LoanedValue gRPC service handler. +// QueryLoanedValueRequest defines the request structure for the LoanedValue +// gRPC service handler. message QueryLoanedValueRequest { string address = 1; - string denom = 2; + string denom = 2; } -// QueryLoanedValueResponse defines the response structure for the LoanedValue gRPC service handler. +// QueryLoanedValueResponse defines the response structure for the LoanedValue +// gRPC service handler. message QueryLoanedValueResponse { - string loaned_value = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string loaned_value = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // QueryReserveAmountRequest defines the request structure for the ReserveAmount // gRPC service handler. -message QueryReserveAmountRequest { - string denom = 1; -} +message QueryReserveAmountRequest { string denom = 1; } -// QueryReserveAmountResponse defines the response structure for the ReserveAmount -// gRPC service handler. +// QueryReserveAmountResponse defines the response structure for the +// ReserveAmount gRPC service handler. message QueryReserveAmountResponse { - string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string amount = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } // QueryCollateralSettingsRequest defines the request structure for the @@ -295,96 +331,106 @@ message QueryCollateralSettingRequest { // QueryCollateralSettingsResponse defines the response structure for the // CollateralSetting gRPC service handler. -message QueryCollateralSettingResponse { - bool enabled = 1; -} +message QueryCollateralSettingResponse { bool enabled = 1; } // QueryCollateralRequest defines the request structure for the Collateral gRPC // service handler. message QueryCollateralRequest { string address = 1; - string denom = 2; + string denom = 2; } -// QueryCollateralResponse defines the response structure for the Collateral gRPC -// service handler. +// QueryCollateralResponse defines the response structure for the Collateral +// gRPC service handler. message QueryCollateralResponse { - repeated cosmos.base.v1beta1.Coin collateral = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin collateral = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // QueryExchangeRateRequest defines the request structure for the ExchangeRate // gRPC service handler. -message QueryExchangeRateRequest { - string denom = 1; -} +message QueryExchangeRateRequest { string denom = 1; } // QueryExchangeRateResponse defines the response structure for the ExchangeRate // gRPC service handler. message QueryExchangeRateResponse { - string exchange_rate = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string exchange_rate = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // QueryBorrowLimitRequest defines the request structure for the BorrowLimit // gRPC service handler. -message QueryBorrowLimitRequest { - string address = 1; -} +message QueryBorrowLimitRequest { string address = 1; } // QueryBorrowLimitResponse defines the response structure for the BorrowLimit // gRPC service handler. message QueryBorrowLimitResponse { - string borrow_limit = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string borrow_limit = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } -// QueryLiquidationLimitRequest defines the request structure for the LiquidationLimit -// gRPC service handler. -message QueryLiquidationLimitRequest { - string address = 1; -} +// QueryLiquidationThresholdRequest defines the request structure for the +// LiquidationThreshold gRPC service handler. +message QueryLiquidationThresholdRequest { string address = 1; } -// QueryLiquidationLimitResponse defines the response structure for the LiquidationLimit -// gRPC service handler. -message QueryLiquidationLimitResponse { - string liquidation_limit = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +// QueryLiquidationThresholdResponse defines the response structure for the +// LiquidationThreshold gRPC service handler. +message QueryLiquidationThresholdResponse { + string liquidation_threshold = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } -// QueryLiquidationTargetsRequest defines the request structure for the LiquidationTargets -// gRPC service handler. +// QueryLiquidationTargetsRequest defines the request structure for the +// LiquidationTargets gRPC service handler. message QueryLiquidationTargetsRequest {} -// QueryLiquidationTargetsResponse defines the response structure for the LiquidationTargets -// gRPC service handler. -message QueryLiquidationTargetsResponse { - repeated string targets = 1; -} +// QueryLiquidationTargetsResponse defines the response structure for the +// LiquidationTargets gRPC service handler. +message QueryLiquidationTargetsResponse { repeated string targets = 1; } // QueryMarketSummaryRequest defines the request structure for the // MarketSummary gRPC service handler. -message QueryMarketSummaryRequest { - string denom = 1; -} +message QueryMarketSummaryRequest { string denom = 1; } // QueryMarketSummaryResponse defines the response structure for the // MarketSummary gRPC service handler. message QueryMarketSummaryResponse { string symbol_denom = 1; uint32 exponent = 2; - string oracle_price = 3 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = true]; - string uToken_exchange_rate = 4 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - string lend_APY = 5 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - string borrow_APY = 6 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - string market_size = 7 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string available_borrow = 8 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string reserved = 9 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; -} \ No newline at end of file + string oracle_price = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = true + ]; + string uToken_exchange_rate = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string lend_APY = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string borrow_APY = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string market_size = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string available_borrow = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string reserved = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} From 95fe7c50a94a26a470c6586a395a6a0fe5d286c0 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 18 May 2022 13:20:42 +0200 Subject: [PATCH 19/24] regenerate proto files --- go.sum | 36 +++ x/leverage/types/query.pb.go | 466 +++++++++++++++++--------------- x/leverage/types/query.pb.gw.go | 34 +-- 3 files changed, 296 insertions(+), 240 deletions(-) diff --git a/go.sum b/go.sum index b5bb0a4a94..a33ba96009 100644 --- a/go.sum +++ b/go.sum @@ -35,6 +35,7 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -219,6 +220,8 @@ github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 h1:axBiC50cNZ github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2/go.mod h1:jnzFpU88PccN/tPPhCpnNU8mZphvKxYM9lLNkd8e+os= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= @@ -677,10 +680,12 @@ github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -708,7 +713,9 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= @@ -1080,6 +1087,7 @@ github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3 github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= +github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= @@ -1110,6 +1118,7 @@ github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIv github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -1249,6 +1258,7 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/txtarfs v0.0.0-20210218200122-0702f000015a/go.mod h1:izVPOvVRsHiKkeGCT6tYBNWyDVuzj9wAaBb5R9qamfw= github.com/jpillora/ansi v1.0.2 h1:+Ei5HCAH0xsrQRCT2PDr4mq9r4Gm4tg+arNdXRkB22s= github.com/jpillora/ansi v1.0.2/go.mod h1:D2tT+6uzJvN1nBVQILYWkIdq7zG+b5gcFN5WI/VyjMY= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= @@ -1310,6 +1320,7 @@ github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -1324,6 +1335,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4= @@ -1375,6 +1387,7 @@ github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lufeee/execinquery v1.2.0 h1:07LBuxOFCLoNXUuwnRxL1T+ef8rI0gYZRBe2yh9BflU= github.com/lufeee/execinquery v1.2.0/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -1731,6 +1744,7 @@ github.com/polyfloyd/go-errorlint v0.0.0-20211125173453-6d6d39c5bb8b h1:/BDyEJWL github.com/polyfloyd/go-errorlint v0.0.0-20211125173453-6d6d39c5bb8b/go.mod h1:wi9BfjxjF/bwiZ701TzmfKu6UKC357IOAtNr0Td0Lvw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1797,6 +1811,7 @@ github.com/quasilyte/go-ruleguard v0.3.16-0.20220213074421-6aa060fab41a/go.mod h github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.2/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.16/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/dsl v0.3.19/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= github.com/quasilyte/go-ruleguard/rules v0.0.0-20210203162857-b223e0831f88/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= @@ -1819,6 +1834,9 @@ github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzy github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= +github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= +github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= @@ -1832,6 +1850,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= @@ -1857,6 +1876,7 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 h1:G04eS0JkAIVZfaJLjla9dNxkJCPiKIGZlw9AfOhzOD0= github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= @@ -1890,6 +1910,7 @@ github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.21.7/go.mod h1:RGl11Y7XMTQPmHh8F0ayC6haKNBgH4PXMJuTAcMOlz4= +github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -1942,6 +1963,7 @@ github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHN github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1958,6 +1980,7 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= @@ -2099,10 +2122,13 @@ github.com/uudashr/gocognit v1.0.5 h1:rrSex7oHr3/pPLQ0xoWq108XMU8s678FJcQ+aSfOHa github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= +github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/quicktemplate v1.6.3/go.mod h1:fwPzK2fHuYEODzJ9pkw0ipCPNHZ2tD5KW4lOuSdPKzY= +github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= @@ -2151,6 +2177,7 @@ github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os= github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -2365,6 +2392,7 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2509,6 +2537,7 @@ golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2558,7 +2587,10 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220403020550-483a9cbc67c0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2593,6 +2625,7 @@ golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190228203856-589c23e65e65/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2756,6 +2789,7 @@ google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqiv google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= @@ -2852,9 +2886,11 @@ google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= diff --git a/x/leverage/types/query.pb.go b/x/leverage/types/query.pb.go index 81b253aef7..aff34e211d 100644 --- a/x/leverage/types/query.pb.go +++ b/x/leverage/types/query.pb.go @@ -324,8 +324,8 @@ func (m *QueryLendAPYResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLendAPYResponse proto.InternalMessageInfo -// QueryMarketSizeRequest defines the request structure for the Market Size in USD -// gRPC service handler. +// QueryMarketSizeRequest defines the request structure for the Market Size in +// USD gRPC service handler. type QueryMarketSizeRequest struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } @@ -370,8 +370,8 @@ func (m *QueryMarketSizeRequest) GetDenom() string { return "" } -// QueryMarketSizeResponse defines the response structure for the Market Size in USD -// gRPC service handler. +// QueryMarketSizeResponse defines the response structure for the Market Size in +// USD gRPC service handler. type QueryMarketSizeResponse struct { MarketSizeUsd github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=market_size_usd,json=marketSizeUsd,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"market_size_usd"` } @@ -409,8 +409,8 @@ func (m *QueryMarketSizeResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMarketSizeResponse proto.InternalMessageInfo -// QueryTokenMarketSizeRequest defines the request structure for the Token Market Size -// gRPC service handler. +// QueryTokenMarketSizeRequest defines the request structure for the Token +// Market Size gRPC service handler. type QueryTokenMarketSizeRequest struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } @@ -455,8 +455,8 @@ func (m *QueryTokenMarketSizeRequest) GetDenom() string { return "" } -// QueryTokenMarketSizeResponse defines the response structure for the Token Market Size -// gRPC service handler. +// QueryTokenMarketSizeResponse defines the response structure for the Token +// Market Size gRPC service handler. type QueryTokenMarketSizeResponse struct { MarketSize github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=market_size,json=marketSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"market_size"` } @@ -724,7 +724,8 @@ func (m *QueryBorrowedResponse) GetBorrowed() github_com_cosmos_cosmos_sdk_types return nil } -// QueryBorrowedValueRequest defines the request structure for the BorrowedValue gRPC service handler. +// QueryBorrowedValueRequest defines the request structure for the BorrowedValue +// gRPC service handler. type QueryBorrowedValueRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` @@ -777,7 +778,8 @@ func (m *QueryBorrowedValueRequest) GetDenom() string { return "" } -// QueryBorrowedValueResponse defines the response structure for the BorrowedValue gRPC service handler. +// QueryBorrowedValueResponse defines the response structure for the +// BorrowedValue gRPC service handler. type QueryBorrowedValueResponse struct { BorrowedValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=borrowed_value,json=borrowedValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"borrowed_value"` } @@ -815,7 +817,8 @@ func (m *QueryBorrowedValueResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBorrowedValueResponse proto.InternalMessageInfo -// QueryCollateralValueRequest defines the request structure for the CollateralValue gRPC service handler. +// QueryCollateralValueRequest defines the request structure for the +// CollateralValue gRPC service handler. type QueryCollateralValueRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` @@ -868,7 +871,8 @@ func (m *QueryCollateralValueRequest) GetDenom() string { return "" } -// QueryCollateralValueResponse defines the response structure for the CollateralValue gRPC service handler. +// QueryCollateralValueResponse defines the response structure for the +// CollateralValue gRPC service handler. type QueryCollateralValueResponse struct { CollateralValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=collateral_value,json=collateralValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_value"` } @@ -906,7 +910,8 @@ func (m *QueryCollateralValueResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryCollateralValueResponse proto.InternalMessageInfo -// QueryLoanedRequest defines the request structure for the Loaned gRPC service handler. +// QueryLoanedRequest defines the request structure for the Loaned gRPC service +// handler. type QueryLoanedRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` @@ -959,7 +964,8 @@ func (m *QueryLoanedRequest) GetDenom() string { return "" } -// QueryLoanedResponse defines the response structure for the Loaned gRPC service handler. +// QueryLoanedResponse defines the response structure for the Loaned gRPC +// service handler. type QueryLoanedResponse struct { Loaned github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=loaned,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"loaned"` } @@ -1004,7 +1010,8 @@ func (m *QueryLoanedResponse) GetLoaned() github_com_cosmos_cosmos_sdk_types.Coi return nil } -// QueryLoanedValueRequest defines the request structure for the LoanedValue gRPC service handler. +// QueryLoanedValueRequest defines the request structure for the LoanedValue +// gRPC service handler. type QueryLoanedValueRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` @@ -1057,7 +1064,8 @@ func (m *QueryLoanedValueRequest) GetDenom() string { return "" } -// QueryLoanedValueResponse defines the response structure for the LoanedValue gRPC service handler. +// QueryLoanedValueResponse defines the response structure for the LoanedValue +// gRPC service handler. type QueryLoanedValueResponse struct { LoanedValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=loaned_value,json=loanedValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"loaned_value"` } @@ -1141,8 +1149,8 @@ func (m *QueryReserveAmountRequest) GetDenom() string { return "" } -// QueryReserveAmountResponse defines the response structure for the ReserveAmount -// gRPC service handler. +// QueryReserveAmountResponse defines the response structure for the +// ReserveAmount gRPC service handler. type QueryReserveAmountResponse struct { Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` } @@ -1334,8 +1342,8 @@ func (m *QueryCollateralRequest) GetDenom() string { return "" } -// QueryCollateralResponse defines the response structure for the Collateral gRPC -// service handler. +// QueryCollateralResponse defines the response structure for the Collateral +// gRPC service handler. type QueryCollateralResponse struct { Collateral github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=collateral,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"collateral"` } @@ -1550,24 +1558,24 @@ func (m *QueryBorrowLimitResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBorrowLimitResponse proto.InternalMessageInfo -// QueryLiquidationLimitRequest defines the request structure for the LiquidationLimit -// gRPC service handler. -type QueryLiquidationLimitRequest struct { +// QueryLiquidationThresholdRequest defines the request structure for the +// LiquidationThreshold gRPC service handler. +type QueryLiquidationThresholdRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *QueryLiquidationLimitRequest) Reset() { *m = QueryLiquidationLimitRequest{} } -func (m *QueryLiquidationLimitRequest) String() string { return proto.CompactTextString(m) } -func (*QueryLiquidationLimitRequest) ProtoMessage() {} -func (*QueryLiquidationLimitRequest) Descriptor() ([]byte, []int) { +func (m *QueryLiquidationThresholdRequest) Reset() { *m = QueryLiquidationThresholdRequest{} } +func (m *QueryLiquidationThresholdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationThresholdRequest) ProtoMessage() {} +func (*QueryLiquidationThresholdRequest) Descriptor() ([]byte, []int) { return fileDescriptor_1e8137dcabb0ccc7, []int{34} } -func (m *QueryLiquidationLimitRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryLiquidationThresholdRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryLiquidationLimitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryLiquidationThresholdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryLiquidationLimitRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryLiquidationThresholdRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1577,43 +1585,43 @@ func (m *QueryLiquidationLimitRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryLiquidationLimitRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLiquidationLimitRequest.Merge(m, src) +func (m *QueryLiquidationThresholdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationThresholdRequest.Merge(m, src) } -func (m *QueryLiquidationLimitRequest) XXX_Size() int { +func (m *QueryLiquidationThresholdRequest) XXX_Size() int { return m.Size() } -func (m *QueryLiquidationLimitRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLiquidationLimitRequest.DiscardUnknown(m) +func (m *QueryLiquidationThresholdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationThresholdRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryLiquidationLimitRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryLiquidationThresholdRequest proto.InternalMessageInfo -func (m *QueryLiquidationLimitRequest) GetAddress() string { +func (m *QueryLiquidationThresholdRequest) GetAddress() string { if m != nil { return m.Address } return "" } -// QueryLiquidationLimitResponse defines the response structure for the LiquidationLimit -// gRPC service handler. -type QueryLiquidationLimitResponse struct { - LiquidationLimit github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=liquidation_limit,json=liquidationLimit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_limit"` +// QueryLiquidationThresholdResponse defines the response structure for the +// LiquidationThreshold gRPC service handler. +type QueryLiquidationThresholdResponse struct { + LiquidationThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=liquidation_threshold,json=liquidationThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_threshold"` } -func (m *QueryLiquidationLimitResponse) Reset() { *m = QueryLiquidationLimitResponse{} } -func (m *QueryLiquidationLimitResponse) String() string { return proto.CompactTextString(m) } -func (*QueryLiquidationLimitResponse) ProtoMessage() {} -func (*QueryLiquidationLimitResponse) Descriptor() ([]byte, []int) { +func (m *QueryLiquidationThresholdResponse) Reset() { *m = QueryLiquidationThresholdResponse{} } +func (m *QueryLiquidationThresholdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationThresholdResponse) ProtoMessage() {} +func (*QueryLiquidationThresholdResponse) Descriptor() ([]byte, []int) { return fileDescriptor_1e8137dcabb0ccc7, []int{35} } -func (m *QueryLiquidationLimitResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryLiquidationThresholdResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryLiquidationLimitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryLiquidationThresholdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryLiquidationLimitResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryLiquidationThresholdResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1623,20 +1631,20 @@ func (m *QueryLiquidationLimitResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryLiquidationLimitResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLiquidationLimitResponse.Merge(m, src) +func (m *QueryLiquidationThresholdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationThresholdResponse.Merge(m, src) } -func (m *QueryLiquidationLimitResponse) XXX_Size() int { +func (m *QueryLiquidationThresholdResponse) XXX_Size() int { return m.Size() } -func (m *QueryLiquidationLimitResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLiquidationLimitResponse.DiscardUnknown(m) +func (m *QueryLiquidationThresholdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationThresholdResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryLiquidationLimitResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryLiquidationThresholdResponse proto.InternalMessageInfo -// QueryLiquidationTargetsRequest defines the request structure for the LiquidationTargets -// gRPC service handler. +// QueryLiquidationTargetsRequest defines the request structure for the +// LiquidationTargets gRPC service handler. type QueryLiquidationTargetsRequest struct { } @@ -1673,8 +1681,8 @@ func (m *QueryLiquidationTargetsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLiquidationTargetsRequest proto.InternalMessageInfo -// QueryLiquidationTargetsResponse defines the response structure for the LiquidationTargets -// gRPC service handler. +// QueryLiquidationTargetsResponse defines the response structure for the +// LiquidationTargets gRPC service handler. type QueryLiquidationTargetsResponse struct { Targets []string `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` } @@ -1861,8 +1869,8 @@ func init() { proto.RegisterType((*QueryExchangeRateResponse)(nil), "umeenetwork.umee.leverage.v1.QueryExchangeRateResponse") proto.RegisterType((*QueryBorrowLimitRequest)(nil), "umeenetwork.umee.leverage.v1.QueryBorrowLimitRequest") proto.RegisterType((*QueryBorrowLimitResponse)(nil), "umeenetwork.umee.leverage.v1.QueryBorrowLimitResponse") - proto.RegisterType((*QueryLiquidationLimitRequest)(nil), "umeenetwork.umee.leverage.v1.QueryLiquidationLimitRequest") - proto.RegisterType((*QueryLiquidationLimitResponse)(nil), "umeenetwork.umee.leverage.v1.QueryLiquidationLimitResponse") + proto.RegisterType((*QueryLiquidationThresholdRequest)(nil), "umeenetwork.umee.leverage.v1.QueryLiquidationThresholdRequest") + proto.RegisterType((*QueryLiquidationThresholdResponse)(nil), "umeenetwork.umee.leverage.v1.QueryLiquidationThresholdResponse") proto.RegisterType((*QueryLiquidationTargetsRequest)(nil), "umeenetwork.umee.leverage.v1.QueryLiquidationTargetsRequest") proto.RegisterType((*QueryLiquidationTargetsResponse)(nil), "umeenetwork.umee.leverage.v1.QueryLiquidationTargetsResponse") proto.RegisterType((*QueryMarketSummaryRequest)(nil), "umeenetwork.umee.leverage.v1.QueryMarketSummaryRequest") @@ -1872,112 +1880,112 @@ func init() { func init() { proto.RegisterFile("umee/leverage/v1/query.proto", fileDescriptor_1e8137dcabb0ccc7) } var fileDescriptor_1e8137dcabb0ccc7 = []byte{ - // 1668 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcb, 0x6f, 0xdc, 0x54, - 0x17, 0x8f, 0xdb, 0xe6, 0x75, 0x92, 0x7c, 0x49, 0xef, 0x97, 0xef, 0xeb, 0xd4, 0xa4, 0x93, 0xd4, - 0x4d, 0xdb, 0x88, 0x92, 0x99, 0x3c, 0x28, 0x2d, 0x6d, 0x91, 0x48, 0xfa,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32, 0xc9, 0x25, 0xc9, 0x71, 0x49, 0x41, 0x3e, 0x97, 0x60, 0xc8, 0x6f, 0x9b, 0xc9, 0x92, 0x80, - 0x87, 0x36, 0xed, 0x21, 0x2f, 0xf7, 0x84, 0x41, 0x5e, 0x0a, 0xe3, 0x35, 0x45, 0xe4, 0x24, 0x2f, - 0xbf, 0xc9, 0x26, 0xdf, 0x4b, 0x30, 0x16, 0x6b, 0xe8, 0xc9, 0xa9, 0x1e, 0x5c, 0x45, 0x7b, 0x40, - 0xf9, 0x74, 0xef, 0x40, 0x24, 0x3a, 0xc7, 0x88, 0x2a, 0x64, 0xa6, 0x3b, 0x51, 0xde, 0x0b, 0xb2, - 0xad, 0xe5, 0x3d, 0xa3, 0xd0, 0xd6, 0xc6, 0x7a, 0x6d, 0xa1, 0xad, 0x8d, 0xf7, 0xd5, 0x69, 0x5b, - 0xcb, 0xfb, 0x4b, 0xf2, 0x8d, 0x04, 0x23, 0x91, 0x2e, 0x96, 0x9c, 0x14, 0x76, 0x12, 0x5b, 0xbc, - 0xd7, 0x7a, 0x85, 0x21, 0xc1, 0x63, 0x8c, 0xe0, 0x0c, 0xc9, 0x77, 0x23, 0x88, 0x0b, 0xf7, 0xa3, - 0x04, 0xe3, 0x6d, 0x97, 0x4d, 0xe4, 0x75, 0x01, 0x9f, 0x9d, 0x6f, 0xb5, 0xe4, 0x33, 0x59, 0xa0, - 0x48, 0xf9, 0x65, 0x46, 0x79, 0x96, 0x28, 0x49, 0xca, 0xed, 0xb5, 0x91, 0x7c, 0x21, 0xc1, 0x70, - 0x70, 0x19, 0x45, 0xc4, 0xb3, 0x20, 0xbc, 0x60, 0x92, 0x5f, 0xed, 0x0d, 0x84, 0x24, 0x67, 0x19, - 0xc9, 0x3c, 0x99, 0xea, 0x16, 0x92, 0xaa, 0xd6, 0xd8, 0x26, 0x9f, 0x49, 0x30, 0x88, 0x57, 0x54, - 0x44, 0x28, 0xba, 0x62, 0x77, 0x5f, 0xf2, 0x52, 0x2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9, - 0x36, 0xa6, 0x33, 0xd8, 0x01, 0x1b, 0x51, 0xb9, 0x42, 0x07, 0x6c, 0x52, 0x4a, 0x0b, 0x1d, 0xb0, - 0x1d, 0xc4, 0x74, 0xda, 0x01, 0x1b, 0x15, 0xd9, 0xe4, 0x67, 0x09, 0x26, 0xda, 0x35, 0x2e, 0x11, - 0xd9, 0xce, 0x2e, 0x92, 0x5a, 0xa8, 0x5f, 0xee, 0x26, 0xaa, 0xd3, 0x6a, 0x5a, 0x42, 0x6c, 0x93, - 0x5f, 0x25, 0x20, 0x49, 0xf9, 0x4b, 0xce, 0xf5, 0x46, 0x20, 0xae, 0xab, 0xe5, 0x37, 0x32, 0xa2, - 0x71, 0x02, 0xf3, 0x6c, 0x02, 0xc7, 0xc9, 0xd1, 0xf4, 0x09, 0xa0, 0x10, 0x67, 0x65, 0x39, 0x26, - 0xa8, 0x85, 0xca, 0x72, 0x27, 0xd9, 0x2e, 0x54, 0x96, 0x3b, 0x6a, 0xf7, 0xb4, 0xb2, 0xec, 0x1f, - 0x21, 0x1c, 0xb1, 0x7a, 0xe5, 0xd1, 0xd3, 0xbc, 0xf4, 0xf8, 0x69, 0x5e, 0xfa, 0xfb, 0x69, 0x5e, - 0xfa, 0xe4, 0x59, 0xbe, 0xef, 0xf1, 0xb3, 0x7c, 0xdf, 0xef, 0xcf, 0xf2, 0x7d, 0x77, 0x16, 0x22, - 0x5a, 0xcd, 0xb3, 0x32, 0x8f, 0x44, 0xb8, 0xc9, 0xd6, 0x52, 0xf1, 0x41, 0x68, 0x97, 0x29, 0xb7, - 0xf2, 0x00, 0xfb, 0xff, 0xe4, 0xf2, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x2f, 0x8e, 0xd3, - 0x52, 0x1d, 0x00, 0x00, + // 1679 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcb, 0x6f, 0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, 0xdc, 0x92, 0x83, 0x67, 0xab, 0xa1, 0xb2, 0xf7, 0x28, 0xbd, 0x87, 0xa9, 0x31, 0xc0, + 0xe6, 0x65, 0xf1, 0x89, 0x80, 0xa6, 0x12, 0x16, 0x85, 0xfa, 0x37, 0x00, 0x02, 0xd7, 0x78, 0x16, + 0xe6, 0x1a, 0x12, 0x2f, 0xcd, 0xa3, 0x9d, 0x9d, 0xbf, 0x57, 0x5d, 0x57, 0x8d, 0x3a, 0x2d, 0xab, + 0xce, 0x36, 0x79, 0xb4, 0x89, 0xa6, 0x12, 0x45, 0x20, 0xf7, 0xeb, 0x30, 0x46, 0x71, 0x5d, 0xb1, + 0x54, 0x27, 0xaf, 0x6d, 0x8e, 0xd2, 0x90, 0x70, 0x69, 0x09, 0xcf, 0x8a, 0xc7, 0xd5, 0xcb, 0x5a, + 0x43, 0x73, 0xb6, 0x3d, 0x77, 0xdf, 0x81, 0x22, 0xa0, 0xc0, 0x81, 0x78, 0x10, 0x55, 0x74, 0x77, + 0x3d, 0xaf, 0x03, 0x55, 0x02, 0xd1, 0xd2, 0x19, 0x98, 0xe6, 0xfe, 0xaa, 0x6d, 0xb6, 0xb4, 0x1a, + 0xab, 0xb7, 0x6f, 0xac, 0x5b, 0xd4, 0x5e, 0x37, 0xf5, 0xed, 0x43, 0x99, 0xf4, 0xa9, 0x00, 0x87, + 0x52, 0xe0, 0x7e, 0x0c, 0xdb, 0xa7, 0x07, 0xef, 0x15, 0xc7, 0xfb, 0x20, 0x27, 0xff, 0x09, 0x3d, + 0x41, 0x99, 0x34, 0x8d, 0xfe, 0x11, 0x66, 0xa2, 0x5a, 0x75, 0xea, 0xf8, 0x95, 0xc5, 0x69, 0x98, + 0xea, 0xfa, 0x45, 0xe0, 0x42, 0x0e, 0x5f, 0x62, 0xf6, 0x3b, 0x5c, 0xf6, 0x1e, 0xfd, 0x40, 0x83, + 0x05, 0x58, 0xab, 0xd1, 0x50, 0xdd, 0x10, 0x92, 0x66, 0x70, 0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0x8e, 0x90, 0xc3, 0xa5, 0x58, 0xbb, 0x6f, 0xf9, 0x18, 0xc5, 0xe1, 0xf4, 0x3e, 0x13, 0x60, + 0x80, 0x97, 0xfa, 0x64, 0x3e, 0x83, 0xd2, 0x48, 0xa7, 0x21, 0x2e, 0xf4, 0x80, 0x40, 0x72, 0xd3, + 0x8c, 0x9c, 0x48, 0x0a, 0x71, 0x72, 0xbc, 0xc7, 0x20, 0x5f, 0x09, 0x30, 0xe4, 0xd5, 0xd1, 0x64, + 0x31, 0x83, 0x86, 0x8e, 0x66, 0x44, 0x5c, 0xea, 0x09, 0x83, 0xbc, 0x24, 0xc6, 0x6b, 0x92, 0x88, + 0x71, 0x5e, 0x5e, 0xd5, 0x4d, 0x7e, 0x12, 0x60, 0x2c, 0x52, 0xe1, 0x93, 0x93, 0x3d, 0xa8, 0x0a, + 0x17, 0x85, 0xe2, 0x1b, 0xbd, 0x03, 0x91, 0xe8, 0x2c, 0x23, 0x2a, 0x91, 0xe9, 0xee, 0x44, 0x79, + 0x71, 0xc8, 0xae, 0x96, 0x17, 0x91, 0x99, 0xae, 0x36, 0x52, 0x7c, 0x67, 0xba, 0xda, 0x68, 0xa1, + 0x9d, 0x76, 0xb5, 0xbc, 0xe0, 0x24, 0xdf, 0x0b, 0x30, 0x12, 0x2a, 0x6b, 0xc9, 0x89, 0xcc, 0x4a, + 0x22, 0x87, 0xf7, 0x7a, 0xaf, 0x30, 0x24, 0x78, 0x94, 0x11, 0x9c, 0x26, 0xc5, 0x6e, 0x04, 0xf1, + 0xe0, 0x7e, 0x11, 0x60, 0xbc, 0x63, 0xfa, 0x44, 0xde, 0xcc, 0xa0, 0x33, 0x79, 0xcc, 0x25, 0x9e, + 0xca, 0x03, 0x45, 0xca, 0xaf, 0x30, 0xca, 0x33, 0x44, 0x8a, 0x53, 0xee, 0x8c, 0x8d, 0xe4, 0x6b, + 0x01, 0x86, 0xfd, 0xe9, 0x14, 0xc9, 0xee, 0x05, 0xc1, 0xc4, 0x49, 0x7c, 0xad, 0x37, 0x10, 0x92, + 0x9c, 0x61, 0x24, 0x8b, 0x64, 0xb2, 0x9b, 0x49, 0x2a, 0x6a, 0x73, 0x8b, 0x7c, 0x29, 0xc0, 0x20, + 0xce, 0xac, 0x48, 0x26, 0xeb, 0x8a, 0x0c, 0xc3, 0xc4, 0xc5, 0x5e, 0x20, 0xdb, 0x3b, 0x35, 0x4b, + 0xa2, 0x2e, 0xad, 0x6f, 0x05, 0x80, 0x60, 0x26, 0x44, 0xb2, 0x9c, 0x40, 0x6c, 0xee, 0x24, 0x9e, + 0xe8, 0x11, 0x85, 0xfc, 0x8e, 0x30, 0x7e, 0x53, 0xe4, 0x60, 0x9c, 0x5f, 0x28, 0x95, 0x92, 0x5f, + 0x05, 0x18, 0xef, 0x98, 0x5d, 0x65, 0xb2, 0xc7, 0xe4, 0x21, 0x59, 0x26, 0x7b, 0xec, 0x32, 0x2a, + 0x4b, 0xcb, 0x2d, 0x2c, 0xa1, 0x28, 0x61, 0xde, 0x6e, 0xbc, 0x8c, 0xf4, 0x88, 0x99, 0xe2, 0x65, + 0x52, 0x23, 0x9a, 0x29, 0x5e, 0x26, 0xb6, 0xa3, 0x69, 0xf1, 0x12, 0x53, 0xb8, 0xc2, 0x1b, 0x4e, + 0xf2, 0x9b, 0x00, 0xcf, 0xc7, 0x7a, 0x43, 0x92, 0x25, 0x15, 0x77, 0x6b, 0x51, 0xc5, 0x33, 0xf9, + 0xc0, 0x48, 0xfd, 0x55, 0x46, 0xfd, 0x28, 0x99, 0x89, 0x53, 0x0f, 0x4d, 0x62, 0x6c, 0x24, 0xfa, + 0x8d, 0x00, 0x10, 0xc8, 0xca, 0x64, 0xc8, 0xb1, 0x6e, 0x36, 0x93, 0x21, 0xc7, 0x1b, 0xd7, 0xb4, + 0x08, 0x10, 0x30, 0x65, 0x71, 0xb5, 0x63, 0xba, 0x94, 0xc9, 0x8e, 0x93, 0x07, 0x5c, 0x99, 0xec, + 0xb8, 0xcb, 0x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, 0xcb, 0x3a, 0xb9, 0xca, 0x00, 0xfb, 0x07, 0xe6, + 0xd2, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xb5, 0x80, 0x10, 0x73, 0x1d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2012,24 +2020,26 @@ type QueryClient interface { // denomination. If the denomination is not supplied, the sum across all // loaned tokens is returned. LoanedValue(ctx context.Context, in *QueryLoanedValueRequest, opts ...grpc.CallOption) (*QueryLoanedValueResponse, error) - // AvailableBorrow queries for the available amount to borrow of a specified denomination. + // AvailableBorrow queries for the available amount to borrow of a specified + // denomination. AvailableBorrow(ctx context.Context, in *QueryAvailableBorrowRequest, opts ...grpc.CallOption) (*QueryAvailableBorrowResponse, error) // BorrowAPY queries for the borrow APY of a specified denomination. BorrowAPY(ctx context.Context, in *QueryBorrowAPYRequest, opts ...grpc.CallOption) (*QueryBorrowAPYResponse, error) // LendAPY queries for the lend APY of a specified denomination. LendAPY(ctx context.Context, in *QueryLendAPYRequest, opts ...grpc.CallOption) (*QueryLendAPYResponse, error) - // MarketSize queries for the Market Size in USD of a specified denomination, which - // is the USD value of total tokens loaned by all users plus borrow interest owed - // by all users. + // MarketSize queries for the Market Size in USD of a specified denomination, + // which is the USD value of total tokens loaned by all users plus borrow + // interest owed by all users. MarketSize(ctx context.Context, in *QueryMarketSizeRequest, opts ...grpc.CallOption) (*QueryMarketSizeResponse, error) - // TokenMarketSize queries for the Market Size in base tokens of a specified denomination, - // which is the total tokens loaned by all users plus borrow interest owed by all users. + // TokenMarketSize queries for the Market Size in base tokens of a specified + // denomination, which is the total tokens loaned by all users plus borrow + // interest owed by all users. TokenMarketSize(ctx context.Context, in *QueryTokenMarketSizeRequest, opts ...grpc.CallOption) (*QueryTokenMarketSizeResponse, error) // ReserveAmount queries for the amount reserved of a specified denomination. // If the token is not valid, the reserved amount is zero. ReserveAmount(ctx context.Context, in *QueryReserveAmountRequest, opts ...grpc.CallOption) (*QueryReserveAmountResponse, error) - // CollateralSetting queries a borrower's collateral setting (enabled or disabled) - // for a specified uToken denomination. + // CollateralSetting queries a borrower's collateral setting (enabled or + // disabled) for a specified uToken denomination. CollateralSetting(ctx context.Context, in *QueryCollateralSettingRequest, opts ...grpc.CallOption) (*QueryCollateralSettingResponse, error) // Collateral queries the collateral amount of a user by token denomination. // If the denomination is not supplied, all of the user's collateral tokens @@ -2038,15 +2048,19 @@ type QueryClient interface { // CollateralValue queries for the total USD value of a user's collateral, or // the USD value held as a given base asset's associated uToken denomination. CollateralValue(ctx context.Context, in *QueryCollateralValueRequest, opts ...grpc.CallOption) (*QueryCollateralValueResponse, error) - // ExchangeRate queries the uToken exchange rate of a given uToken denomination. + // ExchangeRate queries the uToken exchange rate of a given uToken + // denomination. ExchangeRate(ctx context.Context, in *QueryExchangeRateRequest, opts ...grpc.CallOption) (*QueryExchangeRateResponse, error) // BorrowLimit queries the borrow limit in USD of a given borrower. BorrowLimit(ctx context.Context, in *QueryBorrowLimitRequest, opts ...grpc.CallOption) (*QueryBorrowLimitResponse, error) - // LiquidationLimit queries the limit in USD above which a given borrower is eligible for liquidation. - LiquidationLimit(ctx context.Context, in *QueryLiquidationLimitRequest, opts ...grpc.CallOption) (*QueryLiquidationLimitResponse, error) - // LiquidationTargets queries a list of all borrower addresses eligible for liquidation. + // LiquidationThreshold returns a maximum borrow value in USD above which a + // given borrower is eligible for liquidation. + LiquidationThreshold(ctx context.Context, in *QueryLiquidationThresholdRequest, opts ...grpc.CallOption) (*QueryLiquidationThresholdResponse, error) + // LiquidationTargets queries a list of all borrower addresses eligible for + // liquidation. LiquidationTargets(ctx context.Context, in *QueryLiquidationTargetsRequest, opts ...grpc.CallOption) (*QueryLiquidationTargetsResponse, error) - // MarketSummary queries a base asset's current borrowing and lending conditions. + // MarketSummary queries a base asset's current borrowing and lending + // conditions. MarketSummary(ctx context.Context, in *QueryMarketSummaryRequest, opts ...grpc.CallOption) (*QueryMarketSummaryResponse, error) } @@ -2211,9 +2225,9 @@ func (c *queryClient) BorrowLimit(ctx context.Context, in *QueryBorrowLimitReque return out, nil } -func (c *queryClient) LiquidationLimit(ctx context.Context, in *QueryLiquidationLimitRequest, opts ...grpc.CallOption) (*QueryLiquidationLimitResponse, error) { - out := new(QueryLiquidationLimitResponse) - err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1.Query/LiquidationLimit", in, out, opts...) +func (c *queryClient) LiquidationThreshold(ctx context.Context, in *QueryLiquidationThresholdRequest, opts ...grpc.CallOption) (*QueryLiquidationThresholdResponse, error) { + out := new(QueryLiquidationThresholdResponse) + err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1.Query/LiquidationThreshold", in, out, opts...) if err != nil { return nil, err } @@ -2260,24 +2274,26 @@ type QueryServer interface { // denomination. If the denomination is not supplied, the sum across all // loaned tokens is returned. LoanedValue(context.Context, *QueryLoanedValueRequest) (*QueryLoanedValueResponse, error) - // AvailableBorrow queries for the available amount to borrow of a specified denomination. + // AvailableBorrow queries for the available amount to borrow of a specified + // denomination. AvailableBorrow(context.Context, *QueryAvailableBorrowRequest) (*QueryAvailableBorrowResponse, error) // BorrowAPY queries for the borrow APY of a specified denomination. BorrowAPY(context.Context, *QueryBorrowAPYRequest) (*QueryBorrowAPYResponse, error) // LendAPY queries for the lend APY of a specified denomination. LendAPY(context.Context, *QueryLendAPYRequest) (*QueryLendAPYResponse, error) - // MarketSize queries for the Market Size in USD of a specified denomination, which - // is the USD value of total tokens loaned by all users plus borrow interest owed - // by all users. + // MarketSize queries for the Market Size in USD of a specified denomination, + // which is the USD value of total tokens loaned by all users plus borrow + // interest owed by all users. MarketSize(context.Context, *QueryMarketSizeRequest) (*QueryMarketSizeResponse, error) - // TokenMarketSize queries for the Market Size in base tokens of a specified denomination, - // which is the total tokens loaned by all users plus borrow interest owed by all users. + // TokenMarketSize queries for the Market Size in base tokens of a specified + // denomination, which is the total tokens loaned by all users plus borrow + // interest owed by all users. TokenMarketSize(context.Context, *QueryTokenMarketSizeRequest) (*QueryTokenMarketSizeResponse, error) // ReserveAmount queries for the amount reserved of a specified denomination. // If the token is not valid, the reserved amount is zero. ReserveAmount(context.Context, *QueryReserveAmountRequest) (*QueryReserveAmountResponse, error) - // CollateralSetting queries a borrower's collateral setting (enabled or disabled) - // for a specified uToken denomination. + // CollateralSetting queries a borrower's collateral setting (enabled or + // disabled) for a specified uToken denomination. CollateralSetting(context.Context, *QueryCollateralSettingRequest) (*QueryCollateralSettingResponse, error) // Collateral queries the collateral amount of a user by token denomination. // If the denomination is not supplied, all of the user's collateral tokens @@ -2286,15 +2302,19 @@ type QueryServer interface { // CollateralValue queries for the total USD value of a user's collateral, or // the USD value held as a given base asset's associated uToken denomination. CollateralValue(context.Context, *QueryCollateralValueRequest) (*QueryCollateralValueResponse, error) - // ExchangeRate queries the uToken exchange rate of a given uToken denomination. + // ExchangeRate queries the uToken exchange rate of a given uToken + // denomination. ExchangeRate(context.Context, *QueryExchangeRateRequest) (*QueryExchangeRateResponse, error) // BorrowLimit queries the borrow limit in USD of a given borrower. BorrowLimit(context.Context, *QueryBorrowLimitRequest) (*QueryBorrowLimitResponse, error) - // LiquidationLimit queries the limit in USD above which a given borrower is eligible for liquidation. - LiquidationLimit(context.Context, *QueryLiquidationLimitRequest) (*QueryLiquidationLimitResponse, error) - // LiquidationTargets queries a list of all borrower addresses eligible for liquidation. + // LiquidationThreshold returns a maximum borrow value in USD above which a + // given borrower is eligible for liquidation. + LiquidationThreshold(context.Context, *QueryLiquidationThresholdRequest) (*QueryLiquidationThresholdResponse, error) + // LiquidationTargets queries a list of all borrower addresses eligible for + // liquidation. LiquidationTargets(context.Context, *QueryLiquidationTargetsRequest) (*QueryLiquidationTargetsResponse, error) - // MarketSummary queries a base asset's current borrowing and lending conditions. + // MarketSummary queries a base asset's current borrowing and lending + // conditions. MarketSummary(context.Context, *QueryMarketSummaryRequest) (*QueryMarketSummaryResponse, error) } @@ -2353,8 +2373,8 @@ func (*UnimplementedQueryServer) ExchangeRate(ctx context.Context, req *QueryExc func (*UnimplementedQueryServer) BorrowLimit(ctx context.Context, req *QueryBorrowLimitRequest) (*QueryBorrowLimitResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BorrowLimit not implemented") } -func (*UnimplementedQueryServer) LiquidationLimit(ctx context.Context, req *QueryLiquidationLimitRequest) (*QueryLiquidationLimitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LiquidationLimit not implemented") +func (*UnimplementedQueryServer) LiquidationThreshold(ctx context.Context, req *QueryLiquidationThresholdRequest) (*QueryLiquidationThresholdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LiquidationThreshold not implemented") } func (*UnimplementedQueryServer) LiquidationTargets(ctx context.Context, req *QueryLiquidationTargetsRequest) (*QueryLiquidationTargetsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LiquidationTargets not implemented") @@ -2673,20 +2693,20 @@ func _Query_BorrowLimit_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Query_LiquidationLimit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLiquidationLimitRequest) +func _Query_LiquidationThreshold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLiquidationThresholdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).LiquidationLimit(ctx, in) + return srv.(QueryServer).LiquidationThreshold(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/umeenetwork.umee.leverage.v1.Query/LiquidationLimit", + FullMethod: "/umeenetwork.umee.leverage.v1.Query/LiquidationThreshold", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LiquidationLimit(ctx, req.(*QueryLiquidationLimitRequest)) + return srv.(QueryServer).LiquidationThreshold(ctx, req.(*QueryLiquidationThresholdRequest)) } return interceptor(ctx, in, info, handler) } @@ -2800,8 +2820,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_BorrowLimit_Handler, }, { - MethodName: "LiquidationLimit", - Handler: _Query_LiquidationLimit_Handler, + MethodName: "LiquidationThreshold", + Handler: _Query_LiquidationThreshold_Handler, }, { MethodName: "LiquidationTargets", @@ -3938,7 +3958,7 @@ func (m *QueryBorrowLimitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *QueryLiquidationLimitRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryLiquidationThresholdRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3948,12 +3968,12 @@ func (m *QueryLiquidationLimitRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryLiquidationLimitRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLiquidationThresholdRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryLiquidationLimitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLiquidationThresholdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3968,7 +3988,7 @@ func (m *QueryLiquidationLimitRequest) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *QueryLiquidationLimitResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryLiquidationThresholdResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3978,20 +3998,20 @@ func (m *QueryLiquidationLimitResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryLiquidationLimitResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLiquidationThresholdResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryLiquidationLimitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLiquidationThresholdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size := m.LiquidationLimit.Size() + size := m.LiquidationThreshold.Size() i -= size - if _, err := m.LiquidationLimit.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.LiquidationThreshold.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintQuery(dAtA, i, uint64(size)) @@ -4649,7 +4669,7 @@ func (m *QueryBorrowLimitResponse) Size() (n int) { return n } -func (m *QueryLiquidationLimitRequest) Size() (n int) { +func (m *QueryLiquidationThresholdRequest) Size() (n int) { if m == nil { return 0 } @@ -4662,13 +4682,13 @@ func (m *QueryLiquidationLimitRequest) Size() (n int) { return n } -func (m *QueryLiquidationLimitResponse) Size() (n int) { +func (m *QueryLiquidationThresholdResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.LiquidationLimit.Size() + l = m.LiquidationThreshold.Size() n += 1 + l + sovQuery(uint64(l)) return n } @@ -7715,7 +7735,7 @@ func (m *QueryBorrowLimitResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryLiquidationLimitRequest) Unmarshal(dAtA []byte) error { +func (m *QueryLiquidationThresholdRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7738,10 +7758,10 @@ func (m *QueryLiquidationLimitRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryLiquidationLimitRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLiquidationThresholdRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLiquidationLimitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLiquidationThresholdRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7797,7 +7817,7 @@ func (m *QueryLiquidationLimitRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryLiquidationLimitResponse) Unmarshal(dAtA []byte) error { +func (m *QueryLiquidationThresholdResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7820,15 +7840,15 @@ func (m *QueryLiquidationLimitResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryLiquidationLimitResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLiquidationThresholdResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLiquidationLimitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLiquidationThresholdResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LiquidationLimit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationThreshold", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7856,7 +7876,7 @@ func (m *QueryLiquidationLimitResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LiquidationLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.LiquidationThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/leverage/types/query.pb.gw.go b/x/leverage/types/query.pb.gw.go index c7b5e81226..404bdc79f3 100644 --- a/x/leverage/types/query.pb.gw.go +++ b/x/leverage/types/query.pb.gw.go @@ -608,37 +608,37 @@ func local_request_Query_BorrowLimit_0(ctx context.Context, marshaler runtime.Ma } var ( - filter_Query_LiquidationLimit_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_LiquidationThreshold_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_LiquidationLimit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLiquidationLimitRequest +func request_Query_LiquidationThreshold_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationThresholdRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LiquidationLimit_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LiquidationThreshold_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.LiquidationLimit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.LiquidationThreshold(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_LiquidationLimit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLiquidationLimitRequest +func local_request_Query_LiquidationThreshold_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationThresholdRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LiquidationLimit_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LiquidationThreshold_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.LiquidationLimit(ctx, &protoReq) + msg, err := server.LiquidationThreshold(ctx, &protoReq) return msg, metadata, err } @@ -1043,7 +1043,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_LiquidationLimit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_LiquidationThreshold_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -1052,14 +1052,14 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_LiquidationLimit_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_LiquidationThreshold_0(rctx, inboundMarshaler, server, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_LiquidationLimit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_LiquidationThreshold_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1484,7 +1484,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_LiquidationLimit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_LiquidationThreshold_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -1493,14 +1493,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_LiquidationLimit_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_LiquidationThreshold_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_LiquidationLimit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_LiquidationThreshold_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1582,7 +1582,7 @@ var ( pattern_Query_BorrowLimit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "borrow_limit"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_LiquidationLimit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "liquidation_limit"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_LiquidationThreshold_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "liquidation_threshold"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_LiquidationTargets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "liquidation_targets"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1624,7 +1624,7 @@ var ( forward_Query_BorrowLimit_0 = runtime.ForwardResponseMessage - forward_Query_LiquidationLimit_0 = runtime.ForwardResponseMessage + forward_Query_LiquidationThreshold_0 = runtime.ForwardResponseMessage forward_Query_LiquidationTargets_0 = runtime.ForwardResponseMessage From 49c4832f471e65bc6605f4548503e03187f31cd0 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 18 May 2022 13:22:46 +0200 Subject: [PATCH 20/24] rename types in go files --- x/leverage/client/cli/query.go | 10 +++++----- x/leverage/client/tests/suite.go | 20 ++++++++++---------- x/leverage/keeper/grpc_query.go | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/x/leverage/client/cli/query.go b/x/leverage/client/cli/query.go index 6f9c166603..68393936c8 100644 --- a/x/leverage/client/cli/query.go +++ b/x/leverage/client/cli/query.go @@ -42,7 +42,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { GetCmdQueryMarketSize(), GetCmdQueryTokenMarketSize(), GetCmdQueryBorrowLimit(), - GetCmdQueryLiquidationLimit(), + GetCmdQueryLiquidationThreshold(), GetCmdQueryLiquidationTargets(), ) @@ -627,9 +627,9 @@ func GetCmdQueryBorrowLimit() *cobra.Command { return cmd } -// GetCmdQueryLiquidationLimit returns a CLI command handler to query for the +// GetCmdQueryLiquidationThreshold returns a CLI command handler to query for the // liquidation limit of a specific borrower. -func GetCmdQueryLiquidationLimit() *cobra.Command { +func GetCmdQueryLiquidationThreshold() *cobra.Command { cmd := &cobra.Command{ Use: "liquidation-limit [addr]", Args: cobra.ExactArgs(1), @@ -642,11 +642,11 @@ func GetCmdQueryLiquidationLimit() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - req := &types.QueryLiquidationLimitRequest{ + req := &types.QueryLiquidationThresholdRequest{ Address: args[0], } - resp, err := queryClient.LiquidationLimit(cmd.Context(), req) + resp, err := queryClient.LiquidationThreshold(cmd.Context(), req) if err != nil { return err } diff --git a/x/leverage/client/tests/suite.go b/x/leverage/client/tests/suite.go index f965d8ba53..ff6f6a9a82 100644 --- a/x/leverage/client/tests/suite.go +++ b/x/leverage/client/tests/suite.go @@ -1063,13 +1063,13 @@ func (s *IntegrationTestSuite) TestQueryBorrowLimit() { runTestTransactions(s, cleanupCommands) } -func (s *IntegrationTestSuite) TestQueryLiquidationLimit() { +func (s *IntegrationTestSuite) TestQueryLiquidationThreshold() { val := s.network.Validators[0] simpleCases := []testQuery{ { "invalid address", - cli.GetCmdQueryLiquidationLimit(), + cli.GetCmdQueryLiquidationThreshold(), []string{ "xyz", }, @@ -1079,14 +1079,14 @@ func (s *IntegrationTestSuite) TestQueryLiquidationLimit() { }, { "query zero liquidation limit", - cli.GetCmdQueryLiquidationLimit(), + cli.GetCmdQueryLiquidationThreshold(), []string{ val.Address.String(), }, false, - &types.QueryLiquidationLimitResponse{}, - &types.QueryLiquidationLimitResponse{ - LiquidationLimit: sdk.ZeroDec(), + &types.QueryLiquidationThresholdResponse{}, + &types.QueryLiquidationThresholdResponse{ + LiquidationThreshold: sdk.ZeroDec(), }, }, } @@ -1116,17 +1116,17 @@ func (s *IntegrationTestSuite) TestQueryLiquidationLimit() { nonzeroCase := []testQuery{ { "query nonzero liquidation limit", - cli.GetCmdQueryLiquidationLimit(), + cli.GetCmdQueryLiquidationThreshold(), []string{ val.Address.String(), }, false, - &types.QueryLiquidationLimitResponse{}, - &types.QueryLiquidationLimitResponse{ + &types.QueryLiquidationThresholdResponse{}, + &types.QueryLiquidationThresholdResponse{ // From app/test_helpers.go/IntegrationTestNetworkConfig // This result is umee's liquidation threshold times the collateral // amount loaned, times its initial oracle exchange rate. - LiquidationLimit: sdk.MustNewDecFromStr("34.21"), + LiquidationThreshold: sdk.MustNewDecFromStr("34.21"), // 0.05 * 20 * 34.21 = 34.21 }, }, diff --git a/x/leverage/keeper/grpc_query.go b/x/leverage/keeper/grpc_query.go index 2b89481371..64a6fe68e8 100644 --- a/x/leverage/keeper/grpc_query.go +++ b/x/leverage/keeper/grpc_query.go @@ -508,10 +508,10 @@ func (q Querier) BorrowLimit( return &types.QueryBorrowLimitResponse{BorrowLimit: limit}, nil } -func (q Querier) LiquidationLimit( +func (q Querier) LiquidationThreshold( goCtx context.Context, - req *types.QueryLiquidationLimitRequest, -) (*types.QueryLiquidationLimitResponse, error) { + req *types.QueryLiquidationThresholdRequest, +) (*types.QueryLiquidationThresholdResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -533,7 +533,7 @@ func (q Querier) LiquidationLimit( return nil, err } - return &types.QueryLiquidationLimitResponse{LiquidationLimit: limit}, nil + return &types.QueryLiquidationThresholdResponse{LiquidationThreshold: limit}, nil } func (q Querier) LiquidationTargets( From f30cabae3b37fc7138e5b5f5df655e84fad4aba6 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 18 May 2022 13:25:36 +0200 Subject: [PATCH 21/24] final renames --- x/leverage/client/cli/query.go | 8 ++++---- x/leverage/client/tests/suite.go | 4 ++-- x/leverage/keeper/grpc_query.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x/leverage/client/cli/query.go b/x/leverage/client/cli/query.go index 68393936c8..1f83983fda 100644 --- a/x/leverage/client/cli/query.go +++ b/x/leverage/client/cli/query.go @@ -627,13 +627,13 @@ func GetCmdQueryBorrowLimit() *cobra.Command { return cmd } -// GetCmdQueryLiquidationThreshold returns a CLI command handler to query for the -// liquidation limit of a specific borrower. +// GetCmdQueryLiquidationThreshold returns a CLI command handler to query a +// liquidation threshold of a specific borrower. func GetCmdQueryLiquidationThreshold() *cobra.Command { cmd := &cobra.Command{ - Use: "liquidation-limit [addr]", + Use: "liquidation-threshold [addr]", Args: cobra.ExactArgs(1), - Short: "Query for the liquidation limit of a specified borrower", + Short: "Query a liquidation threshold of a specified borrower", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { diff --git a/x/leverage/client/tests/suite.go b/x/leverage/client/tests/suite.go index ff6f6a9a82..cb13c79ea4 100644 --- a/x/leverage/client/tests/suite.go +++ b/x/leverage/client/tests/suite.go @@ -1078,7 +1078,7 @@ func (s *IntegrationTestSuite) TestQueryLiquidationThreshold() { nil, }, { - "query zero liquidation limit", + "query zero liquidation threshold", cli.GetCmdQueryLiquidationThreshold(), []string{ val.Address.String(), @@ -1115,7 +1115,7 @@ func (s *IntegrationTestSuite) TestQueryLiquidationThreshold() { nonzeroCase := []testQuery{ { - "query nonzero liquidation limit", + "query nonzero liquidation threshold", cli.GetCmdQueryLiquidationThreshold(), []string{ val.Address.String(), diff --git a/x/leverage/keeper/grpc_query.go b/x/leverage/keeper/grpc_query.go index 64a6fe68e8..837a297de0 100644 --- a/x/leverage/keeper/grpc_query.go +++ b/x/leverage/keeper/grpc_query.go @@ -528,12 +528,12 @@ func (q Querier) LiquidationThreshold( collateral := q.Keeper.GetBorrowerCollateral(ctx, borrower) - limit, err := q.Keeper.CalculateLiquidationThreshold(ctx, collateral) + t, err := q.Keeper.CalculateLiquidationThreshold(ctx, collateral) if err != nil { return nil, err } - return &types.QueryLiquidationThresholdResponse{LiquidationThreshold: limit}, nil + return &types.QueryLiquidationThresholdResponse{LiquidationThreshold: t}, nil } func (q Querier) LiquidationTargets( From 797c4d93089b359d8ccada819dc5d4082fc1c362 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Wed, 18 May 2022 05:18:10 -0700 Subject: [PATCH 22/24] go mod tidy --- go.sum | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/go.sum b/go.sum index e9fece0761..5d6029031f 100644 --- a/go.sum +++ b/go.sum @@ -35,7 +35,6 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -220,8 +219,6 @@ github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 h1:axBiC50cNZ github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2/go.mod h1:jnzFpU88PccN/tPPhCpnNU8mZphvKxYM9lLNkd8e+os= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= @@ -543,7 +540,6 @@ github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwRO github.com/cosmos/iavl v0.17.2/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= -github.com/cosmos/ibc-go v1.2.2 h1:bs6TZ8Es1kycIu2AHlRZ9dzJ+mveqlLN/0sjWtRH88o= github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= github.com/cosmos/ibc-go/v2 v2.0.0-rc0/go.mod h1:z1LmpWwZF8YBeA3w2ibYG53R4HkhQGWjdUew/EfTSDw= github.com/cosmos/ibc-go/v2 v2.0.0/go.mod h1:n53VhNSUxCtMLysvgyNhwrGHL8OW+318LMjtSmaVe9Q= @@ -681,12 +677,10 @@ github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -714,9 +708,7 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= @@ -1088,7 +1080,6 @@ github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3 github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= @@ -1119,7 +1110,6 @@ github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIv github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -1259,7 +1249,6 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/josharian/txtarfs v0.0.0-20210218200122-0702f000015a/go.mod h1:izVPOvVRsHiKkeGCT6tYBNWyDVuzj9wAaBb5R9qamfw= github.com/jpillora/ansi v1.0.2 h1:+Ei5HCAH0xsrQRCT2PDr4mq9r4Gm4tg+arNdXRkB22s= github.com/jpillora/ansi v1.0.2/go.mod h1:D2tT+6uzJvN1nBVQILYWkIdq7zG+b5gcFN5WI/VyjMY= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= @@ -1321,7 +1310,6 @@ github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -1336,7 +1324,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4= @@ -1388,7 +1375,6 @@ github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -1745,7 +1731,6 @@ github.com/polyfloyd/go-errorlint v1.0.0 h1:pDrQG0lrh68e602Wfp68BlUTRFoHn8PZYAjL github.com/polyfloyd/go-errorlint v1.0.0/go.mod h1:KZy4xxPJyy88/gldCe5OdW6OQRtNO3EZE7hXzmnebgA= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1812,7 +1797,6 @@ github.com/quasilyte/go-ruleguard v0.3.16-0.20220213074421-6aa060fab41a/go.mod h github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.2/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.16/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.19/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= github.com/quasilyte/go-ruleguard/rules v0.0.0-20210203162857-b223e0831f88/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= @@ -1835,9 +1819,6 @@ github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzy github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= -github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= -github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= @@ -1851,7 +1832,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= @@ -1877,7 +1857,6 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 h1:G04eS0JkAIVZfaJLjla9dNxkJCPiKIGZlw9AfOhzOD0= github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= @@ -1911,7 +1890,6 @@ github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.21.7/go.mod h1:RGl11Y7XMTQPmHh8F0ayC6haKNBgH4PXMJuTAcMOlz4= -github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -1964,7 +1942,6 @@ github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHN github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1981,7 +1958,6 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= @@ -2123,13 +2099,10 @@ github.com/uudashr/gocognit v1.0.5 h1:rrSex7oHr3/pPLQ0xoWq108XMU8s678FJcQ+aSfOHa github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= -github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/quicktemplate v1.6.3/go.mod h1:fwPzK2fHuYEODzJ9pkw0ipCPNHZ2tD5KW4lOuSdPKzY= -github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= @@ -2178,7 +2151,6 @@ github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os= github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -2297,7 +2269,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 h1:FR+oGxGfbQu1d+jglI3rCkjAjUnhRSZcUxr+DqlDLNo= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= @@ -2394,7 +2365,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2539,7 +2509,6 @@ golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2589,10 +2558,7 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220403020550-483a9cbc67c0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2627,7 +2593,6 @@ golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190228203856-589c23e65e65/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2791,7 +2756,6 @@ google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqiv google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= @@ -2888,11 +2852,9 @@ google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= From 9b908695152d0aec79d66a757e4581e792eeeb76 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Wed, 18 May 2022 05:45:20 -0700 Subject: [PATCH 23/24] misc related ADR changes --- docs/architecture/ADR-005-liquidation.md | 29 +++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index c5524e2584..a1ca46d442 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -21,7 +21,7 @@ Additional parameters will be required which define the liquidation incentive an ## Decision -Liquidation will require one message type `MsgLiquidate`, one per-token parameter `LiquidationIncentive`, and two global parameters `MinimumCloseFactor` and `CompleteLiquidationThreshold`. +Liquidation will require one message type `MsgLiquidate`, two per-token parameters `LiquidationThreshold` and `LiquidationIncentive`, and two global parameters `MinimumCloseFactor` and `CompleteLiquidationThreshold`. The blockchain doesn't issue any event to signal that a borrow position can be liquidated, nor provide a list of valid targets. Liquidators will have to use an off-chain tools to query their nodes periodically. @@ -31,7 +31,7 @@ We don't provide a function that checks if a given borrower can be liquidated to A borrow position is represented by a pair `(borrower_address, coin)`, where borrower address is an entity requesting a loan. A borrower's total borrowed value (expressed in USD) can be computed from their total borrowed tokens and the `x/oracle` price oracle module. -Their borrow limit is calculated similarly using the borrower's uToken balance, their collateral settings, current uToken exchange rates, and token collateral weights. Liquidation happens when a sum of borrower loans is bigger than the `CalculateLiquidationThreshold(borrower_collateral)`. +Their liquidation threshold is calculated similarly using the borrower's uToken balance, their collateral settings, current uToken exchange rates, and token liquidation thresholds. Liquidation happens when a sum of borrower loans is bigger than the `CalculateLiquidationThreshold(borrower_collateral)`. During liquidation any of the borrower's collateral tokens can be liquidated to pay off any of their loans. @@ -46,14 +46,16 @@ type MsgLiquidate struct { Liquidator sdk.AccAddress Borrower sdk.AccAddress Repayment sdk.Coin // borrow denom + amount - RewardDenom string // collateral denom + Reward sdk.Coin // collateral denom + minimum expected amount } ``` Repayment's denom is the borrowed asset denom to be repaid (because the borrower may have multiple open borrows). It is always a base asset type (not a uToken). Its amount is the maximum amount of asset the liquidator is willing to repay. This field enables partial liquidation. -RewardDenom is the collateral type which the liquidator will receive in exchange for repaying the borrower's loan. It is always a uToken denomination. +Reward's denom is the collateral type which the liquidator will receive in exchange for repaying the borrower's loan. It is always a base asset type, thought the liquidator will actually receive uTokens. + +Additionally, the liquidator is allowed to set a minimum Reward.Amount of base tokens they would be willing to receive in exchange for the full Repayment.Amount. This acts as a failsafe and will cause any liquidation which would fall below a desired price ratio to fail instead. `Liquidator` is the signer of the message and the account which will do repayment and receive reward. @@ -61,19 +63,20 @@ RewardDenom is the collateral type which the liquidator will receive in exchange It is possible for the amount repaid by a liquidator to be less than the borrower's total borrow position in the target denom. Such partial liquidations can succeed without issue, reducing the borrowed amount by `Repayment.Amount` and rewarding collateral proportional to the amount repaid. -Additionally, the `Repayment.Amount` found in `MsgLiquidate` functions as a maximum the liquidator is willing to repay. There are multiple factors that may reduce the actual repayment below this amount: +The `Repayment.Amount` found in `MsgLiquidate` functions as a maximum the liquidator is willing to repay. There are multiple factors that may reduce the actual repayment below this amount: +- Insufficient liquidator balance of `Repayment.Denom` - Borrowed amount of `Repayment.Denom` is below `Repayment.Amount` -- Insufficient `RewardDenom` collateral to match repaid value plus liquidation incentive -- Parameter-based maximum, e.g. if a parameter `LiquidationCap = 0.50` caps liquidated value in a single transaction at 50% of the total borrowed value. +- Insufficient `Reward.Denom` collateral on borrower to match repaid value plus liquidation incentive +- Parameter-based maximum (see _Dynamic Liquidation Parameters_) In the above scenarios, the `MsgLiquidate` should succeed with the maximum amount allowed by the conditions, rather than fail outright. -### Token Parameters +### Liquidation Incentive In order to incentivize liquidators to target certain collateral types for liquidation first, we introduce a `LiquidationIncentive` parameter - defined for each supported borrowed denom. -When a `MsgLiquidate` causes liquidation to occur, the liquidator receives collateral equal to (100% + `RewardDenom.LiquidationIncentive`) of the repaid value worth of collateral. +When a `MsgLiquidate` causes liquidation to occur, the liquidator receives collateral equal to (100% + `Reward.Denom.LiquidationIncentive`) of the repaid value worth of collateral. For example, if the liquidation incentive for `atom` is `0.15`, then the liquidator receives `u/atom` collateral worth 115% of the borrowed base assets they repaid. The denom of the base assets does not affect this calculation. @@ -82,7 +85,7 @@ For example, if the liquidation incentive for `atom` is `0.15`, then the liquida When a `MsgLiquidate` is received, the `x/leverage` module must determine if the targeted borrow position is eligible for liquidation. ```go - // from MsgLiquidate (liquidatorAddr, borrowerAddr, repayDenom, repayAmount, rewardDenom) + // from MsgLiquidate (liquidatorAddr, borrowerAddr, repay, reward) borrowed := GetTotalBorrows(borrowerAddr) borrowValue := TotalValue(borrowed) // price oracle @@ -103,9 +106,6 @@ After eligibility is confirmed, parameters governing liquidation can be fetched: liquidationIncentive, closeFactor := GetLiquidationParameters(rewardDenom, borrowValue, collateralValue) ``` -The liquidation incentive is a collateral bonus received when a liquidator repays a borrowed position -(e.g. incentive=`0.2` means liquidator receives 20% extra of the liquidated collateral). - The close factor is the maximum portion of a borrow position eligible for liquidation in a single liquidation event. See _Dynamic Liquidation Parameters_ section at the bottom of this document. @@ -185,6 +185,8 @@ The offchain liquidation tool employed by liquidators will need several queries - GetTotalBorrows(borrower): Returns an `sdk.Coins` containing all assets borrowed by a single borrower - GetTotalCollateral(borrower): Returns an `sdk.Coins` containing all uTokens in borrower's balance that are enabled as collateral +The first query in particular requires iteration over all borrowers. This would be too performance-intensive for most nodes to run, so it needs to be emulated instead as part of the liquidator tool. + In addition to the above, the liquidation tool should be able to read any global or per-token parameters in order to finish calculating borrow limits and potential liquidation rewards. ## Consequences @@ -201,6 +203,7 @@ In addition to the above, the liquidation tool should be able to read any global - New message type `MsgLiquidate` is created - New per-token parameter `LiquidationIncentive` will be created to determine liquidation incentives +- New per-token parameter `LiquidationThreshold` similar to `CollateralWeight` will be created - New global parameters `MinimumCloseFactor` and `CompleteLiquidationThreshold` will be created for close factors ## References From a4625b80f7d0c373f711f73bab831812f23e9108 Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Wed, 18 May 2022 05:48:32 -0700 Subject: [PATCH 24/24] whitespace --- docs/architecture/ADR-005-liquidation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/ADR-005-liquidation.md b/docs/architecture/ADR-005-liquidation.md index a1ca46d442..924a3a115c 100644 --- a/docs/architecture/ADR-005-liquidation.md +++ b/docs/architecture/ADR-005-liquidation.md @@ -46,7 +46,7 @@ type MsgLiquidate struct { Liquidator sdk.AccAddress Borrower sdk.AccAddress Repayment sdk.Coin // borrow denom + amount - Reward sdk.Coin // collateral denom + minimum expected amount + Reward sdk.Coin // collateral denom + minimum expected amount } ```