fix(balancer): miscellaneous improvements before resync (#104)
* fix(balancer): ignore self balance change Euler pool emit a balance change for the pool itself. We don't want to have it because it's an unknown token from Tycho's perspective. example: https://etherscan.io/tx/0x4a9ea683052afefdae3d189862868c3a7dc8f431d1d9828b6bfd9451a8816426#eventlog#338 * refactor(balancer): rename balancer module to balancer-v2 * ci: make clippy happy --------- Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
This commit is contained in:
4
substreams/Cargo.lock
generated
4
substreams/Cargo.lock
generated
@@ -221,8 +221,8 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ethereum-balancer"
|
||||
version = "0.2.2"
|
||||
name = "ethereum-balancer-v2"
|
||||
version = "0.2.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"ethereum-balancer",
|
||||
"ethereum-balancer-v2",
|
||||
"ethereum-curve",
|
||||
"crates/tycho-substreams",
|
||||
"crates/substreams-helper",
|
||||
@@ -8,7 +8,7 @@ members = [
|
||||
"ethereum-uniswap-v2",
|
||||
"ethereum-uniswap-v3",
|
||||
"ethereum-sfrax",
|
||||
"ethereum-sfraxeth"
|
||||
"ethereum-sfraxeth",
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "ethereum-balancer"
|
||||
version = "0.2.2"
|
||||
name = "ethereum-balancer-v2"
|
||||
version = "0.2.3"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "ethereum_balancer"
|
||||
name = "ethereum_balancer_v2"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
@@ -1,6 +1,6 @@
|
||||
substreams_yaml_path: ./substreams.yaml
|
||||
protocol_type_names:
|
||||
- "balancer_pool"
|
||||
- "balancer_v2_pool"
|
||||
adapter_contract: "BalancerV2SwapAdapter"
|
||||
adapter_build_signature: "constructor(address)"
|
||||
adapter_build_args: "0xBA12222222228d8Ba445958a75a0704d566BF2C8"
|
||||
@@ -79,7 +79,12 @@ pub fn map_relative_balances(
|
||||
.get_last(format!("pool:{}", &component_id[..42]))
|
||||
.is_some()
|
||||
{
|
||||
for (token, delta) in ev.tokens.iter().zip(ev.deltas.iter()) {
|
||||
for (token, delta) in ev
|
||||
.tokens
|
||||
.iter()
|
||||
.zip(ev.deltas.iter())
|
||||
.filter(|(token, _)| **token != hex::decode(&component_id[2..42]).unwrap())
|
||||
{
|
||||
deltas.push(BalanceDelta {
|
||||
ord: vault_log.ordinal(),
|
||||
tx: Some(vault_log.receipt.transaction.into()),
|
||||
@@ -77,7 +77,7 @@ pub fn address_map(
|
||||
),
|
||||
("manual_updates", &[1u8]),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
hex!("cC508a455F5b0073973107Db6a878DdBDab957bC") => {
|
||||
@@ -109,7 +109,7 @@ pub fn address_map(
|
||||
),
|
||||
("manual_updates", &[1u8]),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
hex!("5Dd94Da3644DDD055fcf6B3E1aa310Bb7801EB8b") => {
|
||||
@@ -141,7 +141,7 @@ pub fn address_map(
|
||||
),
|
||||
("manual_updates", &[1u8]),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
hex!("897888115Ada5773E02aA29F775430BFB5F34c51") => {
|
||||
@@ -173,7 +173,7 @@ pub fn address_map(
|
||||
),
|
||||
("manual_updates", &[1u8]),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
hex!("DB8d758BCb971e482B2C45f7F8a7740283A1bd3A") => {
|
||||
@@ -203,7 +203,7 @@ pub fn address_map(
|
||||
("rate_providers", &json_serialize_address_list(&create_call.rate_providers)),
|
||||
("manual_updates", &[1u8]),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
hex!("813EE7a840CE909E7Fea2117A44a90b8063bd4fd") => {
|
||||
@@ -240,7 +240,7 @@ pub fn address_map(
|
||||
.to_signed_bytes_be(),
|
||||
),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
hex!("5F43FBa61f63Fa6bFF101a0A0458cEA917f6B347") => {
|
||||
@@ -277,7 +277,7 @@ pub fn address_map(
|
||||
.to_signed_bytes_be(),
|
||||
),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
// ❌ Reading the deployed factory for Gearbox showcases that it's currently disabled
|
||||
@@ -362,7 +362,7 @@ pub fn address_map(
|
||||
.to_signed_bytes_be(),
|
||||
),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
hex!("5F5222Ffa40F2AEd6380D022184D6ea67C776eE0") => {
|
||||
@@ -399,7 +399,7 @@ pub fn address_map(
|
||||
.to_signed_bytes_be(),
|
||||
),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
// The `WeightedPool2TokenFactory` is a deprecated contract, but we've included
|
||||
@@ -429,7 +429,7 @@ pub fn address_map(
|
||||
),
|
||||
("manual_updates", &[1u8]),
|
||||
])
|
||||
.as_swap_type("balancer_pool", ImplementationType::Vm),
|
||||
.as_swap_type("balancer_v2_pool", ImplementationType::Vm),
|
||||
)
|
||||
}
|
||||
_ => None,
|
||||
@@ -1,7 +1,7 @@
|
||||
specVersion: v0.1.0
|
||||
package:
|
||||
name: "ethereum_balancer"
|
||||
version: v0.2.2
|
||||
name: "ethereum_balancer_v2"
|
||||
version: v0.2.3
|
||||
|
||||
protobuf:
|
||||
files:
|
||||
@@ -14,7 +14,7 @@ protobuf:
|
||||
binaries:
|
||||
default:
|
||||
type: wasm/rust-v1
|
||||
file: ../target/wasm32-unknown-unknown/release/ethereum_balancer.wasm
|
||||
file: ../target/wasm32-unknown-unknown/release/ethereum_balancer_v2.wasm
|
||||
|
||||
modules:
|
||||
- name: map_components
|
||||
@@ -10,7 +10,7 @@ use_field_init_shorthand = true
|
||||
chain_width = 40
|
||||
ignore = [
|
||||
"crates/tycho-substreams/src/pb",
|
||||
"ethereum-balancer/src/abi",
|
||||
"ethereum-balancer-v2/src/abi",
|
||||
"ethereum-sfraxeth/src/abi",
|
||||
"ethereum-curve/src/abi",
|
||||
"ethereum-uniswap-v2/src/abi",
|
||||
|
||||
Reference in New Issue
Block a user