Skip to content

Queries

Use sample GraphQL queries to retrieve UNCX V2 liquidity locks, filter changes by block and look up locks for a specific 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 Lockers V2 queries below using Graph Protocol’s playground:

https://thegraph.com/explorer/subgraphs/5gByjbCu558gLVwzvWiYD8JPQC8KLk6PSe9AVFy8LC69?view=Playground&chain=arbitrum-one ↗(opens in a new tab)

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

Get First 10 Locks Where Locked Liquidity is Greater Than 0

Section titled “Get First 10 Locks Where Locked Liquidity is Greater Than 0 ”

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(first: 10, where: { lockedLiquidity_gt: 0 }) { id pool { totalSupply token0 { id } token1 { id } } lockedPercent lockedLiquidity unlockDate owner { id } lockID }}
{ locks(where: { _change_block: { number_gte: 18200000 } }) { id pool { totalSupply } unlockDate amount0 amount1 lockedLiquidity }}
{ lockedPools( where: { pool_: { id: "0xf531ca1336663dfb6bd581b011c74482ee20f6d5" } } ) { pool { totalSupply } locks { id unlockDate liquidity } }}