Skip to content

Commit 78f6cb2

Browse files
authored
Merge pull request #88 from propeller-heads/zz/substreams/fix-balancer-balance
fix(balancer): index `PoolBalanceManaged` balance changes
2 parents eac73e4 + 18f4446 commit 78f6cb2

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

substreams/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

substreams/ethereum-balancer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ethereum-balancer"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55

66
[lib]

substreams/ethereum-balancer/src/modules.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ pub fn map_relative_balances(
113113
},
114114
]);
115115
}
116+
} else if let Some(ev) =
117+
abi::vault::events::PoolBalanceManaged::match_and_decode(vault_log.log)
118+
{
119+
let component_id = format!("0x{}", hex::encode(ev.pool_id));
120+
deltas.extend_from_slice(&[BalanceDelta {
121+
ord: vault_log.ordinal(),
122+
tx: Some(vault_log.receipt.transaction.into()),
123+
token: ev.token.to_vec(),
124+
delta: ev.cash_delta.to_signed_bytes_be(),
125+
component_id: component_id.as_bytes().to_vec(),
126+
}]);
116127
}
117128

118129
deltas

substreams/ethereum-balancer/substreams.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
specVersion: v0.1.0
22
package:
33
name: "ethereum_balancer"
4-
version: v0.2.1
4+
version: v0.2.2
55

66
protobuf:
77
files:

0 commit comments

Comments
 (0)