v4 Entities

Schema reference for the Uniswap v4 subgraph entities and their fields.

Entities define the schema of the subgraph, and represent the data that can be queried. Below is a reference for all entities in the Uniswap v4 subgraph.

To explore the schema interactively, visit the Graph Explorer. The full schema is available in the v4-subgraph repository.

Core Entities

PoolManager

Stores aggregate information across the entire Uniswap v4 protocol. Unlike v3 which uses a Factory, v4 routes all operations through a single PoolManager singleton contract.

FieldTypeDescription
idIDPoolManager contract address
poolCountBigIntTotal pools created
txCountBigIntAll-time transaction count
totalVolumeUSDBigDecimalAll-time volume in derived USD
totalVolumeETHBigDecimalAll-time volume in derived ETH
totalFeesUSDBigDecimalAll-time swap fees in USD
totalFeesETHBigDecimalAll-time swap fees in ETH
untrackedVolumeUSDBigDecimalAll-time volume including less reliable USD values
totalValueLockedUSDBigDecimalTVL in derived USD
totalValueLockedETHBigDecimalTVL in derived ETH
totalValueLockedUSDUntrackedBigDecimalTVL in USD (untracked)
totalValueLockedETHUntrackedBigDecimalTVL in ETH (untracked)
ownerIDCurrent owner of the PoolManager

Token

Stores aggregated information for a specific token across all v4 pools.

FieldTypeDescription
idIDToken contract address
symbolStringToken symbol
nameStringToken name
decimalsBigIntToken decimals
totalSupplyBigIntToken total supply
volumeBigDecimalAll-time volume in token units
volumeUSDBigDecimalAll-time volume in derived USD
untrackedVolumeUSDBigDecimalAll-time volume including less reliable USD values
feesUSDBigDecimalAll-time fees in USD
txCountBigIntTransaction count across all pools containing this token
poolCountBigIntNumber of pools containing this token
totalValueLockedBigDecimalLiquidity across all pools in token units
totalValueLockedUSDBigDecimalLiquidity across all pools in derived USD
totalValueLockedUSDUntrackedBigDecimalTVL in USD (untracked)
derivedETHBigDecimalDerived price in ETH
whitelistPools[Pool]Pools used for USD pricing

Pool

Individual pool state including liquidity, pricing, volume, and the associated hook contract. In v4, pools are identified by a bytes32 hash derived from the pool key (token pair, fee, tick spacing, and hooks address), not a deployed contract address.

FieldTypeDescription
idIDPool ID (bytes32 hash of pool key)
createdAtTimestampBigIntPool creation timestamp
createdAtBlockNumberBigIntPool creation block number
token0TokenReference to token0
token1TokenReference to token1
feeTierBigIntFee amount
liquidityBigIntIn-range liquidity
sqrtPriceBigIntCurrent price tracker
token0PriceBigDecimaltoken0 per token1
token1PriceBigDecimaltoken1 per token0
tickBigIntCurrent tick
tickSpacingBigIntTick spacing
observationIndexBigIntCurrent observation index
volumeToken0BigDecimalAll-time token0 swapped
volumeToken1BigDecimalAll-time token1 swapped
volumeUSDBigDecimalAll-time USD swapped
untrackedVolumeUSDBigDecimalAll-time USD swapped (unfiltered)
feesUSDBigDecimalAll-time fees in USD
txCountBigIntAll-time transaction count
collectedFeesToken0BigDecimalAll-time collected fees in token0
collectedFeesToken1BigDecimalAll-time collected fees in token1
collectedFeesUSDBigDecimalAll-time collected fees in derived USD
totalValueLockedToken0BigDecimalTotal token0 across all ticks
totalValueLockedToken1BigDecimalTotal token1 across all ticks
totalValueLockedETHBigDecimalTVL in derived ETH
totalValueLockedUSDBigDecimalTVL in USD
isExternalLiquidityBooleanTrue when TVL is sourced from an external hook
totalValueLockedUSDUntrackedBigDecimalTVL in USD (untracked)
hooksStringHook contract address
liquidityProviderCountBigIntNumber of unique LPs

Tick

Stores information about individual ticks within a pool.

FieldTypeDescription
idIDPool address + tick index
poolAddressStringPool address
tickIdxBigIntTick index
poolPoolReference to pool
liquidityGrossBigIntTotal liquidity at this tick (as lower or upper)
liquidityNetBigIntNet liquidity change when tick is crossed
price0BigDecimalCalculated price of token0 at this tick
price1BigDecimalCalculated price of token1 at this tick
createdAtTimestampBigIntCreation timestamp
createdAtBlockNumberBigIntCreation block number

Event Entities

Swap

Individual swap events.

FieldTypeDescription
idIDTransaction hash + "#" + index in swaps array
transactionTransactionReference to transaction
timestampBigIntSwap timestamp
poolPoolPool swap occurred within
token0TokenReference to token0
token1TokenReference to token1
senderBytesSwap sender
originBytesEOA that initiated the transaction
amount0BigDecimalDelta of token0 swapped
amount1BigDecimalDelta of token1 swapped
amountUSDBigDecimalDerived USD amount
sqrtPriceX96BigIntPool sqrt price after the swap (Q64.96)
tickBigIntPool tick after the swap
logIndexBigIntEvent log index within the transaction

ModifyLiquidity

Tracks liquidity additions and removals. Replaces the separate Mint/Burn events used in v3.

FieldTypeDescription
idIDTransaction hash + "#" + index
transactionTransactionReference to transaction
timestampBigIntEvent timestamp
poolPoolPool the position is within
token0TokenReference to token0
token1TokenReference to token1
senderBytesAddress that modified liquidity
originBytesEOA that initiated the transaction
amountBigIntAmount of liquidity modified
amount0BigDecimalAmount of token0 modified
amount1BigDecimalAmount of token1 modified
amountUSDBigDecimalDerived USD amount
tickLowerBigIntLower tick of the position
tickUpperBigIntUpper tick of the position
logIndexBigIntEvent log index

Transaction

Stores Ethereum transaction data with references to all v4 events within it.

FieldTypeDescription
idIDTransaction hash
blockNumberBigIntBlock number
timestampBigIntConfirmation timestamp
gasUsedBigIntGas used
gasPriceBigIntGas price
modifyLiquiditys[ModifyLiquidity]Derived liquidity modification events
swaps[Swap]Derived swap events
transfers[Transfer]Derived transfer events
subscriptions[Subscribe]Derived subscription events
unsubscriptions[Unsubscribe]Derived unsubscription events

Position Entities

Position

Tracks liquidity positions by NFT tokenId. Unlike v3 where positions are always ERC-721 NFTs, v4 uses ERC-6909 for internal accounting. Positions also track subscription events for hooks.

FieldTypeDescription
idIDtokenId
tokenIdBigIntNFT token ID
ownerStringCurrent owner address
originStringEOA that minted the position
createdAtTimestampBigIntCreation timestamp
subscriptions[Subscribe]Subscription events
unsubscriptions[Unsubscribe]Unsubscription events
transfers[Transfer]Transfer events

Subscribe

Records when a position subscribes to a hook's notification system.

FieldTypeDescription
idIDTransaction hash + "-" + log index
tokenIdBigIntPosition token ID
addressStringSubscriber address
transactionTransactionReference to transaction
logIndexBigIntLog index
timestampBigIntEvent timestamp
originStringEOA that initiated the transaction
positionPositionReference to position

Unsubscribe

Records when a position unsubscribes from a hook.

FieldTypeDescription
idIDTransaction hash + "-" + log index
tokenIdBigIntPosition token ID
addressStringUnsubscriber address
transactionTransactionReference to transaction
logIndexBigIntLog index
timestampBigIntEvent timestamp
originStringEOA that initiated the transaction
positionPositionReference to position

Transfer

Records position ownership transfers.

FieldTypeDescription
idIDTransaction hash + "-" + log index
tokenIdBigIntPosition token ID
fromStringPrevious owner address
toStringNew owner address
transactionTransactionReference to transaction
logIndexBigIntLog index
timestampBigIntEvent timestamp
originStringEOA that initiated the transaction
positionPositionReference to position

Time-series Entities

UniswapDayData

Protocol-wide daily aggregated data.

FieldTypeDescription
idIDTimestamp rounded to day (timestamp / 86400)
dateIntUnix timestamp for start of day
volumeETHBigDecimalDaily volume in derived ETH
volumeUSDBigDecimalDaily volume in derived USD
volumeUSDUntrackedBigDecimalDaily volume in USD (untracked)
feesUSDBigDecimalDaily fees in USD
txCountBigIntDaily transaction count
tvlUSDBigDecimalTVL in USD at end of day

PoolDayData

Daily aggregated data per pool.

FieldTypeDescription
idIDTimestamp rounded to day
dateIntUnix timestamp for start of day
poolPoolReference to pool
liquidityBigIntIn-range liquidity at end of period
sqrtPriceBigIntPrice tracker at end of period
token0PriceBigDecimaltoken0 price derived from sqrtPrice
token1PriceBigDecimaltoken1 price derived from sqrtPrice
tickBigIntTick at end of period
tvlUSDBigDecimalTVL in USD at end of period
volumeToken0BigDecimalDaily volume in token0
volumeToken1BigDecimalDaily volume in token1
volumeUSDBigDecimalDaily volume in USD
feesUSDBigDecimalDaily fees in USD
txCountBigIntDaily transaction count
openBigDecimalOpening price of token0
highBigDecimalHigh price of token0
lowBigDecimalLow price of token0
closeBigDecimalClosing price of token0

PoolHourData

Hourly aggregated data per pool.

FieldTypeDescription
idIDPool address + hour start timestamp
periodStartUnixIntUnix timestamp for start of hour
poolPoolReference to pool
liquidityBigIntIn-range liquidity at end of period
sqrtPriceBigIntPrice tracker at end of period
token0PriceBigDecimaltoken0 price derived from sqrtPrice
token1PriceBigDecimaltoken1 price derived from sqrtPrice
tickBigIntTick at end of period
tvlUSDBigDecimalTVL in USD at end of period
volumeToken0BigDecimalHourly volume in token0
volumeToken1BigDecimalHourly volume in token1
volumeUSDBigDecimalHourly volume in USD
feesUSDBigDecimalHourly fees in USD
txCountBigIntHourly transaction count
openBigDecimalOpening price of token0
highBigDecimalHigh price of token0
lowBigDecimalLow price of token0
closeBigDecimalClosing price of token0

TokenDayData

Daily aggregated data per token.

FieldTypeDescription
idIDToken address + day index
dateIntUnix timestamp for start of day
tokenTokenReference to token
volumeBigDecimalDaily volume in token units
volumeUSDBigDecimalDaily volume in derived USD
untrackedVolumeUSDBigDecimalDaily volume in USD (untracked)
totalValueLockedBigDecimalLiquidity in token units
totalValueLockedUSDBigDecimalLiquidity in derived USD
priceUSDBigDecimalPrice in USD at end of period
feesUSDBigDecimalDaily fees in USD
openBigDecimalOpening price in USD
highBigDecimalHigh price in USD
lowBigDecimalLow price in USD
closeBigDecimalClosing price in USD

TokenHourData

Hourly aggregated data per token. Same fields as TokenDayData but with periodStartUnix instead of date.

Utility Entities

Bundle

Global store of derived ETH price in USD, used for USD value derivations throughout the subgraph.

FieldTypeDescription
idIDConstant "1"
ethPriceUSDBigDecimalDerived price of ETH in USD based on stablecoin pools