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

fix docment about fee point #63

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions zenlink-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,8 @@ pub mod pallet {
/// # Arguments
///
/// - `fee_point`:
/// The fee_point which integer between [0,30]
/// 0 means no protocol fee.
/// 30 means 0.3% * 100% = 0.0030.
/// default is 5 and means 0.3% * 1 / 6 = 0.0005.
/// 0 means that all exchange fees belong to the liquidity provider.
/// 30 means that all exchange fees belong to the fee receiver.
Comment on lines +497 to +498
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still incorrect, a value of 0 actually gives all fees to the fee receiver. A higher value simply limits the total cut of the exchange fee given to the fee receiver, therefore an upper bound of 30 is not required.

Copy link
Collaborator Author

@jerrybaoo jerrybaoo Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current code, it seems intuitive that fee_receiver earns more when fee_point=30 than when fee_point=10. So can you use unit tests to corroborate your point?

Copy link
Contributor

@gregdhill gregdhill Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: e3fd328

#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::set_fee_point())]
pub fn set_fee_point(origin: OriginFor<T>, fee_point: u8) -> DispatchResult {
Expand Down