Skip to content
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

Mutation bug in SimCurveCryptoPool #238

Closed
chanhosuh opened this issue Sep 8, 2023 · 0 comments · Fixed by #243
Closed

Mutation bug in SimCurveCryptoPool #238

chanhosuh opened this issue Sep 8, 2023 · 0 comments · Fixed by #243
Labels
bug Something isn't working
Milestone

Comments

@chanhosuh
Copy link
Member

Version Information

all versions

What's your issue about?

Please include information like:

SimCurveCryptoPool has a mutation bug in prepare_for_run:

self.last_prices = initial_prices
self.price_scale = initial_prices
self._price_oracle = initial_prices

Assigning the same object to these independent state variables will cause issues when one state variable is updated.

How can it be fixed?

self.last_prices = initial_prices.copy()
self.price_scale = initial_prices.copy()
self._price_oracle = initial_prices.copy()
@chanhosuh chanhosuh added the bug Something isn't working label Sep 8, 2023
@chanhosuh chanhosuh added this to the 0.5.0rc milestone Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant