-
Notifications
You must be signed in to change notification settings - Fork 46
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
Farm concentrated liq (part 3) #843
base: feat/concentrated-liq
Are you sure you want to change the base?
Conversation
@@ -12,6 +13,12 @@ use crate::{ | |||
pub const DEFAULT_SAFE_PRICE_ROUNDS_OFFSET: u64 = 10 * 60; | |||
pub const SECONDS_PER_ROUND: u64 = 6; | |||
|
|||
#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode)] | |||
pub struct SafePriceLpToken<M: ManagedTypeApi> { |
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.
Why use a struct instead of MultiValue2?
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 not change the implementation here, as there may be a lot of external contracts that have implemented this feature as it is right now.
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.
Way easier to integrate into other contracts. You don't need to look into the source code to see what each multi-value means, you simply import the struct.
|
||
fn get_price_bounds(&self, price: &BigUint) -> PriceBounds<Self::Api> { | ||
let min_ticker = self.min_ticker().get(); | ||
let lower_bound = price / &min_ticker * &min_ticker; |
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 don't think this is correct
{ | ||
#[init] | ||
fn init( | ||
&self, | ||
reward_token_id: TokenIdentifier, | ||
farming_token_id: TokenIdentifier, | ||
division_safety_constant: BigUint, | ||
min_ticker: BigUint, |
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.
What is this? Does it need to be a variable? Maybe have it as a constant?
…tiversx/mx-exchange-sc into farm-concentrated-liq-part-3
Contract comparison - from aed9246 to c1ed510
|
No description provided.