Lockers V2
Subgraphs
Entities

Entities

Locker

Locker entity holds information about all UNCX lockers, each locker corresponding to a specific AMM.

FieldTypeDescription
idID!Locker Address
totalLocksBigInt!Total number of locks associated with the locker
totalTokensBigInt!Total number of tokens associated with the locker
feeWhitelist[WhitelistedWallet!]!Fee whitelisted wallets; these accounts do not pay flatrate fees on locking
feesFees!Reference to the fee details associated with the locker

LockedPool

LockedPool encapsulates the overall lock data for a pool. Each pool can have multiple locks associated with it.

FieldTypeDescription
idID!Combination of Locker and Pair addresses
poolPool!Pool address
lockerLocker!Locker address
numberOfLocksBigInt!Total number of locks for a pair address
mainTokenToken!Main token (does not follow token0 / token1 contract order)
baseTokenToken!Core tokens like stablecoins, ETH, BNB etc. (does not follow token0 / token1 contract order)
lockIds[String!]!All lock IDs associated with the pool
locks[Lock!]!All locks for LP token derived from the 'lockedPool' field

Lock

Lock provides the base-level data for locked liquidity. Some properties starting with 'locked..' are non-withdrawable assets (i.e., unlockDate > current timestamp). Other properties describe withdrawable assets and their value.

FieldTypeDescription
idID!V2 contracts: Locker + Pair + LockID; V2.1 contracts: Locker + Nonce
lockIDBigInt!LockID of the lock
amount0BigDecimal!Amount of token0 stored in the lock
amount1BigDecimal!Amount of token1 stored in the lock
liquidityBigDecimal!Amount of LP tokens vested in the lock
coreTotalUSDBigDecimal!Core token USD TVL stored in the lock (e.g., stablecoins, ETH, BNB)
lockedLiquidityBigDecimal!Liquidity stored in a lock (non-withdrawable)
lockedAmount0BigDecimal!Amount0 stored in a lock (non-withdrawable)
lockedAmount1BigDecimal!Amount1 stored in a lock (non-withdrawable)
lockedCoreUSDBigDecimal!USD value of the core asset locked (non-withdrawable)
lockedPercentBigDecimal!Locked percent of the active liquidity (non-withdrawable)
mainTokenToken!Main token (does not follow token0 / token1 contract order)
baseTokenToken!Core tokens like stablecoins, ETH, BNB, etc. (does not follow token0 / token1 contract order)
unlockDateBigInt!Unlock timestamp
ownerWallet!Lock owner address
countryCodeBigIntCountry code of the project (optional, introduced in V2.1)
lockedPoolLockedPool!Locker + Address of the LP tokens locked
poolPool!Address of the LP tokens locked
lockerLocker!Locker address
blockNumberBigInt!Last update block
timestampBigInt!Last update timestamp
eventSnapshots[StateDiffSnapshot!]!Collection of all event snapshots for a lock

WhitelistedWallet

WhitelistedWallet contains information about wallets that are whitelisted to not pay flat-rate fees on locking operations.

FieldTypeDescription
idID!Locker Address + Wallet Address
lockerLocker!The locker address
walletWallet!The whitelisted wallet address

Wallet

Wallet provides an aggregated view of all locks and whitelisted lockers for a specific wallet address.

FieldTypeDescription
idID!Unique identifier for the wallet, usually the wallet's address.
locks[Lock!]List of liquidity locks that this wallet owns.
whitelistedLockers[WhitelistedWallet!]List of all lockers where this wallet is fee whitelisted.

Token

The Token entity stores all information related to Total Value Locked (TVL) and LockedTVL (non-withdrawable assets) in a specific token. TVL is considered only if the token is paired with a liquid stablecoin or a sizable protocol/gas token like ETH, BTC, BNB, etc.

FieldTypeDescription
idID!Smart contract address of the token.
nameString!Token name, usually mirrored from the smart contract.
symbolString!Token symbol, usually mirrored from the smart contract.
decimalsBigInt!Number of decimal places this token uses, default is usually 18.
tvlUSDBigDecimal!Dollar value locked in this token across all pools and AMMs.
lockedUSDBigDecimal!Non-withdrawable dollar value locked in this token across all pools and AMMs.
baseTokens[BaseToken!]Checks if this token is considered a base token in the system.
blockNumberBigInt!Block number when the last update occurred.
timestampBigInt!Timestamp when the last update occurred.
mainTokenReserves[LockedPool!]All reserves where this token is the main token.
baseTokenReserves[LockedPool!]All reserves where this token is considered a core or base token.
mainTokenLocks[Lock!]All locks where this token is the main token.
baseTokenLocks[Lock!]All locks where this token is considered a core or base token.
eventSnapshotsMainToken[StateDiffSnapshot!]Collection of all event snapshots where this token is the main token.
eventSnapshotsBaseToken[StateDiffSnapshot!]Collection of all event snapshots where this token is considered a core or base token.

BaseToken

The BaseToken entity represents a liquid stablecoin or a sizable protocol/gas token like ETH, BTC, BNB, etc. The base price of these assets is constantly updated via a Chainlink Oracle.

FieldTypeDescription
idID!Smart contract address of the token.
tokenToken!The actual Token entity containing more details.
basePriceBigInt!Current price of the asset, useful for TVL calculations.
lastBaseUpdatedTimestampBigInt!Timestamp when the base price was last updated.

Pool

The Pool entity contains data related to liquidity pools. It provides information about the tokens involved, the liquidity provided, and other related parameters.

FieldTypeDescription
idID!Unique identifier for the pair address.
token0Token!Address of the first token in the pair.
token1Token!Address of the second token in the pair.
lockedPools[LockedPool!]!Array of Locked LP Tokens for this LP address.
reserve0BigDecimal!Total reserves of the first token (token0) in the pool.
reserve1BigDecimal!Total reserves of the second token (token1) in the pool.
totalSupplyBigDecimal!Total supply of the ERC20 token for this liquidity pair.

Fees

The Fees entity contains data related to various fees in the UNCX ecosystem. This includes the base Ethereum fee, secondary token fees, liquidity fees, and referral discounts.

FieldTypeDescription
idID!Locker address identifier.
ethFeeBigInt!Fee amount in Ethereum.
secondaryFeeTokenToken!Secondary fee token, either UNCX or UNCL.
secondaryTokenFeeBigInt!Fee amount for the secondary token, either UNCX or UNCL. (Optional)
secondaryTokenDiscountBigInt!Discount on liquidity fee when burning the secondary token.
liquidityFeeBigInt!Fee imposed on Uniswap V2 (UNI-V2) liquidity tokens.
referralPercentBigInt!Percentage fee for referrals.
referralTokenToken!The token that a referral wallet must hold to qualify as a referrer.
referralHoldBigInt!Minimum balance of the referral token that a referral wallet must hold to qualify as a referrer.
referralDiscountBigInt!Discount on flat-rate fees for using a valid referral address.

Snapshots

LockSnapshot

The LockSnapshot entity is an immutable snapshot that captures the state of a lock at a specific event. This entity is comprehensive and includes data such as amounts, liquidity, and core token values.

The id field is constructed as follows:
Locker Address + 'Events' + EventType ('Lock') + EventType.eventsNumber (0..10000+) + 'Before / After' (depending on the order).

FieldTypeDescription
idID!Composite ID based on locker address, event type, and index.
lockIDBigIntThe ID of the lock.
amount0BigDecimalThe amount of token0 stored in the lock.
amount1BigDecimalThe amount of token1 stored in the lock.
liquidityBigDecimalThe amount of LP tokens vested in the lock.
coreTotalUSDBigDecimalCore token USD TVL stored in the lock.
lockedLiquidityBigDecimalLiquidity stored in a lock that is non-withdrawable.
lockedAmount0BigDecimalAmount of token0 stored in a lock that is non-withdrawable.
lockedAmount1BigDecimalAmount of token1 stored in a lock that is non-withdrawable.
lockedCoreUSDBigDecimalUSD value of the core asset locked that is non-withdrawable.
lockedPercentBigDecimalThe percentage of the active liquidity that is non-withdrawable.
mainTokenTokenSnapshot!The main token associated with the lock.
baseTokenTokenSnapshot!Core tokens like stablecoins, ETH, BNB, etc.
unlockDateBigIntThe timestamp at which the lock will be unlocked.
ownerWalletThe owner address of the lock.
countryCodeBigIntThe country code of the project, introduced in V2.1 (optional).

TokenSnapshot

The TokenSnapshot entity is an immutable representation capturing the state of a token at a specific event in time. It includes values like the total dollar value locked in all pools as well as the non-withdrawable dollar value.

The id field is constructed as follows:
Locker Address + 'Events' + EventType (name) + EventType.eventsNumber (index) + 'Before / After' (depending on the order).

FieldTypeDescription
idID!Composite ID generated from the Locker Address, Events, EventType, and event index.
tvlUSDBigDecimal!Dollar value locked in this token across all pools.
lockedUSDBigDecimal!Non-withdrawable dollar value locked in this token across all pools.

StateDiffSnapshot

The StateDiffSnapshot entity stores all before and after event snapshots. Users can filter snapshots based on the event type using the eventType field.

FieldTypeDescription
idID!Locker address + event index
eventTypeEventType!Type of event
lockBeforeLockSnapshot!Lock event snapshot before the transaction
lockAfterLockSnapshot!Lock event snapshot after the transaction
lockLock!Reference to the lock
poolPool!Reference to the pool
lockedPoolLockedPool!Reference to the locked pool
lockerLocker!Reference to the locker
mainTokenToken!Reference to the main token
baseTokenToken!Reference to the base token
transactionBytes!Transaction hash
eventsCollectionEventCollection!Reference to the event collection
blockNumberBigInt!Event block number
timestampBigInt!Event timestamp

Events

EventCollection

The EventCollection entity serves as a repository for all event-related snapshots. It keeps track of the number of various events that modify or create locks, such as lock events, withdraw events, etc.

FieldTypeDescription
idID!Composite ID based on locker address and 'Events'.
stateDiffSnapshots[StateDiffSnapshot!]Array of state differences captured by snapshots. These are derived from this EventCollection.
lockEventsNumberBigIntTotal number of lock events.
withdrawEventsNumberBigIntTotal number of withdraw events. (Commented out)
incrementEventsNumberBigIntTotal number of increment lock events. (Commented out)
relockEventsNumberBigIntTotal number of relock events. (Commented out)
splitLockEventsNumberBigIntTotal number of split lock events. (Commented out)
transferLockOwnershipEventsNumberBigIntTotal number of transfer lock ownership events. (Commented out)
migrateEventsNumberBigIntTotal number of migrate events. (Commented out)

EventType

EventType is an enumeration that lists various types of events that can occur within the locker system.

ValueDescription
LockEvent corresponding to a new liquidity lock.
WithdrawEvent corresponding to a liquidity withdrawal.
IncrementEvent corresponding to an increment of existing liquidity.
RelockEvent corresponding to a relocking of liquidity.
SplitLockEvent corresponding to the splitting of an existing lock.
TransferLockOwnershipEvent corresponding to the transfer of lock ownership.

Search

TokenSearch

The tokenSearch is a full-text search schema over the "Token" entity. It enables users to locate specific "Token" entities by their symbols, names, or unique identifiers.

nameentityfields
tokenSearchTokensymbol, name, id

WalletSearch

The walletSearch is a full-text search schema over the "Wallet" entity. It enables users to locate specific "Wallet" entities by their unique identifiers.

nameentityfields
walletSearchWalletid