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

osmomath(log/CL): implement and test natural logarithm, custom base logarithm and 1.0001 logarithm #3132

Closed
p0mvn opened this issue Oct 24, 2022 · 2 comments · Fixed by #3169
Assignees
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board T:task ⚙️ A task belongs to a story

Comments

@p0mvn
Copy link
Member

p0mvn commented Oct 24, 2022

Background

With log base 2 implemented in #2788, we should add more bases for logarithms.

Suggested Design

Natural logarithm

ln x = \frac{log_{2}{x}}{log_{2}{1.0001}}

  • estimate {log_{2}{e} in WolframAlpha (add link to the estimate)
  • hard code the estimate
  • create a method Ln that utilizes LogBase2 and hardcoded e value to solve the above

Base 1.0001

This is what we need for concentrated liquidity
$$ln x = \frac{log_{2}{x}}{log_{2}{1.0001}}$$

  • estimate {log_{1.0001}{x} in WolframAlpha (add link to the estimate)
  • hard code the estimate
  • create a method LogBaseHundredthBasisPoint that utilizes LogBase2 and hardcoded log_{1.0001}{x} value to solve the above

Custom Base

Implement LogCustomBase that utilizes similar idea to above

Acceptance Criteria

@p0mvn p0mvn added the F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board label Oct 24, 2022
@p0mvn p0mvn moved this to Needs Review 🔍 in Osmosis Chain Development Oct 24, 2022
@p0mvn p0mvn changed the title osmomath(log/CL): implement and test natural logarithm, custom base logarithm and 1.001 logarithm osmomath(log/CL): implement and test natural logarithm, custom base logarithm and 1.0001 logarithm Oct 24, 2022
@p0mvn p0mvn added the T:task ⚙️ A task belongs to a story label Oct 25, 2022
@pysel
Copy link
Member

pysel commented Oct 25, 2022

I would like to work on it

@p0mvn
Copy link
Member Author

p0mvn commented Oct 25, 2022 via email

Repository owner moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board T:task ⚙️ A task belongs to a story
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants