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

[CIP-38] Add Uniform Directional Clearing Prices test #97

Merged
merged 14 commits into from
Mar 18, 2024

Conversation

harisang
Copy link
Contributor

@harisang harisang commented Mar 8, 2024

This PR adds a check for the UDP rule, as introduced in CIP-38.

@harisang harisang requested a review from fhenneke March 8, 2024 17:25
@harisang
Copy link
Contributor Author

harisang commented Mar 8, 2024

There is a black complaint but i cannot reproduce it locally.

harisang and others added 4 commits March 8, 2024 19:27
- renamed token_pairs to directional_prices
- use min function to determine minimal exchange rate
- add info to log message, and also log for smaller deviations
- use Fractions to be compatible with backend code
@fhenneke
Copy link
Contributor

I tested the code with the two hashes 0x4c702f9a3e4593a16fed03229cb4d449a48eab5fb92030fc8ba596e78fef8d1c (a fair settlement) and 0x469ac0d0e430c67c94d26ae202e9e6710396a1968b1a6656be002eb4f2b7af65 (an unfair settlement). Those cases seem to handled correctly.

@fhenneke
Copy link
Contributor

I just realized that we might need to change the code later to correctly account for protocol fees. They need to be used to correct directional prices.

Since there is no way at the moment to get fee policies via the API, we should fix it later. Doing it for the launch tomorrow will not work in time.

@fhenneke fhenneke merged commit cebab1a into main Mar 18, 2024
4 checks passed
@fhenneke fhenneke deleted the uniform_directed_prices_test branch March 18, 2024 14:36
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants