> For the complete documentation index, see [llms.txt](https://docs.uncx.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uncx.network/guides/for-developers/liquidity-lockers/lockers-v3/subgraphs/queries.md).

# Queries

## Sample Queries

GraphQL's flexible query structure allows you to explore various data fetching strategies (such as direct lookup, pagination, diffing, etc). This page will help you get started by providing examples using the most techniques.

## Try Out The Queries <a href="#try-out-the-queries" id="try-out-the-queries"></a>

You can try out the queries below using Graph Protocol's playground:

[https://thegraph.com/hosted-service/subgraph/alex-unicrypt/uncx-lockers-v3-bsc(opens in a new tab)](https://thegraph.com/hosted-service/subgraph/alex-unicrypt/uncx-lockers-v3-bsc)

All of the examples can also be accessed from the preset dropdown.

## Get All Locks <a href="#get-all-locks" id="get-all-locks"></a>

This query returns all locks that currently exist on all AMMs for a given chain (regardless of their expiration).

The amount of locks returned might exceed the Subgraph return limit (currently at `1000` results per query). It is suggested to combine this query with various [Pagination Techniques(opens in a new tab)](https://thegraph.com/docs/en/querying/graphql-api/#pagination).

```
{  locks {    lockedAmount0    lockedAmount1    lockedPercent    lockedLiquidity    lockedCoreUSD    position {      pool {        activeLiquidity        token0 {          id          name        }        token1 {          id          name        }      }    }  }}
```

## Get All Locks After a Block <a href="#get-all-locks-after-a-block" id="get-all-locks-after-a-block"></a>

```
{  locks(where: {_change_block: {number_gte: 29270000}}) {    lockedAmount0    lockedAmount1    lockedPercent    lockedLiquidity    lockedCoreUSD    position {      pool {        activeLiquidity        token0 {          id          name        }        token1 {          id          name        }      }    }  }}
```

## Get All Locks For a Pool <a href="#get-all-locks-for-a-pool" id="get-all-locks-for-a-pool"></a>

```
{  reserve(id: "0x77b95c94903a9b2a1cde22939817ae31b83e664b") {    id    locks {      lockedAmount0      lockedAmount1      lockedPercent      lockedLiquidity    }    pool {      token0 {        id        symbol      }      token1 {        id        symbol      }      activeLiquidity    }  }}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.uncx.network/guides/for-developers/liquidity-lockers/lockers-v3/subgraphs/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.
