How to get liquidity providers for a pool/protocol

Given this sample query:

{
  ethereum {
    dexTrades(makerOrTaker: {is: "0x9428e55418755b2f902d3b1f898a871ab5634182"} ) {
      protocol
      buyAmountInUsd: buyAmount(in: USD)
      sellAmountInUsd: sellAmount(in: USD)
      tradeAmount(in: USD)
    }
  }
}

The taker address is the trader - who buys/sells on the dex. And the ‘maker’ addresses refer to the LP pools right.

Is there a way to who has contributed to the LP pool itself? i.e. which addresses are liquidity providers for a given protocol? Or given an address, how to figure out if it has contributed liquidity to any dex?

No that is not present, you will have to use the data that we provide and come to the conclusion yourself

You can get it through the Mint event

For example check following example which get USDT-WETH pairs mint event data

{
  ethereum(network: ethereum) {
    arguments(
      options: {desc: ["block.height","index"], limit: 10}
      smartContractAddress: {in: "0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852", }
      smartContractEvent: {is: "Mint"}
    ) {
      block {
        height
      }
      index
      sender: any(of: argument_value, argument: {is: "sender"})
      amount0: any(of: argument_value, argument: {is: "token0"})
      amount1: any(of: argument_value, argument: {is: "amount1"})
    }
  }
}
1 Like

Thank you for everybody’s that tried and helps for us…