-
Notifications
You must be signed in to change notification settings - Fork 21
feat: liquidity mining #250
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
Conversation
enthusiastmartin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just initial quick review.
I have a feeling that there is a mixture of concrete types and generic types which however expect traits such From and Into to be implement by that type ( eg. balance and currency).
If it is defined like that - there are not many options for types anyways and I would consider to set balance and currency types to u128, or u32 respectively.
This approach will make certain things easier to do - but it limits the "re-use" of the pallet ( but i dont think that's an issue and we should not be worries about that).
eg. XYK is currently done in similar way where balance and currency id is se to u128 and u32.
enthusiastmartin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more comments.
| ); | ||
|
|
||
| // update global pool accumulated RPZ | ||
| let now_period = Self::get_now_period(global_pool.blocks_per_period)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current?
|
I've reviewed the core functionality so far only naming nitpicks that can also be addressed later (I'd rather do now since it's probably not hard). I'll continue with logic / tests and benchmarks tmrw |
| /// Liquidity pool yield farm details. | ||
| #[pallet::storage] | ||
| #[pallet::getter(fn liquidity_pool)] | ||
| type LiquidityPoolData<T: Config> = StorageDoubleMap< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally set some constants for max amount of pools (any map really) and then benchmark against that max number since maps/double maps might take longer to read/write when there is a lot of entries. Something like 255 should be sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some nitpicks in naming which don't need to be addressed now but we should have an issue for this open.
One benchmarking concern with maps.
2 tests I'd like to see.
Other than that, very nice job 👍🏻
|
It should be checked if nft class id is less than ReserveClassIdUpTo from the NFT pallet |
Description
Implementation of liquidity mining pallet
Related Issue
#242