Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement fast-liquidation #2106

Merged
merged 33 commits into from
Jun 26, 2023
Merged

feat: implement fast-liquidation #2106

merged 33 commits into from
Jun 26, 2023

Conversation

toteki
Copy link
Member

@toteki toteki commented Jun 22, 2023

Follows up on the proto PR. Will include feature and tests.

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Merging #2106 (1925266) into main (7f05ad4) will decrease coverage by 0.39%.
The diff coverage is 77.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2106      +/-   ##
==========================================
- Coverage   75.38%   75.00%   -0.39%     
==========================================
  Files         100      127      +27     
  Lines        8025     9776    +1751     
==========================================
+ Hits         6050     7332    +1282     
- Misses       1589     1957     +368     
- Partials      386      487     +101     
Impacted Files Coverage Δ
ante/spam_prevention.go 75.92% <ø> (ø)
x/incentive/codec.go 47.82% <ø> (+9.89%) ⬆️
x/incentive/keeper/invariants.go 0.00% <0.00%> (ø)
x/leverage/client/tests/suite.go 100.00% <ø> (ø)
x/leverage/client/tests/tests.go 100.00% <ø> (ø)
x/leverage/keeper/borrows.go 77.58% <ø> (-0.99%) ⬇️
x/leverage/keeper/collateral.go 72.72% <ø> (-0.16%) ⬇️
x/leverage/keeper/errors.go 100.00% <ø> (ø)
x/leverage/keeper/exchange_rate.go 72.72% <ø> (ø)
x/leverage/keeper/genesis.go 87.23% <ø> (ø)
... and 62 more

... and 25 files with indirect coverage changes

@toteki toteki marked this pull request as ready for review June 23, 2023 04:30
@toteki toteki requested a review from a team as a code owner June 23, 2023 04:30
x/leverage/client/cli/tx.go Outdated Show resolved Hide resolved
Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that there are few risks with the approach (liquidator going into danger zone, liquidator getting a debt to pay, which is not paid automatically), let's make sure we:

  • document this in the README (or other file, and link it to README).
  • update the proto comments
  • update CLI (just saying that liquidator will take borrowers debt, which later the liquidator will need to pay).
  • also let's rename Fast Liquidation to Leverage Liquidation (good name suggestion by Adam)

I will add few follow up tasks to linear

x/leverage/client/cli/tx.go Outdated Show resolved Hide resolved
x/leverage/client/cli/tx.go Outdated Show resolved Hide resolved
x/leverage/keeper/keeper.go Outdated Show resolved Hide resolved
x/leverage/keeper/keeper.go Show resolved Hide resolved
x/leverage/keeper/keeper.go Show resolved Hide resolved
x/leverage/keeper/liquidate.go Outdated Show resolved Hide resolved
x/leverage/keeper/keeper.go Show resolved Hide resolved
x/leverage/keeper/liquidate_test.go Show resolved Hide resolved
@toteki toteki requested a review from a team as a code owner June 23, 2023 19:10
Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Left few docs suggestions.

x/leverage/README.md Outdated Show resolved Hide resolved
x/leverage/README.md Outdated Show resolved Hide resolved
x/leverage/client/cli/tx.go Outdated Show resolved Hide resolved
robert-zaremba and others added 4 commits June 26, 2023 11:19
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
@toteki
Copy link
Member Author

toteki commented Jun 26, 2023

All suggestions committed - moving to merge

@toteki toteki enabled auto-merge June 26, 2023 12:56
@toteki toteki added this pull request to the merge queue Jun 26, 2023
Merged via the queue into main with commit f899adf Jun 26, 2023
@toteki toteki deleted the adam/flash branch June 26, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants