Skip to content

Commit

Permalink
Merge pull request #1914 from vegaprotocol/feat/referral_updates
Browse files Browse the repository at this point in the history
feat: update referral program for new requirements
  • Loading branch information
cdummett committed Aug 29, 2023
2 parents 4ec435d + ff6d920 commit d1b65c2
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 24 deletions.
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

0 comments on commit d1b65c2

Please sign in to comment.