Files
tycho-protocol-sdk/substreams/ethereum-uniswap-v3-logs-only/ethereum-uniswap-v3.yaml
Zizou 9e8e360889 refactor(substreams): improve logic to ignore updates (#96)
* refactor(substreams): ignore transaction if contracts update are ignored.

There are some cases where we ignore contracts updates (for example if the old and new values are the same). In that case if the transaction only contains ignored updates we don't emit it.

* refactor(substreams): ignore deletions for freshly created attributes.

There are cases where an attribute can be created and deleted during the same transaction. To avoid sending a confusing deletion for something that was never created before, we just ignore the deletion in that particular case.

* feat(substreams): Add uniswap V3 logs only module (#98)

* feat(substreams): add uniswapV3 logs only Substreams module

* refactor(substreams): encode everything as big endian

* refactor(substreams): mark changes as creation when a tick liq is updated from 0

This will allow the SDK to detect cases where a tick is created and deleted in the same transaction and ignore it.

* ci(substreams): ignore built files for uniswapv3 logs only module and clean code

* refactor(substreams): update uniswapv3 substreams with new SDK interface

* feat(subtreams): emit default token balances value for uniswapv3

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2024-11-07 05:16:55 +00:00

126 lines
2.7 KiB
YAML

specVersion: v0.1.0
package:
name: "ethereum_uniswap_v3_logs_only"
version: v0.1.0
protobuf:
files:
- tycho/evm/v1/entity.proto
- tycho/evm/v1/common.proto
- tycho/evm/v1/utils.proto
- uniswap.proto
importPaths:
- ./proto/v1
- ../../proto/
binaries:
default:
type: wasm/rust-v1
file: ../target/wasm32-unknown-unknown/release/ethereum_uniswap_v3_logs_only.wasm
modules:
- name: map_pools_created
kind: map
initialBlock: 12369621
inputs:
- params: string
- source: sf.ethereum.type.v2.Block
output:
type: proto:tycho.evm.v1.BlockEntityChanges
- name: store_pools
kind: store
initialBlock: 12369621
updatePolicy: set_if_not_exists
valueType: proto:uniswap.v3.Pool
inputs:
- map: map_pools_created
- name: map_events
kind: map
initialBlock: 12369621
inputs:
- source: sf.ethereum.type.v2.Block
- store: store_pools
output:
type: proto:uniswap.v3.Events
- name: map_balance_changes
kind: map
initialBlock: 12369621
inputs:
- map: map_events
output:
type: proto:tycho.evm.v1.BlockBalanceDeltas
- name: store_pools_balances
kind: store
initialBlock: 12369621
updatePolicy: add
valueType: bigint
inputs:
- map: map_balance_changes
- name: map_ticks_changes
kind: map
initialBlock: 12369621
inputs:
- map: map_events
output:
type: proto:uniswap.v3.TickDeltas
- name: store_ticks_liquidity
kind: store
initialBlock: 12369621
updatePolicy: add
valueType: bigint
inputs:
- map: map_ticks_changes
- name: store_pool_current_tick
kind: store
initialBlock: 12369621
updatePolicy: set
valueType: int64
inputs:
- map: map_events
- name: map_liquidity_changes
kind: map
initialBlock: 12369621
inputs:
- map: map_events
- store: store_pool_current_tick
output:
type: proto:uniswap.v3.LiquidityChanges
- name: store_liquidity
kind: store
initialBlock: 12369621
updatePolicy: set_sum
valueType: bigint
inputs:
- map: map_liquidity_changes
- name: map_protocol_changes
kind: map
initialBlock: 12369621
inputs:
- source: sf.ethereum.type.v2.Block
- map: map_pools_created
- map: map_events
- map: map_balance_changes
- store: store_pools_balances
mode: deltas
- map: map_ticks_changes
- store: store_ticks_liquidity
mode: deltas
- map: map_liquidity_changes
- store: store_liquidity
mode: deltas
output:
type: proto:tycho.evm.v1.BlockChanges
params:
map_pools_created: "1F98431c8aD98523631AE4a59f267346ea31F984"