简体   繁体   English

我如何奖励向池中增加流动性的地址? (ERC20 代币)

[英]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).如果一个地址将 ETH 换成 my_token,我想用免费的 my_tokens 奖励他们(以交易的百分比计算)。 Would it be possible to implement it in the solidity code or are there any built-in solutions on uniswap, pancakeswap etc.是否可以在 Solidity 代码中实现它,或者在 uniswap、pancakeswap 等上有任何内置解决方案吗?

This is how it is usually done with liquidity mining.这就是流动性挖矿通常的做法。

  • When you add liquidity you receive LP token of the pool (liquidity provider token(当您添加流动性时,您会收到池的 LP 代币(流动性提供者代币(
  • Then you lock these LP tokens to a vault然后将这些 LP 令牌锁定到保险库
  • As long as the LP tokens are locked, the user is receiving rewards只要 LP 代币被锁定,用户就会获得奖励

One of the most well-known contracts for such liquidity mining is MasterCher from Sushiswap .这种流动性挖矿最著名的合约之一是来自 Sushiswap 的 MasterCher

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然后看看 MasterChef 如何应用于您的项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM