For a sell transaction the ReFiSwapRebateHook contract only applies a static 3_000 fee to each transaction irrespective of transaction size rather than the documented 0.3% sell fee.
Impacted Code:
The fee calculation should be based on a dynamic calculation not a flat 3_000 fee irrespective of transaction size.
Likelihood:
Likelihood is High - All sell transactions will have the incorrect over/under-charged fees applied.
Rather than charging the documented 0.3%, the protocol is charging 3_000 per sell transaction.
Impact:
Impact is High - The protocol documents a standard 0.3% fee, but instead charges 3_000 per transaction.
Should a transaction be less than 3_000, the customer is likely to get nothing in return as the fee amount takes everything.
Similarly for large transactions the protocol would undercharge fees.
The following is currently occurring:
Example 1:
A customer wants to swap 10_000.
They expect a fee of 30 (10_000 * 0.3%), but is instead charged 3_000
They are now out of pocket by a substantial amount.
Example 2:
A customer wants to swap 1_000.
They expect a fee of 3 (1_000 * 0.3%), but is instead charged a fee of 3_000, which is more than the transaction value.
They get nothing back as the fee has taken all.
Example 3:
A customer wants to swap 10_000_000.
They expect a fee of 30_000 (10_000_000 * 0.3%), but is instead charged a lower fee of 3_000.
The customer is able to receive more than they should.
To ensure the protocol applies the correct fee the below code change should be applied.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.