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

Implement Baskets MsgServer #634

Closed
2 of 4 tasks
blushi opened this issue Nov 15, 2021 · 5 comments
Closed
2 of 4 tasks

Implement Baskets MsgServer #634

blushi opened this issue Nov 15, 2021 · 5 comments
Assignees
Labels
Scope: x/ecocredit Issues that update the x/ecocredit module

Comments

@blushi
Copy link
Member

blushi commented Nov 15, 2021

Summary

Based on the msg service definition from #610 and initial work from Lisbon sprint #618, add MsgServer implementation for baskets in x/ecocredit

Adding unit tests on the MsgServer will also be included in this PR.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@blushi blushi added the Scope: x/ecocredit Issues that update the x/ecocredit module label Nov 15, 2021
@technicallyty technicallyty self-assigned this Nov 17, 2021
@clevinson clevinson added this to the v3.0 - Llangorse Upgrade milestone Nov 18, 2021
@clevinson
Copy link
Member

@technicallyty We've had several product conversations over the past few days this week that may impact the work you're doing on this issue.

For now, let's keep the MsgServer implementation focused on the core logic (storing basket tokens in x/bank, tracking balances in x/ecocredit, etc.). When it comes to implementing the filter criteria for baskets, let's prioritize filtering by class_id and credit_type_name, and leave the logical operators (AND / OR) + the rest of the filter criteria fields unimplemented for now -- until we have more clarity on the requirements.

Pick & Take from basket functionality should be good to implement as well.

@technicallyty
Copy link
Contributor

i have a draft PR up now. linked it to this issue. reposting the questions here for discussion:

Questions

  • Should we allow basket's to have no filter?
  • TakeFromBasket only returns tradable amounts, but this method can also result in credits being retired. should we include a RetiredAmount in the response message?
  • Say someone submits a TakeFromBasket tx with a requested amount of 3.123456789, and one of the batches in the basket has a precision of 6. What do we do in this case?
  • Should we cache the total number of credits in the basket table in ORM? this could save us a lot of computation time in TakeFromBasket where we iterate over all the coins, and fail if there aren't enough for the swap. cacheing the amount would allow us to fail early if a user requests more than the basket has.
  • Should the basket curator be allowed to pick if picking is disabled?
  • Should filters have depth limits? (to stop people from doing stuff like Filter_And[Filter_And[Filter_and[Filter_And[Filter_and...]]]])
  • What is the basket display name for? how should it be validated?
  • should we allow basket exponents of 0? this would result in a 1:1 of basket token -> basket credit.
  • currently i loop over all the batches in the basket, then sort by start date. is this the best/only way?
  • How should the basket's coin denom be formed? currently i just use the basket name, but i feel it could be abused by people naming their basket OSMO, and tricking folks. Perhaps we could prefix basket coins with bskt so we would have bsktFooBasket?

@aaronc
Copy link
Member

aaronc commented Jan 12, 2022

@technicallyty can you find 15-30 minutes for a live review this week and also invite @clevinson and @ryanchristo ?

@technicallyty
Copy link
Contributor

@technicallyty can you find 15-30 minutes for a live review this week and also invite @clevinson and @ryanchristo ?

cory will be out starting tmrw and back next wednesday - should we wait til then?

@aaronc
Copy link
Member

aaronc commented Jan 13, 2022

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: x/ecocredit Issues that update the x/ecocredit module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants