Real-time block-aggregated swap data for PancakeSwap V3 across multiple blockchains.
This substreams package is specifically designed for PancakeSwap V3, which uses a different Swap event signature than Uniswap V3.
Supported networks:
PancakeSwap V3 uses an extended Swap event that includes protocol fee tracking:
Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1)
Event Signature Hash: 0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83
This is different from Uniswap V3's signature (0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67
), which means a separate substreams package is required.
The target network is specified at runtime via CLI parameters:
substreams run coinranking-pancakeswap-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="bsc.streamingfast.io:443" \
--start-block=26324014
substreams run coinranking-pancakeswap-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="mainnet.eth.streamingfast.io:443" \
--start-block=16950686
substreams run coinranking-pancakeswap-v3-v0.1.0.spkg map_v3_ticker_output \
--substreams-endpoint="arb-one.streamingfast.io:443" \
--start-block=<TBD>
Network | Deployment Block | Factory Address |
---|---|---|
BSC | 26324014 | 0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865 |
Ethereum | 16950686 | 0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865 |
Arbitrum | TBD | 0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865 |
zkSync Era | TBD | TBD |
Polygon zkEVM | TBD | TBD |
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-pancakeswap-v3-forks@v0.1.1 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