galacticcouncil / galacticcouncil/hydration-node

Bug: calculate_cap_difference() in the Omnipool math package is wrong

Open
#800 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
208
Forks
109
Avg merge
6d 3h
Merged PRs (30d)
3

Description

https://github.com/galacticcouncil/HydraDX-node/blob/ac9335f517f4919fb296b432ad0f6385f22d6a43/math/src/omnipool/math.rs#L457

Calculation is wrong, correct calculation is specified here, along with correct way to test:
https://www.notion.so/hydradx/Fixing-calculate_cap_difference-4d6bf0a1df074d9e8fe4dbbf2d0458b8

If the function is only used in UI, it may be moved to SDK.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.