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 unit test for splitting swap to 100 times to check out amount difference #165

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

jelysn
Copy link
Contributor

@jelysn jelysn commented Aug 7, 2023

No description provided.

Copy link
Contributor

@kenta-elys kenta-elys left a comment

Choose a reason for hiding this comment

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

@jelysn
I could see 100x swap gave 100 less output than 1 time swap. Have we applied any extra penalty in oracle swap logic than slippage and swap fee?
And is it always 100 less output in such testing scenario?
You've set 0 swap fee. Ideally, 0 swap fee will result the same output for the same input amount even if it is 100x swap or 1x swap.

@cosmic-vagabond
Copy link
Contributor

adding here @jelysn comment from slack to answer @kenta-elys ’s concern:

It’s not extra penalty, it’s decimal cut result.

We will need to refactor dynamic weighted pool FYI based on discussion with Dream, and I think it would be good to merge this unit test PR for now, since this test case is required, the test result will be changed after refactoring.

@cosmic-vagabond cosmic-vagabond merged commit 292c726 into main Aug 7, 2023
1 check passed
@cosmic-vagabond cosmic-vagabond deleted the feat/unit_test_split_swap_to_100 branch August 7, 2023 08:18
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.

3 participants