-
Notifications
You must be signed in to change notification settings - Fork 609
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
[x/gamm][StableSwap] Add scaling factor #1277
Labels
T:task ⚙️
A task belongs to a story
Comments
ValarDragon
changed the title
Add a scaling factor parameter, where basically all arguments are scaled down by. Imagine stablecoin 1 is such that 10 stablecoin1 = $1, but stablecoin2 is such that 1000 stablecoin2 = $1. (Precision differences)We need an argument in the parameters, that each asset is individually divided by, in order to be comparableThis is how we feed sdk.Dec's to all internal functions
Stableswap: Add scaling factor
Apr 18, 2022
Merged
mergify bot
pushed a commit
that referenced
this issue
May 4, 2022
Closes: #1277 ## What is the purpose of the change This PR adds scaling factors to current stable swap implementation. For context on why scaling factors are needed: Suppose 1000 stablecoin1 equals 1 dollars, 100 stablecoin2 equals 2 dollars due to precision difference. Currently we compare each pool assets without considering these differences in precisions in `calcOutAmtGivenIn`, `calcInAmtGivenOut`, `SpotPrice`. This PR adds a field of scaling factors for each pool asset so that when internally calculating in `amm.go`, we compare two different assets upon same precision points. We do this by feeding the internal functions assets / scaling factors. ## Brief change log - Adds scaling factor to stableswap *(for example:)* - *The metadata is stored in the blob store on job creation time as a persistent artifact* - *Deployments RPC transmits only the blob storage reference* - *Daemons retrieve the RPC data from the blob cache* ## Testing and Verifying This change is a trivial rework / code cleanup without any test coverage. ## Documentation and Release Note - Does this pull request introduce a new feature or user-facing behavior changes? yes - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no - How is the feature or change documented? not applicable
Repository owner
moved this from Needs Review 🔍
to Done ✅
in Osmosis Chain Development
May 4, 2022
czarcas7ic
pushed a commit
that referenced
this issue
May 5, 2022
Closes: #1277 ## What is the purpose of the change This PR adds scaling factors to current stable swap implementation. For context on why scaling factors are needed: Suppose 1000 stablecoin1 equals 1 dollars, 100 stablecoin2 equals 2 dollars due to precision difference. Currently we compare each pool assets without considering these differences in precisions in `calcOutAmtGivenIn`, `calcInAmtGivenOut`, `SpotPrice`. This PR adds a field of scaling factors for each pool asset so that when internally calculating in `amm.go`, we compare two different assets upon same precision points. We do this by feeding the internal functions assets / scaling factors. ## Brief change log - Adds scaling factor to stableswap *(for example:)* - *The metadata is stored in the blob store on job creation time as a persistent artifact* - *Deployments RPC transmits only the blob storage reference* - *Daemons retrieve the RPC data from the blob cache* ## Testing and Verifying This change is a trivial rework / code cleanup without any test coverage. ## Documentation and Release Note - Does this pull request introduce a new feature or user-facing behavior changes? yes - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no - How is the feature or change documented? not applicable
czarcas7ic
added a commit
that referenced
this issue
May 5, 2022
* upgrade init * add voting period to init image * upgrade mvp * move upgrade to setup * permission fix * github permissions * delete to readd * readd * remove chmod * permissions attempt * permission change * clean up * remove init docker image creation * test yml * re add git diff * revert dockerfile * final github ci test * revert * initial code review changes * Apply suggestions from code review Co-authored-by: Roman <roman@osmosis.team> * code review * simple code 0 check * Add scaling factors (#1354) Closes: #1277 ## What is the purpose of the change This PR adds scaling factors to current stable swap implementation. For context on why scaling factors are needed: Suppose 1000 stablecoin1 equals 1 dollars, 100 stablecoin2 equals 2 dollars due to precision difference. Currently we compare each pool assets without considering these differences in precisions in `calcOutAmtGivenIn`, `calcInAmtGivenOut`, `SpotPrice`. This PR adds a field of scaling factors for each pool asset so that when internally calculating in `amm.go`, we compare two different assets upon same precision points. We do this by feeding the internal functions assets / scaling factors. ## Brief change log - Adds scaling factor to stableswap *(for example:)* - *The metadata is stored in the blob store on job creation time as a persistent artifact* - *Deployments RPC transmits only the blob storage reference* - *Daemons retrieve the RPC data from the blob cache* ## Testing and Verifying This change is a trivial rework / code cleanup without any test coverage. ## Documentation and Release Note - Does this pull request introduce a new feature or user-facing behavior changes? yes - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no - How is the feature or change documented? not applicable * address roman comments Co-authored-by: Roman <roman@osmosis.team> Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
p0mvn
changed the title
Stableswap: Add scaling factor
[x/gamm] Stableswap: Add scaling factor
May 9, 2022
p0mvn
changed the title
[x/gamm] Stableswap: Add scaling factor
[x/gamm][StableSwap] Add scaling factor
May 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: