osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

gamm: Create tests to find the smallest and largest spot prices

Open ValarDragon opened this issue 3 years ago • 0 comments

Background

As part of implementing overflow handling for TWAP, we need to have a clear understanding of what is the full range of SpotPrices in the gamm module, and if we need to limit these. (e.g. by requiring the pool to always have at least 1000 base units of each coin)

Suggested Design

  • Using the Balancer equation try to get the smallest and large spot prices we can
  • See if theres limits on weights / token supplies we can do, to bound the maximum if its too precise.

Acceptance Criteria

  • [ ] Clear understanding of smallest and largest spot price
  • [ ] If largest = sdk.MaxDec, thinking of ways to reduce it. (e.g. min liquidity guaranteed after every action)

ValarDragon avatar Jul 23 '22 12:07 ValarDragon