Thursday, July 28, 2022

[FIXED] How can I reward addresses with who add liquidity to the pool? (ERC20 token)

Issue

If an address swaps ETH for my_token, I wanna reward them with free my_tokens (calculated as a % of the transaction). Would it be possible to implement it in the solidity code or are there any built-in solutions on uniswap, pancakeswap etc.


Solution

This is how it is usually done with liquidity mining.

  • When you add liquidity you receive LP token of the pool (liquidity provider token(
  • Then you lock these LP tokens to a vault
  • As long as the LP tokens are locked, the user is receiving rewards

One of the most well-known contracts for such liquidity mining is MasterCher from Sushiswap.

I suggest

  • You try liquidity mining yourself by buying some token subject to liquidity mining
  • Then see how MasterChef could be applied for your project


Answered By - Mikko Ohtamaa
Answer Checked By - Terry (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.