Find "PairCreated" event

Hi there, can I please get some help with writing a query to find the PairCreated event for a specific pair? The pair or data I’m looking for is pair: 0x6e559A800e1C098029b0D7fcCEF14845F18b0078

Here’s what i’ve got so far… don’t know where to put the filter for the pair address:

query MyQuery {
  ethereum(network: bsc) {
    smartContractEvents(
      smartContractAddress: {is: "0xca143ce32fe78f1f7019d7d551a6402fc5350c73"} #pancake factory
      smartContractEvent: {is: "PairCreated"}
    ) {
      transaction {
        hash
      }
    }
  }
}

Many thanks!

What kind of data are you looking for ?

Just looking to get the transaction hash and a timestamp for when that pair was created

For the particular pair address, the smartContractEvent PairCreated is not available. You can check the same here. If you still need the transaction hash and timestamp of the pair address 0x6e559a800e1c098029b0d7fccef14845f18b0078. Here is the query

{
  ethereum(network: bsc) {
    smartContractEvents(
      options: {limit: 10}
      smartContractAddress: {is: "0x6e559a800e1c098029b0d7fccef14845f18b0078"}
    ) {
      smartContractEvent{
        name
      }
      block {
        timestamp {
          iso8601
        }
      }
      transaction {
        hash
      }
    }
  }
}

If you need the transaction hash and the timestamp of the pair address 0xca143ce32fe78f1f7019d7d551a6402fc5350c73, you can use the following query.

{
  ethereum(network: bsc) {
    smartContractEvents(
      options: {limit: 10}
      smartContractAddress: {is: "0xca143ce32fe78f1f7019d7d551a6402fc5350c73"}
    ) {
      smartContractEvent {
        name
      }
      transaction{
        hash
      }
      block{
        timestamp{
          iso8601
        }
      }
    }
  }
}

Thanks @sayon, as a follow up question, is there a simple query I can use just to get the tx hash and timestamp of when a smart contract was first deployed?

I’ll open a new thread for this question so that others can benefit

1 Like

Answered on this thread