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

feat: update referral program for new requirements #1914

Merged
merged 7 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions protocol/0029-FEES-fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ Note, it is important discounts are calculated and applied **before** rewards ar
maker_fee = maker_fee - maker_fee_referral_discount - maker_fee_volume_discount
```

1. Calculate any referral rewards due to the parties referrer (Note we are using the updated fee components from step 3)
1. Calculate any referral rewards due to the parties referrer (Note we are using the updated fee components from step 3 and the `referralProgram.maxReferralRewardProportion` is the network parameter described in the [referral program spec](./0083-RFPR-on_chain_referral_program.md#network-parameters))

```pseudo
infrastructure_fee_referral_reward = floor(infrastructure_fee * referral_reward_factor)
liquidity_fee_referral_reward = floor(liquidity_fee * referral_reward_factor)
maker_fee_referral_reward = floor(maker_fee * referral_reward_factor)
infrastructure_fee_referral_reward = floor(infrastructure_fee * min(referral_reward_factor * referral_reward_multiplier, referralProgram.maxReferralRewardProportion))
liquidity_fee_referral_reward = floor(liquidity_fee * min(referral_reward_factor * min(referral_reward_factor * referral_reward_multiplier, referralProgram.maxReferralRewardProportion))
maker_fee_referral_reward = floor(maker_fee * min(referral_reward_factor * min(referral_reward_factor * referral_reward_multiplier, referralProgram.maxReferralRewardProportion))
```

1. Finally, update the fee components by applying the rewards.
Expand Down
Loading