Real-time block-aggregated swap data for Uniswap V3 and all compatible forks across multiple blockchains.
This substreams package provides a universal implementation that works with all Uniswap V3 forks, including:
This implementation tracks the standard Swap event emitted by all V3 pools:
Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick)
Since all V3 forks use the same event structure, this single implementation can process swaps from any V3 deployment on any EVM-compatible blockchain.
The target network is specified at runtime via CLI parameters:
substreams run coinranking-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="mainnet.eth.streamingfast.io:443" \
--start-block=12369621 # Uniswap V3 deployment
substreams run coinranking-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="polygon.streamingfast.io:443" \
--start-block=22757547 # Uniswap V3 on Polygon
substreams run coinranking-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="arb-one.streamingfast.io:443" \
--start-block=1107 # Uniswap V3 on Arbitrum
substreams run coinranking-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="opt-mainnet.streamingfast.io:443" \
--start-block=10028767 # Uniswap V3 on Optimism
substreams run coinranking-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="base-mainnet.streamingfast.io:443" \
--start-block=1371680 # Uniswap V3 on Base
substreams run coinranking-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="bnb.streamingfast.io:443" \
--start-block=26324014 # PancakeSwap V3 on BSC
Protocol | Network | Deployment Block | Factory Address |
---|---|---|---|
Uniswap V3 | Ethereum | 12369621 | 0x1F98431c8aD98523631AE4a59f267346ea31F984 |
Uniswap V3 | Polygon | 22757547 | 0x1F98431c8aD98523631AE4a59f267346ea31F984 |
Uniswap V3 | Arbitrum | 1107 | 0x1F98431c8aD98523631AE4a59f267346ea31F984 |
Uniswap V3 | Optimism | 10028767 | 0x1F98431c8aD98523631AE4a59f267346ea31F984 |
Uniswap V3 | Base | 1371680 | 0x33128a8fC17869897dcE68Ed026d694621f6FDfD |
QuickSwap V3 | Polygon | 29000000 | 0x411b0fAcC3489691f28ad58c47006AF5E3Ab3A28 |
PancakeSwap V3 | BSC | 26324014 | 0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865 |
PancakeSwap V3 | Ethereum | 16950686 | 0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865 |
map_v3_ticker_output
Aggregates swap data per pool per block, providing:
This implementation outputs a TickerOutput
message containing aggregated swap data for each pool that had activity in the block:
price = (sqrtPriceX96 / 2^96)^2 * 10^(token0_decimals - token1_decimals)
cargo build --release --target wasm32-unknown-unknown
substreams pack
Run the test script with any supported network:
./test.sh -s <start_block> -e <stop_block>
substreams gui coinranking-uniswap-v3-forks@v0.2.0 map_v3_ticker_output
message
Modules
message
Binary
message
Module
message
Package
message
NetworkParams
message
PackageMetadata
message
ModuleMetadata
message
Clock
message
BlockRef
message
Request
message
Response
message
BlockUndoSignal
message
BlockScopedData
message
SessionInit
message
InitialSnapshotComplete
message
InitialSnapshotData
message
MapModuleOutput
message
StoreModuleOutput
message
OutputDebugInfo
message
ModulesProgress
message
ProcessedBytes
message
Error
message
Job
message
Stage
message
ModuleStats
message
ExternalCallMetric
message
StoreDelta
message
BlockRange
message
DeployRequest
message
Parameter
message
DeployResponse
message
UpdateRequest
message
UpdateResponse
message
InfoRequest
message
InfoResponse
message
SinkProgress
message
PackageInfo
message
ListRequest
message
ListResponse
message
DeploymentWithStatus
message
RemoveRequest
message
RemoveResponse
message
PauseRequest
message
PauseResponse
message
StopRequest
message
StopResponse
message
ResumeRequest
message
ResumeResponse
enum
DeploymentStatus
message
FileDescriptorSet
message
FileDescriptorProto
message
DescriptorProto
message
ExtensionRangeOptions
message
FieldDescriptorProto
message
OneofDescriptorProto
message
EnumDescriptorProto
message
EnumValueDescriptorProto
message
ServiceDescriptorProto
message
MethodDescriptorProto
message
FileOptions
message
MessageOptions
message
FieldOptions
message
OneofOptions
message
EnumOptions
message
EnumValueOptions
message
ServiceOptions
message
MethodOptions
message
UninterpretedOption
message
SourceCodeInfo
message
GeneratedCodeInfo
message
Any
message
Timestamp