Skip to content

Latest commit

 

History

History
72 lines (59 loc) · 1.95 KB

subgraph.md

File metadata and controls

72 lines (59 loc) · 1.95 KB

Using Predictoor Subgraph

Subgraph URLs

You can query an Ocean subgraph at one of the following:

Local (= $SUBGRAPH_URL):

Remote:

Typical query

For a general overview, here's a good one:

query{
  predictContracts{
    id
    token{
      name
    }
    subscriptions(orderBy: expireTime orderDirection:desc first:10){
      user {
        id
      }
      expireTime
    }
    slots(orderBy: slot orderDirection:desc first:10){
      slot
      roundSumStakesUp
      roundSumStakes
      predictions(orderBy: timestamp orderDirection:desc){
        stake
        user {
          id
        }
        timestamp
        payout{
          payout
          predictedValue
          trueValue
        }
      }
      trueValues{
        trueValue
      }
    }
  } 
}

Queries in pdr-backend agents

Agents like predictoor and trader do queries via pdr_backend/util/subgraph.py.

  • They call to a subgraph, at a given url, with a particular query
  • and they may filter further

Filters, You can set some envvars to filter query results for agents. Check out the envvar documentation to learn more about these filters and how to set them.

Appendix