Skip to content

Queries

Try UNCX V3 GraphQL examples to retrieve liquidity locks, query changes after a block and inspect locked reserves for a pool.

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.

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)

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

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

{ locks { lockedAmount0 lockedAmount1 lockedPercent lockedLiquidity lockedCoreUSD position { pool { activeLiquidity token0 { id name } token1 { id name } } } }}
{ locks(where: {_change_block: {number_gte: 29270000}}) { lockedAmount0 lockedAmount1 lockedPercent lockedLiquidity lockedCoreUSD position { pool { activeLiquidity token0 { id name } token1 { id name } } } }}
{ reserve(id: "0x77b95c94903a9b2a1cde22939817ae31b83e664b") { id locks { lockedAmount0 lockedAmount1 lockedPercent lockedLiquidity } pool { token0 { id symbol } token1 { id symbol } activeLiquidity } }}