osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

refactor/fix/test(sqs): pool liquidity pricing refactor & clean up

Open p0mvn opened this issue 9 months ago • 3 comments

Closes: #XXX

What is the purpose of the change

The goal of this work is to refactor and clean up pool liquidity pricing logic, making the abstraction consistently denominated in the single unit (USDC, descaled with precision). A related PR exists in sqs

This is also a pre-requisite towards the dynamic min liquidity pricing in SQS and pool liquidity pricing: https://github.com/osmosis-labs/sqs/pull/224

As a side benefit, the following issue was resolved, making the pool liquidity capitalization be consistently in a single denomination https://linear.app/osmosis/issue/DATA-48/understand-why-pool-tvl-has-become-scaled-updatetest-new-behavior

Additionally, the dependency on the asset list was removed from the node for no need.

Lastly, clean-ups of the convertPool function were achieved by encapsulating complex logic into separate functions for greater testability.

Testing and Verifying

  • Unit tests
  • Will test in stage after backporting to v25.x

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

p0mvn avatar May 20 '24 00:05 p0mvn