`EntityChanges` emitted out for all the entities defined in the `schema.graphql` for the Uniswap v3 Subgraph.
Output
sf.substreams.entity.v1.EntityChanges
Inputs

Package ref
host-uniswap-v3@v0.2.11Run package
CLI
Run graph_out from the command line.
substreams run host-uniswap-v3@v0.2.11 graph_out -e mainnetsubstreams auth or directly on thegraph.market (see docs).README
Substreams-based Uniswap-v3 Substreams-powered-subgraph.
This module emits EntityChanges, and are written directly to graph-node without any AssemblyScript mappings therein.
This module covers all of the entities of the original v3-subgraph by the Uniswap team. It syncs much faster.
Launch the devpod above and run:
substreams auth
substreams build
substreams gui
Alternatively, run the graph_out module against a Substreams cluster, without building it locally:
substreams run -t +150 uniswap-v3@latest graph_out
[...]
{
"@module": "graph_out",
"@block": 12369621,
"@type": "sf.substreams.entity.v1.EntityChanges",
"@data": {
"entityChanges": [
{
"entity": "Factory",
"id": "1f98431c8ad98523631ae4a59f267346ea31f984",
"ordinal": "1",
"operation": "CREATE",
"fields": [
{
"name": "id",
"newValue": {
"string": "1f98431c8ad98523631ae4a59f267346ea31f984"
}
},
{
"name": "poolCount",
"newValue": {
"bigint": "0"
}
},
[...]
]
},
{
"entity": "Pool",
"id": "1d42064fc4beb5f8aaf85f4617ae8b3b5b8bd801",
"ordinal": "927",
"operation": "UPDATE",
"fields": [
{
"name": "totalValueLockedToken0",
"newValue": {
"bigdecimal": "0.9999999999999999240000000000003427709097170609759698726797493006923644998096278868615627288818359375"
},
"oldValue": {
"bigdecimal": "0"
}
}
]
},
[...]
]
}
}
substreams-uniswap-v3make build
[...]
substreams run -e mainnet.eth.streamingfast.io:443 substreams.yaml graph_out -t +150
[...]
try it :)
substreams pack substreams.yaml
Modules
`EntityChanges` emitted out for all the entities defined in the `schema.graphql` for the Uniswap v3 Subgraph.
Output
sf.substreams.entity.v1.EntityChanges
Inputs
Chunky module which emits multiple types of `Events`. Looping over every transaction to filter out `Events`. For some events, we have to loop over `StorageChanges` to be able to fetch certain changes such as liquidity increases and decreases. For more information on what the `Event` contains, check proto/uniswap/v1/uniswap.proto. Try with ``` substreams gui substreams.yaml map_extract_data_types -t +1000 ```
Output
uniswap.types.v1.EventsThis module will loop over block transactions and detect pools created events. Once the pool created events have been detected, `Pools` structs will be emitted out of the module. Try with ``` substreams gui substreams.yaml map_pools_created -t +1000 ```
Output
uniswap.types.v1.PoolsThis modules loops over the pools created and emits `ERC20Tokens` structs out of the module. Tokens part of the pair of a pool are checked against the `WHITELIST_TOKENS` constant to see if they are part of the list. If so push the address of the pool in the field `whitelist_pools` of the token. Try with ``` substreams gui substreams.yaml map_tokens_whitelist_pools -t +1000 ```
Inputs
`BigDecimal` accumulator store for the derived `total_value_locked` in `USD`, `ETH`, `USDUntracked` and `ETHUntracked` for the factory.
Store value
bigdecimal
Update policy
add
Inputs
`BigDecimal` accumulator store for the derived `total_value_locked` in `USD`, `ETH`, `USDUntracked` and `ETHUntracked` for pools and tokens.
Store value
bigdecimal
Update policy
set
Inputs
`BigDecimal` setter store for the `eth_price`. This module uses a multiple stores and `map_extract_data_types` to find the `eth_price` of any given token. If a pool contains a token which has a pair with a _well-known_ token, the `eth_price` is easily found. Stores the USD price of ETH. For example: - Pool: DAI <> WBTC -> we check if there is a pool with DAI <> ETH and easily derive the price - Pool: ANYTOKEN0 <> DAI -> we can derive the price by finding the pool DAI <> ETH - Pool: ANYTOKEN0 <> ANYTOKEN1 -> more complicated case where we have to check on either side of the pool and try to find a path to reach a `whitelisted_token` which has a pool with ETH to be able to derive the price
Store value
bigdecimal
Update policy
set
`BigDecimal` maximum store for the price of `eth` and token prices for `open` and `low` for daily and hourly.
Store value
bigdecimal
Update policy
max
Inputs
`BigDecimal` minimum store for the price of `eth` and token prices for `open` and `low` for daily and hourly.
Store value
bigdecimal
Update policy
min
Inputs
`BigDecimal` setter store for the native amounts out of any `Event` type: `Mint`, `Swap` and `Burn` amounts (amount0 and amount1).
Store value
bigdecimal
Update policy
set
Inputs
Store value
bigint
Update policy
add
Inputs
`BigInt` store setter for storing pool liquidites which were extracted from `map_extract_data_types`.
Store value
bigint
Update policy
set
Inputs
Store setter for `PoolSqrtPrice` emitted out of the `map_extract_data_types`.
Store value
proto:uniswap.types.v1.Events.PoolSqrtPriceUpdate policy
set
Inputs
This module stores the Pools emitted by the `map_pools_created` module. Dynamic data sources pattern for Uniswap v3 pools.
Store value
proto:uniswap.types.v1.PoolUpdate policy
set
Inputs
`PositionEvent` setter store for `Position` Events emitted out of `map_extract_data_types`. `CreatedPosition`, `IncreaseLiquidityPosition`, `DecreaseLiquidityPosition`, `CollectPosition` and `TransferPosition` are stored.
Store value
proto:uniswap.types.v1.Events.PositionEventUpdate policy
set
Inputs
`BigDecimal` store setter for storing the price of token0 <> token1 and vice versa. Also store the Daily and Hourly prices. For example: Pool: TOKEN0 <> TOKEN1 - pool:{pool_address}:{token0_addr}:token0 -> 100 - pool:{pool_address}:{token1_addr}:token1 -> 1 This means that the price of TOKEN0 is 100 for 1 TOKEN1
Store value
bigdecimal
Update policy
set
Inputs
`BigDecimal` accumulator store for the swap volume of various entries such as `amount0_abs`, `amount1_abs`, `volume_usd`, `volume_usd_untracked`, `volume_eth`, `fee_usd` and `fee_eth`. The `_0` and `_1` entries are the value of one token for another token.
Store value
bigdecimal
Update policy
add
Inputs
`BigInt` accumulator store for the liquidities of the pools. Tracking `liquidityGross` and `liquidityNet` for pool values at all times, daily and hourly for `Mint` and `Burn` events.
Store value
bigint
Update policy
add
Inputs
Store value
bigdecimal
Update policy
add
Inputs
`Int64` store accumulator for each time a token is used for any combination for a pool.
Store value
int64
Update policy
add
Inputs
`String` appender store which stores the `whitelist_pools` field of a token.
Store value
string
Update policy
append
`BigInt` accumulator store for the total transaction counts for pools, tokens, factory, daily factory, daily and hourly for token and pool data.
Store value
bigint
Update policy
add
Inputs