I am integrating the uni swap contracts and want to understand how could I calculate the daily rewards for the liquidity provide. I understand that I could get the pairAddress.balanceOf(msg.sender) for each day and subtract the numbers from each other, but it doesn't seem the most efficient way.


Is this regarding V3 or V2? In either, LP rewards do not accrue directly to a LP token holder. In V2 they are reinvested into the pool, and in V3 they are collected separately and must be redeemed by calling the pool contract directly.

  • Thank you for the answer, it is regarding V2, but I still don't understand, where the user could see how much did he earn since the beginning. (or at least how much liquidity does he/she earns currently). Jun 4 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.