Skip to content

Latest commit

 

History

History
67 lines (58 loc) · 1.56 KB

README.md

File metadata and controls

67 lines (58 loc) · 1.56 KB

FOAM Subgraph

FOAM provides the tools to enable a crowdsourced map and decentralized location services.

Networks and Performance

This subgraph can be found on The Graph Hosted Service at https://thegraph.com/explorer/subgraph/blocklytics/foam.

You can also run this subgraph locally, if you wish. Instructions for that can be found in The Graph Documentation.

Getting started with querying

Below are a few ways to show how to query the Foam Subgraph for data. The queries show most of the information that is queryable, but there are many other filtering options that can be used, just check out the querying api.

Querying All Active (Whitelisted) Listings

{
  listings(where: {whitelisted: true, wasRemoved: false, wasWithdrawn: false}) {
    id
    owner {
      id
    }
    deposit
    applicationExpiry
    data
  }
}

Querying All Votes for a given Challenge

{
  challenge(id: "0x10") {
    votes {
      id
      voter {
        id
      }
      isRevealed
      isForChallenge
      voteAmount
      wonChallenge
      rewardAmount
      rewardClaimed
    }
  }
}

Querying Top 10 Users by Number of Points Added to the Map

{
  users(orderBy: numListingsWhitelisted, orderDirection: desc, first: 10) {
    id
    numListingsWhitelisted
  }
}

Querying Top 10 Users by Amount Staked

{
  users(orderBy: totalAmountStaked, orderDirection: desc, first: 10) {
    id
    totalAmountStaked
  }
}