LP Add/Remove Liquidity

Hey guys,

i´am still developing my reporting tool for a DEX. There is now a new problem.

What i am doing:
I try to get a report for Top Net Buying
This means every transaction from and to the MasterChef Contract is counted.
Example:
01.05.2022
+10.000 Buying
02.05.2022
-3.000 Selling
08.05.2022
+2.000 Buying

Report between 30.04.2022 and 08.05.2022 should show
+9.000 Tokens bought during specified time.

My Problem is now the following.
If a user is adding or removing Liquidity (this is going through the MasterChef Contract, the same contract where tokens are bought or sold) it shows me that this user (if he has add liquidity for example 5.000NativTokens + 5.000Busd = 5.000LP Tokens)
That this user has sold his tokens (sold is shown because he has added liquidity but not sold anything)

So i get wrong data.
Do you have an idea how to solve this problem? Is there en Event i can Deselect on Moralis or any data/method which could help me in the Moralis Database to get the correct and real bought and sold tokens and not removed or added liquidity?

Kind Regards

Could you add some more details please like:

  • which event(s) you’re using to count transactions
  • what this MasterChef contract is - address, DEX
  • how the liquidity works in said contract and which event is used
  • what you have done so far in code or with Moralis
  • a real example e.g. an address that is buying/selling where adding/removing liquidity changes your calculations

That this user has sold his tokens (sold is shown because he has added liquidity but not sold anything)

Are these under the same event as regular transactions from/to the MasterChef contract? If so you could try filtering them out if they are liquidity related.