-
Notifications
You must be signed in to change notification settings - Fork 746
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
Changed LPFee to Percent type in Asset Conversion Pallet #1237
Conversation
@@ -291,6 +291,7 @@ parameter_types! { | |||
pub const AllowMultiAssetPools: bool = false; | |||
// should be non-zero if AllowMultiAssetPools is true, otherwise can be zero | |||
pub const LiquidityWithdrawalFee: Permill = Permill::from_percent(0); | |||
pub LiquidityPoolFee: Percent = Percent::from_rational_with_rounding(997u32, 1000u32, Rounding::NearestPrefDown).unwrap(); // 0.3% |
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.
Won't this be zero?
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.
yeah undesired, I meant (3, 1000) which is still rounded to either 0% or 1% depending on rounding rule. I probably need more accuracy for a 0.3% using Permill (there is no inbetween Percent and Permill right?) and then the fee calculations need to take this into consideration
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.
Yeah, it will have to be a PerMill
let amount_in_with_fee = amount_in | ||
.checked_mul(&(T::HigherPrecisionBalance::from(1000u32) - (T::LPFee::get().into()))) | ||
.ok_or(Error::<T>::Overflow)?; | ||
let fee_mult = T::HigherPrecisionBalance::from(T::LPFee::get() * 1u32); |
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.
TODO, temporal, same as below
The CI pipeline was cancelled due to failure one of the required jobs. |
@@ -173,7 +173,7 @@ pub mod pallet { | |||
|
|||
/// A % the liquidity providers will take of every swap. Represents 10ths of a percent. |
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.
/// A % the liquidity providers will take of every swap. Represents 10ths of a percent. | |
/// A % the liquidity providers will take of every swap. |
Ping @PatricioNapoli |
Fixes #88
Changed Liquidity Pool fee in Asset Conversion pallet from a u32 to a Percent type.
TODO: Fix fee multipliers