3

I bet this is a simple answer, but I'm just unable to fully understand.

Uniswap has liquidity. It can be added. But what function does it uses? the Transfer() one from the contract ?

I'm trying to find a way to track if someone adds liquidity to the pool, through the contract itself.

if anyone has knowledge about this I would appreciate, even if the answer isn't extremely detailed, I can still do more researches afterwards. Thank you

1
  • this goes in uniswap v2 perifery ditectory, the addLiquidity function
    – Nulik
    Feb 10, 2021 at 22:04

1 Answer 1

4

I think you're looking for this function: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router02.sol#L61

I'm trying to find a way to track if someone adds liquidity to the pool, through the contract itself.

addLiquidity calls this function:

https://github.com/Uniswap/uniswap-v2-core/blob/4dd59067c76dea4a0e8e4bfdda41877a6b16dedc/contracts/interfaces/IUniswapV2Pair.sol#L45

which should return this event: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol#L24

1
  • 1
    Thank you for your answer, i'm going to dive into that. What I am a bit confused about is the link between my contract and Uniswap one. If my tokens are send to the Liquidity, it has to call a function from my contract first, so it receives the tokens right? If that's the case then I can track the tokens being sent from my own contract, in a simple way
    – Astr153
    Feb 10, 2021 at 22:20

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.