Skip to content

fix: take into account the Total Available Liquidity and Collateral when MaxWithdraw#1929

Merged
kosegor merged 46 commits intomainfrom
egor/maxwithdraw
Mar 25, 2023
Merged

fix: take into account the Total Available Liquidity and Collateral when MaxWithdraw#1929
kosegor merged 46 commits intomainfrom
egor/maxwithdraw

Conversation

@kosegor
Copy link
Copy Markdown
Contributor

@kosegor kosegor commented Mar 17, 2023

Description

closes: #XXXX


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 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)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • 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 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)

@kosegor kosegor self-assigned this Mar 17, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2023

Codecov Report

Merging #1929 (1619a7b) into main (89c3f4e) will increase coverage by 0.12%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1929      +/-   ##
==========================================
+ Coverage   66.74%   66.86%   +0.12%     
==========================================
  Files          98       98              
  Lines        7851     7908      +57     
==========================================
+ Hits         5240     5288      +48     
- Misses       2201     2207       +6     
- Partials      410      413       +3     
Impacted Files Coverage Δ
x/leverage/keeper/limits.go 65.44% <54.54%> (ø)
x/leverage/keeper/msg_server.go 79.10% <76.92%> (-0.15%) ⬇️
x/leverage/keeper/collateral.go 73.98% <86.66%> (+4.45%) ⬆️
x/leverage/keeper/grpc_query.go 67.21% <100.00%> (ø)

@kosegor kosegor changed the title fix: take into account the Total Available Liquidity when MaxBorrow and MaxWithdraw fix: take into account the Total Available Liquidity and Collateral when MaxWithdraw Mar 22, 2023
@kosegor kosegor marked this pull request as ready for review March 22, 2023 18:51
@kosegor kosegor requested review from a team as code owners March 22, 2023 18:51
Copy link
Copy Markdown
Contributor

@toteki toteki left a comment

Choose a reason for hiding this comment

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

Looks good to merge once the remaining comments are resolved

kosegor and others added 12 commits March 23, 2023 17:48
Signed-off-by: Egor Kostetskiy <kosegor@gmail.com>
* build(deps): Bump github.com/mgechev/revive from 1.2.5 to 1.3.0

Bumps [github.com/mgechev/revive](https://github.com/mgechev/revive) from 1.2.5 to 1.3.0.
- [Release notes](https://github.com/mgechev/revive/releases)
- [Changelog](https://github.com/mgechev/revive/blob/master/.goreleaser.yml)
- [Commits](mgechev/revive@v1.2.5...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/mgechev/revive
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
* chore: v4.2 changelog

* release notes

* Apply suggestions from code review

Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>

* release notes update

* release notes update

---------

Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
…efault params accept list (#1918)

* fix: remove atom settings from leverage default genesis

* fix: fix the tests

* chore: remove atom from orclae default accept list
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1916)

* build(deps): Bump google.golang.org/protobuf from 1.29.0 to 1.29.1

Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.29.0 to 1.29.1.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](protocolbuffers/protobuf-go@v1.29.0...v1.29.1)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
* chore: improve makefile

* update readme

* fix makefile

* update readme

* cosmovisor update for readme

* Update Makefile

* fix readme

* lint
…1925)

* build(deps): Bump google.golang.org/protobuf from 1.29.1 to 1.30.0

Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.29.1 to 1.30.0.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](protocolbuffers/protobuf-go@v1.29.1...v1.30.0)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
kosegor and others added 13 commits March 23, 2023 17:49
Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
* feat: adding Cosmos SDK context and store utils

* adding unit test

* adding iterate test

* linting

* adding a comment
* chore: set codecov targets

* update
Signed-off-by: Egor Kostetskiy <kosegor@gmail.com>
@kosegor kosegor requested a review from a team as a code owner March 23, 2023 20:50
@kosegor kosegor added this pull request to the merge queue Mar 23, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 23, 2023
@toteki toteki added this pull request to the merge queue Mar 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 24, 2023
@toteki
Copy link
Copy Markdown
Contributor

toteki commented Mar 24, 2023

Seeing problems with the merge queue - trying again

@toteki toteki added this pull request to the merge queue Mar 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 24, 2023
@kosegor kosegor added this pull request to the merge queue Mar 25, 2023
Merged via the queue into main with commit 3ee9d8d Mar 25, 2023
@kosegor kosegor deleted the egor/maxwithdraw branch March 25, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants