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

Add cap for partner fee #2552

Merged
merged 4 commits into from
Mar 21, 2024
Merged

Add cap for partner fee #2552

merged 4 commits into from
Mar 21, 2024

Conversation

m-lord-renkse
Copy link
Contributor

@m-lord-renkse m-lord-renkse commented Mar 21, 2024

Description

Add a maximum cap (0.01) for the partner fee in case it is 0.01 or above.

Changes

  • Introduce a new type called Factor to enforce the limits of the value [0, 1) and provides a function to cap the partner fee

How to test

  1. e2e tests
  2. unit test

Related Issues

Fixes #2541

@m-lord-renkse m-lord-renkse requested a review from a team as a code owner March 21, 2024 10:08
@m-lord-renkse m-lord-renkse force-pushed the 2541/add-cap-for-partner-fee branch from 74a03a2 to 878609e Compare March 21, 2024 10:09
@m-lord-renkse m-lord-renkse force-pushed the 2541/add-cap-for-partner-fee branch 2 times, most recently from 2ebafd3 to 15e801e Compare March 21, 2024 12:34
@m-lord-renkse
Copy link
Contributor Author

m-lord-renkse commented Mar 21, 2024

Issue for making the max partner fee cap configurable in the autopilot #2554

@m-lord-renkse m-lord-renkse force-pushed the 2541/add-cap-for-partner-fee branch 5 times, most recently from d3c1a50 to fb19923 Compare March 21, 2024 14:17
@m-lord-renkse m-lord-renkse force-pushed the 2541/add-cap-for-partner-fee branch from fb19923 to abdeda0 Compare March 21, 2024 16:23
Copy link
Contributor

@sunce86 sunce86 left a comment

Choose a reason for hiding this comment

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

lgtm, few nits

@@ -77,20 +82,22 @@ mod tests {

// surplus fee policy without caps
let fee_policy_1 = domain::fee::Policy::Surplus {
factor: 0.1,
max_volume_factor: 1.0,
factor: FeeFactor::try_from(0.1).unwrap(),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this should work like 0.1.try_into().unwrap() but feel free to ignore

Copy link
Contributor

@squadgazzz squadgazzz left a comment

Choose a reason for hiding this comment

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

LG

@m-lord-renkse m-lord-renkse enabled auto-merge (squash) March 21, 2024 18:22
@m-lord-renkse m-lord-renkse merged commit 43963ce into main Mar 21, 2024
9 checks passed
@m-lord-renkse m-lord-renkse deleted the 2541/add-cap-for-partner-fee branch March 21, 2024 18:22
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add cap for partner fee
4 participants