Skip to content

Commit d387e22

Browse files
VitalyV1337mergify[bot]czarcas7icniccoloraspap0mvn
authored
EstimateTradeBasedOnPriceImpact Query (#6167)
* query: user<>clPool positions breakdown for superfluid (#5600) (#5607) * add user-pool position breakdown for superfluid * fix godoc * add basic test * slightly expand test * remove defense in depth * use osmoutils * error with locked but non superfluid positions (cherry picked from commit bab837cbac92f08661d8474101b46597b2a379e5) Co-authored-by: Adam Tucker <adam@osmosis.team> * Remove unused state-sync github action (#5604) (#5605) (cherry picked from commit 7c28d79b86964f9f8610ec5d506f47f64f43fc56) Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> * fix: remove duplicate suite (#5610) (#5613) (cherry picked from commit 7ed01124aa798932a8465e18c80f1b87ffdc533f) Co-authored-by: Roman <roman@osmosis.team> * chore: remove tf bank hooks from v16.x (#5614) * Improve build Github Actions (#5603) (#5618) (cherry picked from commit 362af3158430c11963df78e44a0abf5dfe03690a) Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> * [ci] Paralleze go tests github actions (#5602) (#5619) * Paralleze go tests * Speculative execution of go-split-test-files to save time * Revert "Speculative execution of go-split-test-files to save time" This reverts commit ca5ea6f20f4e23ba2e6af68db85295fb6f4d9540. (cherry picked from commit 35f54cb9b3b398176bfdbaf6c2fdb7dad1a5e2da) Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> * Ci improvements/remove double caching (#5620) (#5622) * Remove double caching from test github action * Remove double caching from build github action + separate go mod download * Update get-diff patterns in build action * remove duplicate caching in update-go-import github action * Rename github action * remove duplicate caching in test-e2e-makefile * remove duplicate caching in lint (cherry picked from commit 24f580da12272205fab04afbd97c7a87f5b7dc56) Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> * Remove proto deserialization from HasPosition (#5616) (#5629) * Remove proto deserialization from HasPosition * regenerate go mod --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> (cherry picked from commit 7df187a3ab9116621fbefadc71dfe19721e22f48) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * Update swagger gen (#5626) * Backport: Emited IBC errors should also be logged (#5480) (#5632) * backporting adding errors to logs * hardcoded string as const (cherry picked from commit 80bf16e8441d5dde1fa9680d162cdddd09c53711) Co-authored-by: Nicolas Lara <nicolaslara@gmail.com> * fix: upgrade handler dai amount change (#5633) (#5640) * upgrade handler dai amount change * update comment * fix test * update error margin * 73 cent spot price * update e2e json * update init config * just need v15 init image now * update v15 init image (cherry picked from commit e9f0b1eddbebc4481e212db442ed9ae9b52f4517) Co-authored-by: Adam Tucker <adam@osmosis.team> * repro infinite loop in swap logic (#5609) (#5649) (cherry picked from commit 3607b3a55d2fcb6ad9e1e21ab28ec69e9879f153) Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> * misc: final cleanup from audit results (#5641) (#5651) Closes: #XXX ## What is the purpose of the change This PR includes the final changes from audit results ## Testing and Verifying Ensured that existing test cases pass ## Documentation and Release Note - [ ] Does this pull request introduce a new feature or user-facing behavior changes? - [ ] Changelog entry added to `Unreleased` section of `CHANGELOG.md`? Where is the change documented? - [ ] Specification (`x/{module}/README.md`) - [ ] Osmosis documentation site - [ ] Code comments? - [ ] N/A (cherry picked from commit ed8ed777a83ec54f4aaf7844310a0e4e8148c263) Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> * Revert "Optimize Genesis for CL Module (#5453)" (#5631) (#5653) This reverts commit 70b2fff7a53a20c51b3cd1da8317d4264ea6f629. (cherry picked from commit d8945575c0bad1a0b8860b0fbad802c2f2a3663e) Co-authored-by: Adam Tucker <adam@osmosis.team> * Reduce clmath test compilation time, fix discrepancy in rounding (#5650) (#5652) * Reduce clmath test compilation time, fix discrepancy in rounding * remove unneeded helper (cherry picked from commit 9f7b70b0ac276261b7e3bf16ad1f6e0e159f28be) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * fix: modify v16 upgrade handler (#5659) (#5660) * modify upgrade handler * update test * fund community pool 1dai before upgrade e2e * fund chain b as well * test added (cherry picked from commit 6138de4fdfeb2330d30ad1f5e43f232b6cb15f15) Co-authored-by: Adam Tucker <adam@osmosis.team> * Update test script deps (#5658) (#5661) * update test script deps * another update (cherry picked from commit 13cb7e7d2f86d7a0d796bd597fbf8df3bf963748) Co-authored-by: Jon Ator <jonathanator0@gmail.com> * Fix testing errors in tick tests (#5662) (#5666) * Fix testing errors in tick tests * Fix remaining case * generate more test vectors rather than hardcode * delete more unneeded lines (cherry picked from commit d7336b5e60f8f7d0b48e64617dbc354e05b1288b) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * fix: cl sf positions per user per pool query (#5668) (#5669) * check if lock is mature in sf query * check if lock has matured in query * Update position.go * simpler change (cherry picked from commit 0b7700a4558c0418499395055166526c2f916874) Co-authored-by: Adam Tucker <adam@osmosis.team> * upgrade handler ascii (#5671) (#5676) (cherry picked from commit 0a867a8e535e5c9e02ed37886720160cb1ffa192) Co-authored-by: Adam Tucker <adam@osmosis.team> * sf positions cl patch (#5682) (#5683) * Introduce ResetTest, use in CL for 2x test speedup (#5611) (#5689) * Introduce ResetTest, use in CL for 2x test speedup * now 3.8 seconds * remove extraneous setupTest calls * reduce gamm test time * speedup more of gamm * driveby invariant test speedup * remove extra println * undo ResetTest being a separate fn * same dev UX improvement to gamm * Add comments (cherry picked from commit 28a12d0b441796dc3df0e3fe4ab4dd854abb5027) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * refactor/fix: swap step iteration limit (#5647) (#5688) * repro infinite loop in swap logic * refactor/fix: swap step iteration limit * Update x/concentrated-liquidity/swaps_test.go Co-authored-by: Adam Tucker <adam@osmosis.team> * swap limit to 100 * clearer comments * Update x/concentrated-liquidity/swaps.go Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> * Update x/concentrated-liquidity/types/errors.go Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> (cherry picked from commit a593f6aea6a1e8612f376dc58debfea2a692fbe7) Co-authored-by: Roman <roman@osmosis.team> * Driveby apptesting changes I made, while looking at other testing things (#5617) (#5667) * Driveby apptesting changes I made, while looking at other testing things * undo one change * Fix failing test * Fix gamm test (cherry picked from commit 1b317e49a8f24e425a15f5429fe3602b228ed113) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * Add redirect tosnapshot endpoint, add our public nodes addrbook (#5699) (#5708) (cherry picked from commit e3466fcb8239ac96562fd82d04e9bdaa5cde7c63) Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> * chore: query total liquidity across all cl pools (#5670) (#5709) * query total liquidity across all cl pools * add total liquidity across all three pool types * query gen * query gen * use O(n) time total liquidity query * add store entry * no need to store total liq in genesis (cherry picked from commit e44b5cda1db7094b7e091e49318d1262449d79ad) Co-authored-by: Adam Tucker <adam@osmosis.team> * chore: cl unbonding positions query (#5684) (#5711) * cl unbonding positions query * cl unbonding positions query * regen proto * add basic test * chore: sf undelegating / delegated cl queries (#5691) * undelegating / delegated cl queries * correct comment * remove switch and add errors.Is * Update proto/osmosis/superfluid/query.proto Co-authored-by: Jon Ator <jonathanator0@gmail.com> * Update proto/osmosis/superfluid/query.proto Co-authored-by: Jon Ator <jonathanator0@gmail.com> * rename to delegate in place of bond * fix errors Is --------- Co-authored-by: Jon Ator <jonathanator0@gmail.com> * remove switch statement * add position id to error * add synth lock to q * regen proto --------- Co-authored-by: Jon Ator <jonathanator0@gmail.com> (cherry picked from commit f9b3cc10422b12d17b3620c5e1004628ca39c943) Co-authored-by: Adam Tucker <adam@osmosis.team> * precision increase solution to infinite loop bug (#5612) (#5712) * repro infinite loop in swap logic * precision increase solution to infinite loop bug * fix * remove logic * remove error * updates * updates * updates * updates * begin switching zeroForOneStrategy.ComputeSwapWithinBucketInGivenOut * switch remaining zero for one swap step and add rounding comments * begin switching cur sqrt price to big dec in swaps * try adding CalculateSqrtPriceToTickBigDec * one for zero out given in tests * fix one for zero tests * update one for zero tests * in-progress test * updates * fix TestComputeSwapStepOutGivenIn_ZeroForOne * fix TestComputeSwapStepInGivenOut_ZeroForOne * convert current sqrt price to BigDec and resolve syntax errors * updates * clean up * clean ups * clean ups * fix TestComputeSwapState_Inverse * comment * updates * clean ups * remove unused function * remove unused GetNextSqrtPriceFromAmount1OutRoundingDown * switch GetNextSqrtPriceFromAmount0InRoundingUp to big dec * fully convert GetNextSqrtPriceFromAmount0OutRoundingUp to big dec * clean up math tests more * more math test clean up * fully convert calc methods to big dec * fix model package tests * fix TestAddToPosition * fix TestCalculateSpotPrice * fix TestSingleSidedAddToPosition * fix TestUninitializePool * go mod update * big dec comparison correction and prints * fix equality issues * convert tests to big dec * fix a few swap tests * small e2e fix * more swap test fixes * updates * fix another test * please get fixed * fix all out given in swap tests * e2e * fix all one for zero in given out * I can fix you * clean ups * MulRoundUp test * test SDKDecRoundUp * clean up * revert launch.json * comment * add zero for one swap strategy ULP tests * typo * remove errors * remove prints --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> (cherry picked from commit 950fd12f44330680fc5e90aa135679484f811260) Co-authored-by: Roman <roman@osmosis.team> * Add lock reward receiver testing script, add minor fix for cli command (#5687) (#5692) * Add lock reward receiver * Fix typo (cherry picked from commit d5fcd089a71c39cdad0ffe6b3c9a2fcac30be1d6) Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> * refactor/security: prevent same execution price exploit within the same ULP (#5693) (#5713) * repro infinite loop in swap logic * precision increase solution to infinite loop bug * fix * remove logic * remove error * updates * updates * updates * updates * begin switching zeroForOneStrategy.ComputeSwapWithinBucketInGivenOut * switch remaining zero for one swap step and add rounding comments * begin switching cur sqrt price to big dec in swaps * try adding CalculateSqrtPriceToTickBigDec * one for zero out given in tests * fix one for zero tests * update one for zero tests * in-progress test * updates * fix TestComputeSwapStepOutGivenIn_ZeroForOne * fix TestComputeSwapStepInGivenOut_ZeroForOne * convert current sqrt price to BigDec and resolve syntax errors * updates * clean up * clean ups * clean ups * fix TestComputeSwapState_Inverse * comment * updates * clean ups * remove unused function * remove unused GetNextSqrtPriceFromAmount1OutRoundingDown * switch GetNextSqrtPriceFromAmount0InRoundingUp to big dec * fully convert GetNextSqrtPriceFromAmount0OutRoundingUp to big dec * clean up math tests more * more math test clean up * fully convert calc methods to big dec * fix model package tests * fix TestAddToPosition * fix TestCalculateSpotPrice * fix TestSingleSidedAddToPosition * fix TestUninitializePool * go mod update * big dec comparison correction and prints * fix equality issues * convert tests to big dec * fix a few swap tests * small e2e fix * more swap test fixes * updates * fix another test * please get fixed * fix all out given in swap tests * e2e * fix all one for zero in given out * I can fix you * clean ups * MulRoundUp test * test SDKDecRoundUp * clean up * revert launch.json * comment * refactor/security: prevent same execution price exploit within the same ULP * add zero for one swap strategy ULP tests * typo * remove errors * remove prints * typos * typo --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> (cherry picked from commit cf223be21b8530b28a326c4d0738e8dc5d0f63f2) Co-authored-by: Roman <roman@osmosis.team> * fix(CL): negative amount out consumed (#5695) (#5714) * repro infinite loop in swap logic * precision increase solution to infinite loop bug * fix * remove logic * remove error * updates * updates * updates * updates * begin switching zeroForOneStrategy.ComputeSwapWithinBucketInGivenOut * switch remaining zero for one swap step and add rounding comments * begin switching cur sqrt price to big dec in swaps * try adding CalculateSqrtPriceToTickBigDec * one for zero out given in tests * fix one for zero tests * update one for zero tests * in-progress test * updates * fix TestComputeSwapStepOutGivenIn_ZeroForOne * fix TestComputeSwapStepInGivenOut_ZeroForOne * convert current sqrt price to BigDec and resolve syntax errors * updates * clean up * clean ups * clean ups * fix TestComputeSwapState_Inverse * comment * updates * clean ups * remove unused function * remove unused GetNextSqrtPriceFromAmount1OutRoundingDown * switch GetNextSqrtPriceFromAmount0InRoundingUp to big dec * fully convert GetNextSqrtPriceFromAmount0OutRoundingUp to big dec * clean up math tests more * more math test clean up * fully convert calc methods to big dec * fix model package tests * fix TestAddToPosition * fix TestCalculateSpotPrice * fix TestSingleSidedAddToPosition * fix TestUninitializePool * go mod update * big dec comparison correction and prints * fix equality issues * convert tests to big dec * fix a few swap tests * small e2e fix * more swap test fixes * updates * fix another test * please get fixed * fix all out given in swap tests * e2e * fix all one for zero in given out * I can fix you * clean ups * MulRoundUp test * test SDKDecRoundUp * clean up * revert launch.json * comment * refactor/security: prevent same execution price exploit within the same ULP * repro for negative amount consumed * updates * core fix, tests and code comments * add zero for one swap strategy ULP tests * fix zero for one test * typo * remove errors * remove prints * typos * typo * remove obsolete comment --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> (cherry picked from commit c00ead89801fe79b4471ac91643cdf70fd8f96e9) Co-authored-by: Roman <roman@osmosis.team> * Speedup approx script (#5654) (#5720) * Speedup approx script * further spedup (cherry picked from commit 83d2edfef2ed84e253a96a06e073c835eb25b4c3) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * chore: update sdk fork dep (backport #5716) (#5718) Co-authored-by: Roman <roman@osmosis.team> * [CL: Audit] Superfluid Migration audit / cleanup (#5615) (#5717) * issue no lock send * added verbose test * audit progress * lock handling case * investigating calculation * cleanup * locked LP shares issue * added issue * issue fixed * cleanup * more cleanup * Update x/superfluid/keeper/migrate.go * Update x/superfluid/keeper/migrate.go Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> --------- Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> (cherry picked from commit a923e6c6f898c5401c35727fbf3990790fa1c7ba) Co-authored-by: Sishir Giri <sis1001@berkeley.edu> * CLI fix: `create-gauge` exact args (#5663) (#5719) * fix: increment exact args * add more desc (cherry picked from commit 893403f6415991b8eb418efe7b415e585df053fb) Co-authored-by: Jon Ator <jonathanator0@gmail.com> * fix: cw pool import export genesis (backport #5696) (#5715) * Remove unused state-sync github action (#5604) * query: user<>clPool positions breakdown for superfluid (#5600) * add user-pool position breakdown for superfluid * fix godoc * add basic test * slightly expand test * remove defense in depth * use osmoutils * error with locked but non superfluid positions * fix: remove duplicate suite (#5610) * Introduce ResetTest, use in CL for 2x test speedup (#5611) * Introduce ResetTest, use in CL for 2x test speedup * now 3.8 seconds * remove extraneous setupTest calls * reduce gamm test time * speedup more of gamm * driveby invariant test speedup * remove extra println * undo ResetTest being a separate fn * same dev UX improvement to gamm * Add comments * Improve build Github Actions (#5603) * [ci] Paralleze go tests github actions (#5602) * Paralleze go tests * Speculative execution of go-split-test-files to save time * Revert "Speculative execution of go-split-test-files to save time" This reverts commit ca5ea6f20f4e23ba2e6af68db85295fb6f4d9540. * Ci improvements/remove double caching (#5620) * Remove double caching from test github action * Remove double caching from build github action + separate go mod download * Update get-diff patterns in build action * remove duplicate caching in update-go-import github action * Rename github action * remove duplicate caching in test-e2e-makefile * remove duplicate caching in lint * [CL]: Expand randomized position range tests to include incentive records (#5559) * draft incentive record setup and tracking * implement assertions and clean up base logic * chore(deps): bump tj-actions/changed-files from 36.4.0 to 37.0.2 (#5625) Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 36.4.0 to 37.0.2. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v36.4.0...v37.0.2) --- updated-dependencies: - dependency-name: tj-actions/changed-files 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> * Remove proto deserialization from HasPosition (#5616) * Remove proto deserialization from HasPosition * regenerate go mod --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> * Add CI to generate and update docs (#5627) * Update docs * Change to on push * Backport: Emited IBC errors should also be logged (#5480) * backporting adding errors to logs * hardcoded string as const * Add github action to remove old workflow run (#5621) * fix: upgrade handler dai amount change (#5633) * upgrade handler dai amount change * update comment * fix test * update error margin * 73 cent spot price * update e2e json * update init config * just need v15 init image now * update v15 init image * chore(deps): bump actions/setup-go from 2 to 4 (#5635) * chore(deps): bump actions/setup-go from 2 to 4 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2...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> * Update generate-docs.yml --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com> * chore(deps): bump peter-evans/create-pull-request from 3 to 5 (#5638) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3 to 5. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v3...v5) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request 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> * chore(deps): bump actions/setup-node from 2 to 3 (#5637) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-node 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> * add images to README.md in tokenfactory module (#5594) Co-authored-by: alessandromazza <alessandro98.mazza@gmail.com> Co-authored-by: niilptr <niilptr@users.noreply.github.com> * repro infinite loop in swap logic (#5609) * misc: final cleanup from audit results (#5641) Closes: #XXX ## What is the purpose of the change This PR includes the final changes from audit results ## Testing and Verifying Ensured that existing test cases pass ## Documentation and Release Note - [ ] Does this pull request introduce a new feature or user-facing behavior changes? - [ ] Changelog entry added to `Unreleased` section of `CHANGELOG.md`? Where is the change documented? - [ ] Specification (`x/{module}/README.md`) - [ ] Osmosis documentation site - [ ] Code comments? - [ ] N/A * Reduce clmath test compilation time, fix discrepancy in rounding (#5650) * Reduce clmath test compilation time, fix discrepancy in rounding * remove unneeded helper * Revert "Optimize Genesis for CL Module (#5453)" (#5631) This reverts commit 70b2fff7a53a20c51b3cd1da8317d4264ea6f629. * Speedup approx script (#5654) * Speedup approx script * further spedup * fix: modify v16 upgrade handler (#5659) * modify upgrade handler * update test * fund community pool 1dai before upgrade e2e * fund chain b as well * test added * Update test script deps (#5658) * update test script deps * another update * CLI fix: `create-gauge` exact args (#5663) * fix: increment exact args * add more desc * Fix testing errors in tick tests (#5662) * Fix testing errors in tick tests * Fix remaining case * generate more test vectors rather than hardcode * delete more unneeded lines * Driveby apptesting changes I made, while looking at other testing things (#5617) * Driveby apptesting changes I made, while looking at other testing things * undo one change * Fix failing test * Fix gamm test * [CL: Audit] Superfluid Migration audit / cleanup (#5615) * issue no lock send * added verbose test * audit progress * lock handling case * investigating calculation * cleanup * locked LP shares issue * added issue * issue fixed * cleanup * more cleanup * Update x/superfluid/keeper/migrate.go * Update x/superfluid/keeper/migrate.go Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> --------- Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> * fix: cl sf positions per user per pool query (#5668) * check if lock is mature in sf query * check if lock has matured in query * Update position.go * simpler change * upgrade handler ascii (#5671) * update scripts (#5677) * sf positions cl patch (#5682) * refactor/fix: swap step iteration limit (#5647) * repro infinite loop in swap logic * refactor/fix: swap step iteration limit * Update x/concentrated-liquidity/swaps_test.go Co-authored-by: Adam Tucker <adam@osmosis.team> * swap limit to 100 * clearer comments * Update x/concentrated-liquidity/swaps.go Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> * Update x/concentrated-liquidity/types/errors.go Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> * chore(deps): bump actions/labeler from 4.1.0 to 4.2.0 (#5685) Bumps [actions/labeler](https://github.com/actions/labeler) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/actions/labeler/releases) - [Commits](https://github.com/actions/labeler/compare/4.1.0...v4.2.0) --- updated-dependencies: - dependency-name: actions/labeler dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add lock reward receiver testing script, add minor fix for cli command (#5687) * Add lock reward receiver * Fix typo * Add redirect tosnapshot endpoint, add our public nodes addrbook (#5699) * chore: query total liquidity across all cl pools (#5670) * query total liquidity across all cl pools * add total liquidity across all three pool types * query gen * query gen * use O(n) time total liquidity query * add store entry * no need to store total liq in genesis * chore: cl unbonding positions query (#5684) * cl unbonding positions query * cl unbonding positions query * regen proto * add basic test * chore: sf undelegating / delegated cl queries (#5691) * undelegating / delegated cl queries * correct comment * remove switch and add errors.Is * Update proto/osmosis/superfluid/query.proto Co-authored-by: Jon Ator <jonathanator0@gmail.com> * Update proto/osmosis/superfluid/query.proto Co-authored-by: Jon Ator <jonathanator0@gmail.com> * rename to delegate in place of bond * fix errors Is --------- Co-authored-by: Jon Ator <jonathanator0@gmail.com> * remove switch statement * add position id to error * add synth lock to q * regen proto --------- Co-authored-by: Jon Ator <jonathanator0@gmail.com> * precision increase solution to infinite loop bug (#5612) * repro infinite loop in swap logic * precision increase solution to infinite loop bug * fix * remove logic * remove error * updates * updates * updates * updates * begin switching zeroForOneStrategy.ComputeSwapWithinBucketInGivenOut * switch remaining zero for one swap step and add rounding comments * begin switching cur sqrt price to big dec in swaps * try adding CalculateSqrtPriceToTickBigDec * one for zero out given in tests * fix one for zero tests * update one for zero tests * in-progress test * updates * fix TestComputeSwapStepOutGivenIn_ZeroForOne * fix TestComputeSwapStepInGivenOut_ZeroForOne * convert current sqrt price to BigDec and resolve syntax errors * updates * clean up * clean ups * clean ups * fix TestComputeSwapState_Inverse * comment * updates * clean ups * remove unused function * remove unused GetNextSqrtPriceFromAmount1OutRoundingDown * switch GetNextSqrtPriceFromAmount0InRoundingUp to big dec * fully convert GetNextSqrtPriceFromAmount0OutRoundingUp to big dec * clean up math tests more * more math test clean up * fully convert calc methods to big dec * fix model package tests * fix TestAddToPosition * fix TestCalculateSpotPrice * fix TestSingleSidedAddToPosition * fix TestUninitializePool * go mod update * big dec comparison correction and prints * fix equality issues * convert tests to big dec * fix a few swap tests * small e2e fix * more swap test fixes * updates * fix another test * please get fixed * fix all out given in swap tests * e2e * fix all one for zero in given out * I can fix you * clean ups * MulRoundUp test * test SDKDecRoundUp * clean up * revert launch.json * comment * add zero for one swap strategy ULP tests * typo * remove errors * remove prints --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> * refactor/security: prevent same execution price exploit within the same ULP (#5693) * repro infinite loop in swap logic * precision increase solution to infinite loop bug * fix * remove logic * remove error * updates * updates * updates * updates * begin switching zeroForOneStrategy.ComputeSwapWithinBucketInGivenOut * switch remaining zero for one swap step and add rounding comments * begin switching cur sqrt price to big dec in swaps * try adding CalculateSqrtPriceToTickBigDec * one for zero out given in tests * fix one for zero tests * update one for zero tests * in-progress test * updates * fix TestComputeSwapStepOutGivenIn_ZeroForOne * fix TestComputeSwapStepInGivenOut_ZeroForOne * convert current sqrt price to BigDec and resolve syntax errors * updates * clean up * clean ups * clean ups * fix TestComputeSwapState_Inverse * comment * updates * clean ups * remove unused function * remove unused GetNextSqrtPriceFromAmount1OutRoundingDown * switch GetNextSqrtPriceFromAmount0InRoundingUp to big dec * fully convert GetNextSqrtPriceFromAmount0OutRoundingUp to big dec * clean up math tests more * more math test clean up * fully convert calc methods to big dec * fix model package tests * fix TestAddToPosition * fix TestCalculateSpotPrice * fix TestSingleSidedAddToPosition * fix TestUninitializePool * go mod update * big dec comparison correction and prints * fix equality issues * convert tests to big dec * fix a few swap tests * small e2e fix * more swap test fixes * updates * fix another test * please get fixed * fix all out given in swap tests * e2e * fix all one for zero in given out * I can fix you * clean ups * MulRoundUp test * test SDKDecRoundUp * clean up * revert launch.json * comment * refactor/security: prevent same execution price exploit within the same ULP * add zero for one swap strategy ULP tests * typo * remove errors * remove prints * typos * typo --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> * fix(CL): negative amount out consumed (#5695) * repro infinite loop in swap logic * precision increase solution to infinite loop bug * fix * remove logic * remove error * updates * updates * updates * updates * begin switching zeroForOneStrategy.ComputeSwapWithinBucketInGivenOut * switch remaining zero for one swap step and add rounding comments * begin switching cur sqrt price to big dec in swaps * try adding CalculateSqrtPriceToTickBigDec * one for zero out given in tests * fix one for zero tests * update one for zero tests * in-progress test * updates * fix TestComputeSwapStepOutGivenIn_ZeroForOne * fix TestComputeSwapStepInGivenOut_ZeroForOne * convert current sqrt price to BigDec and resolve syntax errors * updates * clean up * clean ups * clean ups * fix TestComputeSwapState_Inverse * comment * updates * clean ups * remove unused function * remove unused GetNextSqrtPriceFromAmount1OutRoundingDown * switch GetNextSqrtPriceFromAmount0InRoundingUp to big dec * fully convert GetNextSqrtPriceFromAmount0OutRoundingUp to big dec * clean up math tests more * more math test clean up * fully convert calc methods to big dec * fix model package tests * fix TestAddToPosition * fix TestCalculateSpotPrice * fix TestSingleSidedAddToPosition * fix TestUninitializePool * go mod update * big dec comparison correction and prints * fix equality issues * convert tests to big dec * fix a few swap tests * small e2e fix * more swap test fixes * updates * fix another test * please get fixed * fix all out given in swap tests * e2e * fix all one for zero in given out * I can fix you * clean ups * MulRoundUp test * test SDKDecRoundUp * clean up * revert launch.json * comment * refactor/security: prevent same execution price exploit within the same ULP * repro for negative amount consumed * updates * core fix, tests and code comments * add zero for one swap strategy ULP tests * fix zero for one test * typo * remove errors * remove prints * typos * typo * remove obsolete comment --------- Co-authored-by: alpo <yukseloglua@berkeley.edu> * fix: cw pool import export genesis (#5696) * cw pool genesis fix and change liq query * keep liquidity check linear * set codec * set wasm keeper per pool and add genesis test * remove prints and dead code * revert set pool * add Roman's fix * add GetPoolsWithWasmKeeper * use get pools * fix: cw pool import export genesis (#5696) * cw pool genesis fix and change liq query * keep liquidity check linear * set codec * set wasm keeper per pool and add genesis test * remove prints and dead code * revert set pool * add Roman's fix * add GetPoolsWithWasmKeeper * use get pools (cherry picked from commit d0a851b56d360a6340c8d608c9ccdfec1b2c9610) # Conflicts: # x/superfluid/keeper/migrate.go * chore: update sdk fork dep (#5716) * fix merge issue * Revert "Merge branch 'main' into mergify/bp/v16.x/pr-5696" This reverts commit 1e6194bea1a42ef135d3aa4257c056c0fda33984, reversing changes made to 39412e895d440e158dc51da7e246167b6ccf2cf3. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Roman <roman@osmosis.team> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: alpo <yukseloglua@berkeley.edu> Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> Co-authored-by: Nicolas Lara <nicolaslara@gmail.com> Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com> Co-authored-by: nil <51265852+niilptr@users.noreply.github.com> Co-authored-by: alessandromazza <alessandro98.mazza@gmail.com> Co-authored-by: niilptr <niilptr@users.noreply.github.com> Co-authored-by: Jon Ator <jonathanator0@gmail.com> Co-authored-by: Sishir Giri <sis1001@berkeley.edu> Co-authored-by: Adam Tucker <adamleetucker@outlook.com> * chore: bump sdk with state breaking barberry fix (#5721) (#5722) (cherry picked from commit e1772bd92a01b0b0ed5ceb670d8c217261d57640) Co-authored-by: Roman <roman@osmosis.team> * chore: update in-repo dep tags to be from release branch (#5729) * fix: accept neg lock ID for migration (#5727) (#5730) * accept 0 or neg lock ID * add a comment explain neg number (cherry picked from commit 294f3c0ab3f246f5d0f8e5ea8dce8536c47529f3) Co-authored-by: Adam Tucker <adam@osmosis.team> * feat: e2e parallel (#5598) (#5739) * e2e parallel * dont add node to config * go mod * temp node * temp node config * remove mutex * add mutex to everything * remove mutex from upgrade.go * remove pointer * move node placement * more mutex * test * test * dont use config for txs * use go routines and less blocks for vote * sequence nums amoung other fixes * remove no longer needed mutex * remove old sendIBC * reintroduce secondary sendibc func * add back in balance check * mod check for seq num * more cleaning * more speed * parallel 4 to 8 check * parallel to 3 * inc goroutine procs * back to 4 procs and reorder tests * change epoch to day from week * updates for new upgrade handler * final speedup * add todos * Minor de-duplication of logic in E2E (#5690) * minor dedup * more minor de-duplication continued * Update tests/e2e/helpers_e2e_test.go Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * Update tests/e2e/e2e_test.go Co-authored-by: Roman <roman@osmosis.team> * Update tests/e2e/e2e_test.go Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * rename * split ibc tests back up * add code comment --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Roman <roman@osmosis.team> (cherry picked from commit 8e2b5b57ee68ffa3e82c2dd14cffc883d369d6fb) Co-authored-by: Adam Tucker <adam@osmosis.team> * fix: e2e short (#5746) (#5748) * e2e short fix * add sleep (cherry picked from commit 2e06b7ba485e73a36168ff5e47d63e8f249c9f7e) Co-authored-by: Adam Tucker <adam@osmosis.team> * [CL][tests]: Add all remaining intended test vectors from original tracking issue (backport #5655) (#5743) * [CL][tests]: Add all remaining intended test vectors from original tracking issue (#5655) * add all remaining test vectors from original issue * clean up changes (cherry picked from commit 39a64b99cb583a2b69f4864e4ef4695947e14ec4) # Conflicts: # x/concentrated-liquidity/range_test.go * fix merge conflict --------- Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> Co-authored-by: Adam Tucker <adamleetucker@outlook.com> * [E2E] Add ParseEvent function (#5710) (#5744) Closes: #5601 ## What is the purpose of the change Create a helper ParseEvent function to minimize duplication. ## Testing and Verifying This change is already covered by existing tests. ## Documentation and Release Note - [ ] Does this pull request introduce a new feature or user-facing behavior changes? - [ ] Changelog entry added to `Unreleased` section of `CHANGELOG.md`? Where is the change documented? - [ ] Specification (`x/{module}/README.md`) - [ ] Osmosis documentation site - [ ] Code comments? - [ ] N/A (cherry picked from commit f7c5214c3790709ae524f2cc0e7891ae1905f3e6) Co-authored-by: Pham Anh Minh <93236465+phamminh0811@users.noreply.github.com> * fix: temp cl swap bug solution (#5754) (#5756) * temp swap bug fix * add custom error (cherry picked from commit 71d882a186a06de694a278f22d168916070518a6) Co-authored-by: Adam Tucker <adam@osmosis.team> * Add e2e initialization workflow (#5732) (#5758) (cherry picked from commit 8da63bb520e2207ab9a91da402ca43833e9b4867) Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> * feat: lock existing position and sfs (#5745) (#5760) * lock existing sf position * add msg server test * add test * Update x/superfluid/keeper/stake.go Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> * Update x/superfluid/keeper/stake_test.go Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> * add withdraw attempt after locking * add non owner test case * check delegated amount * add cli --------- Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> (cherry picked from commit a8179cbae9ff137658be1f34e8883d016e7c4cd9) Co-authored-by: Adam Tucker <adam@osmosis.team> * Docs/Fix: Update Broken Links (#5728) (#5759) * Update broken links * Remove TODOs and add lycheeignore for outdated, historical links (cherry picked from commit 8e1d5b0be9ca5014d852588ad486ea30f657831b) Co-authored-by: Fabian Gonzalez <fabiangonz98@gmail.com> * test: parallel fuzz swap test suite (#5755) (#5757) * updates * updates * swap to next initialized tick * parallelizm * updates * restore tests * clean up * UX updates * fix test * fix tests * add fatalError concept --------- Co-authored-by: Adam Tucker <adamleetucker@outlook.com> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> (cherry picked from commit c99d7c2396ac3f6dab171b949821a91f634320f4) Co-authored-by: Roman <roman@osmosis.team> * fix tx fees cli cmd (#5763) (#5765) (cherry picked from commit e1e60c2996aeaab92cf7ccda09f057be0812f27e) Co-authored-by: Adam Tucker <adam@osmosis.team> * [fix] Fix no-lock gauge CLI (#5753) (#5766) * added cli fix * Update x/incentives/client/cli/tx.go * import fix --------- Co-authored-by: Roman <roman@osmosis.team> (cherry picked from commit 1a39c3329317528e3fb866b2b8c7d6ae7694c2b7) Co-authored-by: Sishir Giri <sis1001@berkeley.edu> * test(CL): add swaps in given out to fuzz suite and fix deterministic randomness (#5764) (#5767) * test(CL): add swaps in given out to fuzz suite and fix deterministic randomness * updates * comments * Update x/concentrated-liquidity/fuzz_test.go Co-authored-by: Adam Tucker <adam@osmosis.team> * updates --------- Co-authored-by: Adam Tucker <adam@osmosis.team> (cherry picked from commit 80e67d6f326d8ac8639fea38364d35a66961604f) Co-authored-by: Roman <roman@osmosis.team> * Fix generate docs CI (#5642) (#5762) * Fix generate docs ci * Bump dependency * use older version dep * Try updating partial deps (cherry picked from commit 5b176f81f65bc4319ffd9b1384f4adb000d64d55) # Conflicts: # .github/workflows/generate-docs.yml Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> * tests(CL): improve fuzz suite with many random LPs and removing positions (#5769) (#5771) * test(CL): withdraw positions and random accounts in fuzzer * add random accounts * reset logs * claim reward invariant (cherry picked from commit 48a3854785784da9f595c60f3f26f060e2874ffa) Co-authored-by: Roman <roman@osmosis.team> * chore(deps): bump actions/setup-go from 2 to 4 (#5770) (#5772) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2...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> (cherry picked from commit 9075fe67d9b664a9a3f7aca074064b49f9c5ee20) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add Business Source License from @NickPullman (#5773) (#5774) * Add Business Source License from @NickPullman * Fix markdown lint (cherry picked from commit 648d402dfbe5c62de19244c8bca9bc69e02d0b7e) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * Remove Pools and LiquidityNetInDirection queries from wasmbinding list (#5775) (#5776) (cherry picked from commit 309e05363211273d418d6dc124f34c05e6dd1fd6) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * fix: CL swap fuzz error (#5778) (#5780) (cherry picked from commit d80e16cd5eebb16eb01c151dc4f3d03b783faca4) Co-authored-by: Roman <roman@osmosis.team> * fix unbonding error check (#5779) (#5781) (cherry picked from commit 7e168bd62680cd0951dcce219fbc966f3aee9d2c) Co-authored-by: Adam Tucker <adam@osmosis.team> * Add debug command for conversion to proto marshalled bytes (#5750) (#5777) * Add command * Add chagnelog (cherry picked from commit 0bdbca2484ab7d8644d5cf3932190137a0593037) Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> Co-authored-by: Adam Tucker <adamleetucker@outlook.com> * reafactor(CL): tick spacing 100 upgrade handler (#5782) (#5783) (cherry picked from commit d2a4b16d8c7f49d14ba37605c071d8f782e69582) Co-authored-by: Roman <roman@osmosis.team> * chore: add v16 binary json (#5791) (#5792) * add binary json * Update v16_binaries.json (cherry picked from commit 072dc717e58f79a3f68940593cd4ab6fa86d17c1) Co-authored-by: Adam Tucker <adam@osmosis.team> * chore: v16 upgrade guide (#5793) (#5794) (cherry picked from commit 65117431f2cad855fcb9f6f20202a0b2674156c8) Co-authored-by: Roman <roman@osmosis.team> * chore: add missing cli queries CL (backport #5796) (#5797) * chore: add missing cli queries CL (#5796) * adds liq net in direction cli * update osmoutils * add pool rewards and tick accum cli q * add query cmd (cherry picked from commit 13f36000a0320b34ac71ae905cc7e75cf45b8e6f) # Conflicts: # go.mod # go.sum * go get osmoutils * update go sum --------- Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Adam Tucker <adamleetucker@outlook.com> * update pool uptime accum to now in query (#5799) (#5800) (cherry picked from commit f19298509a52ca7a067c86f8d8201aecfc12deaf) Co-authored-by: Adam Tucker <adam@osmosis.team> * fix cl readme typo (#5816) (#5818) (cherry picked from commit ebbc9faa13da4853aba58d08d6f54e21dbf43bba) Co-authored-by: LaurensKubat <32776056+LaurensKubat@users.noreply.github.com> * Update README.md (#5814) (#5817) (cherry picked from commit 340290756ae6cc6788094086578ff85835dd4727) Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> * comments on deprecateds in WhitelistedQuery wasmbinding (#5751) (#5811) Closes: #5735 ## What is the purpose of the change > Add a description of the overall background and high level changes that this PR introduces *(E.g.: This pull request improves documentation of area A by adding ....* Most of the mentioned endpoint already have a replacement.Comment on what are deprecated and their successors ## Testing and Verifying *(Please pick one of the following options)* - [x] This change is a trivial rework / code cleanup without any test coverage. *(or)* This change is already covered by existing tests, such as *(please describe tests)*. *(or)* This change added tests and can be verified as follows: *(example:)* - *Added unit test that validates ...* - *Added integration tests for end-to-end deployment with ...* - *Extended integration test for ...* - *Manually verified the change by ...* ## Documentation and Release Note - [ ] Does this pull request introduce a new feature or user-facing behavior changes? - [ ] Changelog entry added to `Unreleased` section of `CHANGELOG.md`? Where is the change documented? - [ ] Specification (`x/{module}/README.md`) - [ ] Osmosis documentation site - [ ] Code comments? - [ ] N/A (cherry picked from commit 4c7238029997d7d4de1052b0a42f07da0b1dae85) Co-authored-by: Đỗ Việt Hoàng <hoangdv2429@gmail.com> * Revert "feat: lock existing position and sfs (#5745) (#5760)" (#5821) This reverts commit 9968df44bdc3654ab771124446d005c14120c432. * chore: cosmovisor hashes and v16.1.0 tag updates (#5824) (#5826) (cherry picked from commit feabfe934ec8906bc509cd6a8f848443d494ea12) Co-authored-by: Roman <roman@osmosis.team> * chore: set correct binary name for v16 (#5828) (#5829) (cherry picked from commit bf34c0934210054e8d49e112b70d67950dca5faf) Co-authored-by: Artur Troian <troian.ap@gmail.com> * Fix the superfluid query (backport #5831) (#5832) * Fix the superfluid query (#5831) * Fix the superfluid query * Changelog (cherry picked from commit 13c887465f1d66f9082685a5b9032492030c72dc) * Update check-state-compatibility.yml --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> * Delete printlns that made it to prod (#5835) (#5836) * Delete printlns that made it to prod * add changelog (cherry picked from commit 37b9bbe00e26504d808f99d201e73a11d1757fc7) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * [Chore] Add amino name for tx msgs (backport #5784) (#5787) * [Chore] Add amino name for tx msgs (#5784) * updated amino name * updated (cherry picked from commit 1e3149f05a08c5af8d0df9b0392bb554dfc9bc78) * cleanup * more cleanup * fixed conflicts * rebased * Delete atom --------- Co-authored-by: Sishir Giri <sis1001@berkeley.edu> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * Make GetSuperfluidLockByLockId more cleary indicate if its found or not (#5833) (#5838) (cherry picked from commit b7fe65f330142102f81ba681c22097aac0f1571c) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * chore: increase initial amounts for one localosmosis acc (#5798) (#5844) (cherry picked from commit 087ff933fe1b171d4dc41e0f2d5e4606a50b74f6) Co-authored-by: Roman <roman@osmosis.team> * Adding estimate query based on price impact * Fixing bugs in CalculateSpotPrice and EstimateTrade * Fixing query and adding tests * Running proto-gen * Fixing test issues * Adding docs * Generated protofile changes * adding query.yml entry * Adding PR fixes and changing query * fixing null pointer bug * Removing comment * PR fixes * Reverting unwanted PR * Removing leading lines * Update docs * Updating changelog * Pr fixes, small refactoring and doc updates * Fixing proto file * Adding PR fixes, refactoring code from query to router. * Adding comment to abs * Generated protofile changes * Adding comment to abs * Generated protofile changes * Running proto and lintin * Running lint * Running goimports * updating query proto wrap --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com> Co-authored-by: Roman <roman@osmosis.team> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> Co-authored-by: Nicolas Lara <nicolaslara@gmail.com> Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com> Co-authored-by: Jon Ator <jonathanator0@gmail.com> Co-authored-by: Sishir Giri <sis1001@berkeley.edu> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: alpo <yukseloglua@berkeley.edu> Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com> Co-authored-by: nil <51265852+niilptr@users.noreply.github.com> Co-authored-by: alessandromazza <alessandro98.mazza@gmail.com> Co-authored-by: niilptr <niilptr@users.noreply.github.com> Co-authored-by: Adam Tucker <adamleetucker@outlook.com> Co-authored-by: Pham Anh Minh <93236465+phamminh0811@users.noreply.github.com> Co-authored-by: Fabian Gonzalez <fabiangonz98@gmail.com> Co-authored-by: LaurensKubat <32776056+LaurensKubat@users.noreply.github.com> Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> Co-authored-by: Đỗ Việt Hoàng <hoangdv2429@gmail.com> Co-authored-by: Artur Troian <troian.ap@gmail.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: migueldingli1997 <migueldingli97@gmail.com>
1 parent 4270d68 commit d387e22

File tree

18 files changed

+2223
-117
lines changed

18 files changed

+2223
-117
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Fixes mainnet bugs w/ incorrect accumulation sumtrees, and CL handling for a bal
154154

155155
### API breaks
156156

157+
* [#6167](https://github.com/osmosis-labs/osmosis/pull/6167) add EstimateTradeBasedOnPriceImpact query to x/poolmanager.
157158
* [#6238](https://github.com/osmosis-labs/osmosis/pull/6238) switch osmomath to sdkmath types and rename BigDec constructors to contain "Big" in the name.
158159
* Note: with the update, the Dec and Int do not get initialized to zero values
159160
by default in proto marhaling/unmarshaling. Instead, they get set to nil values.

client/docs/static/openapi/index.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

client/docs/static/openapi/openapi.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4198,6 +4198,7 @@ paths:
41984198
- ByDuration
41994199
- ByTime
42004200
- NoLock
4201+
- ByGroup
42014202
default: ByDuration
42024203
description: >-
42034204
LockQueryType defines the type of the lock query that can
@@ -4447,6 +4448,7 @@ paths:
44474448
- ByDuration
44484449
- ByTime
44494450
- NoLock
4451+
- ByGroup
44504452
default: ByDuration
44514453
description: >-
44524454
LockQueryType defines the type of the lock query that can
@@ -4700,6 +4702,7 @@ paths:
47004702
- ByDuration
47014703
- ByTime
47024704
- NoLock
4705+
- ByGroup
47034706
default: ByDuration
47044707
description: >-
47054708
LockQueryType defines the type of the lock query that can
@@ -4874,6 +4877,7 @@ paths:
48744877
- ByDuration
48754878
- ByTime
48764879
- NoLock
4880+
- ByGroup
48774881
default: ByDuration
48784882
description: >-
48794883
LockQueryType defines the type of the lock query that can
@@ -5313,6 +5317,7 @@ paths:
53135317
- ByDuration
53145318
- ByTime
53155319
- NoLock
5320+
- ByGroup
53165321
default: ByDuration
53175322
description: >-
53185323
LockQueryType defines the type of the lock query that can
@@ -5565,6 +5570,7 @@ paths:
55655570
- ByDuration
55665571
- ByTime
55675572
- NoLock
5573+
- ByGroup
55685574
default: ByDuration
55695575
description: >-
55705576
LockQueryType defines the type of the lock query that can
@@ -8052,6 +8058,7 @@ paths:
80528058
- ByDuration
80538059
- ByTime
80548060
- NoLock
8061+
- ByGroup
80558062
default: ByDuration
80568063
description: >-
80578064
LockQueryType defines the type of the lock query that can
@@ -8373,6 +8380,7 @@ paths:
83738380
- Query
83748381
"/osmosis/superfluid/v1beta1/account_delegated_cl_positions/{delegator_address}":
83758382
get:
8383+
summary: Returns all of a user's full range CL positions that are superfluid staked.
83768384
operationId: UserConcentratedSuperfluidPositionsDelegated
83778385
responses:
83788386
"200":
@@ -32673,6 +32681,7 @@ components:
3267332681
- ByDuration
3267432682
- ByTime
3267532683
- NoLock
32684+
- ByGroup
3267632685
default: ByDuration
3267732686
description: |-
3267832687
LockQueryType defines the type of the lock query that can
@@ -32826,6 +32835,7 @@ components:
3282632835
- ByDuration
3282732836
- ByTime
3282832837
- NoLock
32838+
- ByGroup
3282932839
default: ByDuration
3283032840
description: |-
3283132841
LockQueryType defines the type of the lock query that can
@@ -32974,6 +32984,7 @@ components:
3297432984
- ByDuration
3297532985
- ByTime
3297632986
- NoLock
32987+
- ByGroup
3297732988
default: ByDuration
3297832989
description: |-
3297932990
LockQueryType defines the type of the lock query that can
@@ -33099,6 +33110,7 @@ components:
3309933110
- ByDuration
3310033111
- ByTime
3310133112
- NoLock
33113+
- ByGroup
3310233114
default: ByDuration
3310333115
description: |-
3310433116
LockQueryType defines the type of the lock query that can
@@ -33227,6 +33239,7 @@ components:
3322733239
- ByDuration
3322833240
- ByTime
3322933241
- NoLock
33242+
- ByGroup
3323033243
default: ByDuration
3323133244
description: |-
3323233245
LockQueryType defines the type of the lock query that can
@@ -33430,6 +33443,7 @@ components:
3343033443
- ByDuration
3343133444
- ByTime
3343233445
- NoLock
33446+
- ByGroup
3343333447
default: ByDuration
3343433448
description: |-
3343533449
LockQueryType defines the type of the lock query that can
@@ -33583,6 +33597,7 @@ components:
3358333597
- ByDuration
3358433598
- ByTime
3358533599
- NoLock
33600+
- ByGroup
3358633601
default: ByDuration
3358733602
description: |-
3358833603
LockQueryType defines the type of the lock query that can
@@ -33705,6 +33720,7 @@ components:
3370533720
- ByDuration
3370633721
- ByTime
3370733722
- NoLock
33723+
- ByGroup
3370833724
default: ByDuration
3370933725
description: |-
3371033726
LockQueryType defines the type of the lock query that can
@@ -33719,6 +33735,7 @@ components:
3371933735
- ByDuration
3372033736
- ByTime
3372133737
- NoLock
33738+
- ByGroup
3372233739
default: ByDuration
3372333740
description: |-
3372433741
LockQueryType defines the type of the lock query that can
@@ -35036,6 +35053,7 @@ components:
3503635053
- ByDuration
3503735054
- ByTime
3503835055
- NoLock
35056+
- ByGroup
3503935057
default: ByDuration
3504035058
description: |-
3504135059
LockQueryType defines the type of the lock query that can

client/docs/static/swagger/swagger.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4557,6 +4557,7 @@ paths:
45574557
- ByDuration
45584558
- ByTime
45594559
- NoLock
4560+
- ByGroup
45604561
default: ByDuration
45614562
description: >-
45624563
LockQueryType defines the type of the lock query
@@ -4833,6 +4834,7 @@ paths:
48334834
- ByDuration
48344835
- ByTime
48354836
- NoLock
4837+
- ByGroup
48364838
default: ByDuration
48374839
description: >-
48384840
LockQueryType defines the type of the lock query
@@ -5112,6 +5114,7 @@ paths:
51125114
- ByDuration
51135115
- ByTime
51145116
- NoLock
5117+
- ByGroup
51155118
default: ByDuration
51165119
description: >-
51175120
LockQueryType defines the type of the lock query that
@@ -5308,6 +5311,7 @@ paths:
53085311
- ByDuration
53095312
- ByTime
53105313
- NoLock
5314+
- ByGroup
53115315
default: ByDuration
53125316
description: >-
53135317
LockQueryType defines the type of the lock query
@@ -5766,6 +5770,7 @@ paths:
57665770
- ByDuration
57675771
- ByTime
57685772
- NoLock
5773+
- ByGroup
57695774
default: ByDuration
57705775
description: >-
57715776
LockQueryType defines the type of the lock query
@@ -6046,6 +6051,7 @@ paths:
60466051
- ByDuration
60476052
- ByTime
60486053
- NoLock
6054+
- ByGroup
60496055
default: ByDuration
60506056
description: >-
60516057
LockQueryType defines the type of the lock query
@@ -8638,6 +8644,7 @@ paths:
86388644
- ByDuration
86398645
- ByTime
86408646
- NoLock
8647+
- ByGroup
86418648
default: ByDuration
86428649
description: >-
86438650
LockQueryType defines the type of the lock query
@@ -8966,6 +8973,9 @@ paths:
89668973
- Query
89678974
/osmosis/superfluid/v1beta1/account_delegated_cl_positions/{delegator_address}:
89688975
get:
8976+
summary: >-
8977+
Returns all of a user's full range CL positions that are superfluid
8978+
staked.
89698979
operationId: UserConcentratedSuperfluidPositionsDelegated
89708980
responses:
89718981
'200':
@@ -35434,6 +35444,7 @@ definitions:
3543435444
- ByDuration
3543535445
- ByTime
3543635446
- NoLock
35447+
- ByGroup
3543735448
default: ByDuration
3543835449
description: |-
3543935450
LockQueryType defines the type of the lock query that can
@@ -35609,6 +35620,7 @@ definitions:
3560935620
- ByDuration
3561035621
- ByTime
3561135622
- NoLock
35623+
- ByGroup
3561235624
default: ByDuration
3561335625
description: |-
3561435626
LockQueryType defines the type of the lock query that can
@@ -35776,6 +35788,7 @@ definitions:
3577635788
- ByDuration
3577735789
- ByTime
3577835790
- NoLock
35791+
- ByGroup
3577935792
default: ByDuration
3578035793
description: |-
3578135794
LockQueryType defines the type of the lock query that can
@@ -35909,6 +35922,7 @@ definitions:
3590935922
- ByDuration
3591035923
- ByTime
3591135924
- NoLock
35925+
- ByGroup
3591235926
default: ByDuration
3591335927
description: |-
3591435928
LockQueryType defines the type of the lock query that can
@@ -36058,6 +36072,7 @@ definitions:
3605836072
- ByDuration
3605936073
- ByTime
3606036074
- NoLock
36075+
- ByGroup
3606136076
default: ByDuration
3606236077
description: |-
3606336078
LockQueryType defines the type of the lock query that can
@@ -36281,6 +36296,7 @@ definitions:
3628136296
- ByDuration
3628236297
- ByTime
3628336298
- NoLock
36299+
- ByGroup
3628436300
default: ByDuration
3628536301
description: |-
3628636302
LockQueryType defines the type of the lock query that can
@@ -36456,6 +36472,7 @@ definitions:
3645636472
- ByDuration
3645736473
- ByTime
3645836474
- NoLock
36475+
- ByGroup
3645936476
default: ByDuration
3646036477
description: |-
3646136478
LockQueryType defines the type of the lock query that can
@@ -36593,6 +36610,7 @@ definitions:
3659336610
- ByDuration
3659436611
- ByTime
3659536612
- NoLock
36613+
- ByGroup
3659636614
default: ByDuration
3659736615
description: |-
3659836616
LockQueryType defines the type of the lock query that can
@@ -36607,6 +36625,7 @@ definitions:
3660736625
- ByDuration
3660836626
- ByTime
3660936627
- NoLock
36628+
- ByGroup
3661036629
default: ByDuration
3661136630
description: |-
3661236631
LockQueryType defines the type of the lock query that can
@@ -38079,6 +38098,7 @@ definitions:
3807938098
- ByDuration
3808038099
- ByTime
3808138100
- NoLock
38101+
- ByGroup
3808238102
default: ByDuration
3808338103
description: |-
3808438104
LockQueryType defines the type of the lock query that can

client/docs/statik/statik.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/osmosisd/cmd/stargate-query.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ func GetStructAndFill(queryPath, module, structName string, structArguments ...s
407407
v.BaseAssetDenom = structArguments[1]
408408
v.QuoteAssetDenom = structArguments[2]
409409
return v, nil
410+
case "EstimateTradeBasedOnPriceImpactRequest":
411+
return nil, fmt.Errorf("swap route parsing not supported yet")
410412
}
411413
case "txfees":
412414
switch structName {

proto/osmosis/poolmanager/v1beta1/query.proto

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ service Query {
111111
option (google.api.http).get =
112112
"/osmosis/poolmanager/v1beta1/pools/total_liquidity";
113113
}
114+
115+
// EstimateTradeBasedOnPriceImpact returns an estimated trade based on price
116+
// impact, if a trade cannot be estimated a 0 input and 0 output would be
117+
// returned.
118+
rpc EstimateTradeBasedOnPriceImpact(EstimateTradeBasedOnPriceImpactRequest)
119+
returns (EstimateTradeBasedOnPriceImpactResponse) {
120+
option (google.api.http).get =
121+
"/osmosis/poolmanager/v1beta1/{pool_id}/estimate_trade";
122+
}
114123
}
115124

116125
//=============================== Params
@@ -250,4 +259,51 @@ message TotalLiquidityResponse {
250259
(gogoproto.moretags) = "yaml:\"liquidity\"",
251260
(gogoproto.nullable) = false
252261
];
253-
}
262+
}
263+
264+
//=============================== EstimateTradeBasedOnPriceImpact
265+
266+
// EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a
267+
// trade for Balancer/StableSwap/Concentrated liquidity pool types based on the
268+
// given parameters.
269+
message EstimateTradeBasedOnPriceImpactRequest {
270+
// from_coin is the total amount of tokens that the user wants to sell.
271+
cosmos.base.v1beta1.Coin from_coin = 1 [ (gogoproto.nullable) = false ];
272+
273+
// to_coin_denom is the denom identifier of the token that the user wants to
274+
// buy.
275+
string to_coin_denom = 2;
276+
277+
// pool_id is the identifier of the liquidity pool that the trade will occur
278+
// on.
279+
uint64 pool_id = 3;
280+
281+
// max_price_impact is the maximum percentage that the user is willing
282+
// to affect the price of the liquidity pool.
283+
string max_price_impact = 4 [
284+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
285+
(gogoproto.nullable) = false
286+
];
287+
288+
// external_price is an optional external price that the user can enter.
289+
// It adjusts the MaxPriceImpact as the SpotPrice of a pool can be changed at
290+
// any time.
291+
string external_price = 5 [
292+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
293+
(gogoproto.nullable) = false
294+
];
295+
}
296+
297+
// EstimateTradeBasedOnPriceImpactResponse represents the response data
298+
// for an estimated trade based on price impact. If a trade fails to be
299+
// estimated the response would be 0,0 for input_coin and output_coin and will
300+
// not error.
301+
message EstimateTradeBasedOnPriceImpactResponse {
302+
// input_coin is the actual input amount that would be tradeable
303+
// under the specified price impact.
304+
cosmos.base.v1beta1.Coin input_coin = 1 [ (gogoproto.nullable) = false ];
305+
306+
// output_coin is the amount of tokens of the ToCoinDenom type
307+
// that will be received for the actual InputCoin trade.
308+
cosmos.base.v1beta1.Coin output_coin = 2 [ (gogoproto.nullable) = false ];
309+
}

proto/osmosis/poolmanager/v1beta1/query.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,9 @@ queries:
7272
query_func: "k.TotalLiquidity"
7373
cli:
7474
cmd: "TotalLiquidity"
75+
EstimateTradeBasedOnPriceImpact:
76+
proto_wrapper:
77+
query_func: "k.EstimateTradeBasedOnPriceImpact"
78+
response: "*queryproto.EstimateTradeBasedOnPriceImpactResponse"
79+
cli:
80+
cmd: "EstimateTradeBasedOnPriceImpact"

0 commit comments

Comments
 (0)