TokenScript icon indicating copy to clipboard operation
TokenScript copied to clipboard

data points in thegraph

Open SmartLayer opened this issue 3 years ago • 2 comments

@find out how to do a query into event.

This is an example (the address is mine) of withdrawing (claiming) 482 Uni token, observe the event:

https://cn.etherscan.com/tx/0x68a7c154b6dbc38505612f0c0738628f5f9d869da8372edf824feae7576026e8#eventlog

Address
    0x090d4613473dee047c3f2706764f49e0821d256e

Name

    Claimed (uint256 index, address account, uint256 amount)View Source

Topics

        0 0x4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026

Data

        index :220687
        account :0xbc8dafeaca658ae0857c80d8aa6de4d487577c63
        amount :482974914000000000000

This address only withdrew 400 Uni in total, but there are others who repeatedly drew Uni.

SmartLayer avatar Nov 11 '20 06:11 SmartLayer

Execute the following query on this endpoint: https://explorer.bitquery.io/graphql/CUAEuPFx2m

query(
  $from: ISO8601DateTime, 
  $till: ISO8601DateTime,
){
  ethereum {
    smartContractEvents(
      options: {desc: "date.date"},
      ##smartContractEvent: {is: "NameRegistered"},
      smartContractAddress: 
      {is: "0x090d4613473dee047c3f2706764f49e0821d256e"}
      date: {since: $from, till: $till}, 

    ) {
      date{
         date:startOfInterval(unit:day)
      }
      smartContractEvent{
        __typename
        name
      }
      times: count
      uniqueCallers: count(uniq: callers)
    }
  }
}

Variables:

{
  "from":"2019-01-01",
  "till":null
}

Will refine the query later.

samuelhbne avatar Nov 16 '20 23:11 samuelhbne

The following query get zero result set. Investigating...

query(
  $from: ISO8601DateTime, 
  $till: ISO8601DateTime,
){
  ethereum {
    smartContractEvents(
      options: {desc: "date.date"},
      ##smartContractEvent: {is: "NameRegistered"},
      smartContractAddress: 
      {is: "0x090d4613473dee047c3f2706764f49e0821d256e"}
      date: {since: $from, till: $till}, 
      smartContractEvent: {is: "Cliam"},

    ) {
      date{
         date:startOfInterval(unit:day)
      }
      smartContractEvent{
        __typename
        name
      }
      times: count
      uniqueCallers: count(uniq: callers)
    }
  }
}

samuelhbne avatar Nov 18 '20 07:11 samuelhbne