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

Add prepare_for_run to SimPools #202

Merged
merged 4 commits into from
Aug 16, 2023
Merged

Add prepare_for_run to SimPools #202

merged 4 commits into from
Aug 16, 2023

Conversation

nagakingg
Copy link
Collaborator

@nagakingg nagakingg commented Aug 16, 2023

Description

  • Add prepare_for_run method to SimPool template
  • Call prepare_for_run before running sim in strategy template
  • Add prepare_for_run to SimCurveCryptoPool

SimCurveCryptoPool.prepare_for_run updates price_scale, _price_oracle, and last_prices to the first price of the price time-series. Balances are then adjusted to balance the pool's holdings while preserving xcp(D).

ToDo:

  • test SimCurveCryptoPool.prepare_for_run
  • recompute test data for v2 pools

Hygiene checklist

  • Changelog entry
  • Everything public has a Numpy-style docstring
    (modules, public functions, classes, and public methods)
  • Pylint score monotonically increased
  • Commit history is cleaned-up with minor changes squashed together
    and descriptive commit messages following Tim Pope's style

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@nagakingg nagakingg force-pushed the prepare-for-run branch 2 times, most recently from 27d4cfa to d0422ac Compare August 16, 2023 13:36
- Add prepare_for_run method to SimPool template
- Call prepare_for_run before running sim in strategy template
- Add prepare_for_run to SimCurveCryptoPool
Copy link
Member

@chanhosuh chanhosuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tests!

@chanhosuh chanhosuh added this to the Cryptopool Sims milestone Aug 16, 2023
@nagakingg nagakingg marked this pull request as ready for review August 16, 2023 15:23
@nagakingg nagakingg merged commit 413de17 into main Aug 16, 2023
3 checks passed
@chanhosuh chanhosuh deleted the prepare-for-run branch August 16, 2023 15:28
@github-actions
Copy link
Contributor

Coverage report

The coverage rate went from 73.47% to 73.44% ⬇️
The branch rate is 60%.

None of the new lines are part of the tested code. Therefore, there is no coverage data about them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants