# Queries

The subgraph can be queried to retrieve important information about MasterChef, pools, pool histories, users, and more. This page will provide examples for common queries.

To try these queries and run your own visit the [MasterChef subgraph sandbox](https://thegraph.com/explorer/subgraph/techstreamp/ropsten-masterchef).

**MasterChef**

All time Swipe rewards, total rewards in USD, all time pool count.

```graphql
{
  masterChef(id: "0x267748fe0db99863e1d5448ef5b9442230c24789") {
    id
    bonusMultiplier
    bonusEndBlock
    swipe
    swipePerBlock
    totalAllocPoint
    poolCount
  }
}
```

**Pool**

Current Pool balance, all time swipe harvested, harvested Swipe in USD

```graphql
{
  pool(id: 2) {
    id
    pair
    balance
    entryUSD
    exitUSD
    swipeHarvested
    swipeHarvestedUSD
    block
    slpBalance
    slpAge
    slpAgeRemoved
    slpDeposited
    slpWithdrawn
    userCount
  }
}

```

**Pool History**

Snapshot of a pool state at every block generation time

```graphql
{
  poolHistory(id: "118682") {
    id
    entryUSD
    exitUSD
    swipeHarvested
    swipeHarvestedUSD
    block
    slpBalance
    slpAge
    slpAgeRemoved
    slpDeposited
    slpWithdrawn
    userCount
    block
  }
}

```

**History**

Snapshot of the whole MasterChef pools at every event generation time

```graphql
{
  history(id: "0x267748fe0db99863e1d5448ef5b9442230c2478918682") {
    id
    block
    slpBalance
    slpAge
    slpAgeRemoved
    slpDeposited
    slpWithdrawn
    block
  }
}
```

**User**

User reward status in each pools

```graphql
{
  users(where: { address: "0x1d85ddeb7f73c33802d4e2545ee65a579781e0b6" }) {
    id
		address
    amount
    rewardDebt
    entryUSD
    exitUSD
    swipeHarvested
    swipeHarvestedUSD
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.swipe.org/swap/subgraph-api/masterchef/queries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
