Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data points in thegraph #402

Open
SmartLayer opened this issue Nov 11, 2020 · 2 comments
Open

data points in thegraph #402

SmartLayer opened this issue Nov 11, 2020 · 2 comments
Assignees

Comments

@SmartLayer
Copy link

SmartLayer commented Nov 11, 2020

@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.

@samuelhbne
Copy link

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
Copy link

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)
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants