Skip to content

Commit

Permalink
docs: leverage proto docs update (#1370)
Browse files Browse the repository at this point in the history
## Description

Updates related to #1369

---

### Author Checklist

_All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues._

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] added appropriate labels to the PR
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/umee-network/umee/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

_All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items._

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
  • Loading branch information
robert-zaremba committed Sep 18, 2022
1 parent d78815f commit ee334f2
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 101 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ test-sim-benchmark-invariants
## Protobuf ##
###############################################################################

#DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc11
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.7.0

containerProtoVer=v0.7
Expand Down
54 changes: 42 additions & 12 deletions proto/umee/leverage/v1/leverage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,42 @@ option (gogoproto.goproto_getters_all) = false;
// Params defines the parameters for the leverage module.
message Params {
option (gogoproto.goproto_stringer) = false;
// Complete Liquidation Threshold determines how far over their borrow
// limit a borrower must be in order for their positions to be liquidated
// fully in a single event.
// Complete Liquidation Threshold determines how far between
// liquidation_threshold (LT) and collateral_value (CV) a borrower's
// borrowed value must have progressed in order to allow a full liquidation.
// 0.3 indicates 30% of the way from LT to CV.
// Valid values: 0-1.
string complete_liquidation_threshold = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"complete_liquidation_threshold\""
];
// Minimum Close Factor determines the portion of a borrower's position
// that can be liquidated in a single event, when the borrower is just barely
// over their borrow limit.
// Close Factor determines the portion of a borrower's position that can be
// liquidated in a single event. Minimum Close Factor is Close Factor at
// liquidation_threshold. 0.1 means that that 10% of the borrower position can
// be liquidated when the borrowed value passes the liquidation_threshold.
// close_factor scales linearly between minimum_close_factor and 1.0,
// reaching its maximum when borrowed value passes
// complete_liquidation_threshold. We can put it into the picture:
//
// borrowed C := collateral
// value value
// --- | ------- | ----- | -------- | ------->
// L CL
//
// liquidation = liquidation_threshold * C
// CL = L + (C-CL) * complete_liquidation_threshold
// is the borrowed value above which close factor will be 1.
//
// Valid values: 0-1.
string minimum_close_factor = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"minimum_close_factor\""
];
// Oracle Reward Factor determines the portion of interest accrued on
// borrows that is sent to the oracle module to fund its reward pool.
// Valid values: 0-1.
string oracle_reward_factor = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -44,6 +62,7 @@ message Params {
// Direct Liquidation Fee is a reduction factor in liquidation incentive
// experienced by liquidators who choose to receive base assets instead of
// uTokens as liquidation rewards.
// Valid values: 0-1.
string direct_liquidation_fee = 6 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -61,6 +80,7 @@ message Token {

// Reserve Factor defines what portion of accrued interest goes to reserves
// when this token is borrowed.
// Valid values: 0-1.
string reserve_factor = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -70,15 +90,18 @@ message Token {
// Collateral Weight defines what portion of the total value of the asset
// can contribute to a users borrowing power. If the collateral weight is
// zero, using this asset as collateral against borrowing will be disabled.
// Valid values: 0-1.
string collateral_weight = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"collateral_weight\""
];

// Liquidation Threshold defines what amount of the total value of the
// asset can contribute to a user's liquidation threshold (above which they
// become eligible for liquidation).
// asset as a collateral can contribute to a user's liquidation threshold
// (above which they become eligible for liquidation).
// See also: min_close_factor.
// Valid values: 0-1.
string liquidation_threshold = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -87,6 +110,7 @@ message Token {

// Base Borrow Rate defines the minimum interest rate for borrowing this
// asset.
// Valid values: 0-inf
string base_borrow_rate = 5 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -95,6 +119,7 @@ message Token {

// Kink Borrow Rate defines the interest rate for borrowing this
// asset when supply utilization is equal to 'kink_utilization'.
// Valid values: 0-inf
string kink_borrow_rate = 6 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -103,6 +128,7 @@ message Token {

// Max Borrow Rate defines the interest rate for borrowing this
// asset when supply utilization is at its maximum.
// Valid values: 0-inf
string max_borrow_rate = 7 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -111,6 +137,7 @@ message Token {

// Kink Utilization defines the supply utilization value where
// the kink in the borrow interest rate function occurs.
// Valid values: 0-1.
string kink_utilization = 8 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand All @@ -119,6 +146,7 @@ message Token {

// Liquidation Incentive determines the portion of bonus collateral of
// a token type liquidators receive as a liquidation reward.
// Valid values: 0-1.
string liquidation_incentive = 9 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand Down Expand Up @@ -174,10 +202,12 @@ message Token {
(gogoproto.moretags) = "yaml:\"max_supply_utilization\""
];

// Min Collateral Liquidity specifies the minimum collateral liquidity a token is
// allowed to reach as a direct result of users borrowing, collateralizing, or
// withdrawing assets. Liquidity can only drop below this value due to interest
// or liquidations.
// Min Collateral Liquidity specifies an allowed minimum allowed for the following function:
// collateral_liquidity(token) = available(token) / total_collateral(token)
// Borrowing, collateralizing, or withdrawing assets is not allowed when the
// result of such action invalidates min_collateral_liquidity.
// Liquidity can only drop below this value due to interest or liquidations.
// Valid values: 0 - 1
string min_collateral_liquidity = 17 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand Down

0 comments on commit ee334f2

Please sign in to comment.