Search code examples
blockchainethereumsoliditycryptocurrencyerc20

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


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