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

Cw20 bonding curve #185

Merged
merged 26 commits into from
Dec 21, 2020
Merged

Cw20 bonding curve #185

merged 26 commits into from
Dec 21, 2020

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Dec 15, 2020

Closes #5

  • Define curve trait
  • Implement Constant
  • Implement Linear
  • Implement Square Root
  • Import default cw20-base handlers
  • Add custom handlers for buy and sell/burn
  • Store DecimalPlaces in contract storage
  • Configure Curve in contract (storage? external argument?)
  • Test buy/sell functionality
  • Sanity check it works with cw20-base functionality (like supply and allowances)

There were some comments that various of these decimal math operations are very slow, let's benchmark them and we can use that to see if we do a follow-up optimization PR

Follow-Up PRs:

  • Benchmark Curves (native)
  • Test handler gas cost (singlepass vm integration tests) - also that there are no floats in these libs
  • Allow cw20 token as reserve currency (similar to Add cw20 support to token-weighted group #143)
  • Optional exit tax (part of reserve stays in contract) along with admin who can spend that

@ethanfrey
Copy link
Member Author

@orkunkl you can take a look at this if you want, especially the README, curves.rs and the handle_sell and handle_buy functions. Most of this is stubs now with TODOs and unimplemented!() but happy for any input you have from working with other bonding curve packages

@ethanfrey ethanfrey merged commit 9a38ad4 into master Dec 21, 2020
@ethanfrey ethanfrey deleted the cw20-bonding-curve branch December 21, 2020 19:09
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.

Build bonding curve with cw20-base
1 participant