Circular Referral Fee

1. Context

The referral fee was initially designed to encourage anyone to create their own User Interface on top of Ref Finance.

By re routing users to the liquidity of the smart contract, UI builders can claim their own referral fee.

Today, any developers can charge the referral fee. They don’t need Ref approval. In other words, the ‘feature’ is live and any third-party UI (i.e. Skyward) can use it.

2. Problem

As recently highlighted by one of our community members, the referral fee can be claimed by the same user that executes the swap. The current feature does not check if the user that signed the transaction is the same as the account ID specified for the referral fee parameter.

The referral fee can be ‘circular’, allowing developers to claim the fee. In this case, it is clear that the feature is not intended to bring new users / source demand, but rather to pay less by earning a portion of the pool shares (LP tokens).

Therefore, it must be amended.

3. Solution

If the community has no objection, the solution will be executed in two phases.

1- The referral fee will be set to 0 by either the DAO or one of the Guardians immediately

2- Only whitelisted accounts will be allowed to claim the referral fee

For 2, the team will create a procedure to allow any UI builders to apply for the referral fee whitelist. Current interfaces like Skyward and Rubic (multichain aggregator) will obviously be added.


I think this adds a lot of friction.

  1. Projects must contact Ref team each time to update their addresses.
  2. Regulatory: If a project integrating Ref gets under legal scrutiny (exp: serving users from sanctioned countries) will Ref have to blacklist that project?
  3. Whitelisted addresses are in a position of privilege and get to use the loophole.

I think it’s better to separate referral fees from pool fees (If pool fee is 25bps and referral fee is 5bps then user pays 30bps total) This should mitigate the problem.

As long as a check is implemented to make sure the fee goes to the rightful account, I do not see an issue with the initial implementation.