feat(usv2): set default balances on pool creation
This commit is contained in:
2
substreams/Cargo.lock
generated
2
substreams/Cargo.lock
generated
@@ -310,7 +310,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ethereum-uniswap-v2"
|
name = "ethereum-uniswap-v2"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ethabi 18.0.0",
|
"ethabi 18.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ethereum-uniswap-v2"
|
name = "ethereum-uniswap-v2"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ fn get_pools(block: ð::Block, new_pools: &mut Vec<TransactionChanges>, params
|
|||||||
}],
|
}],
|
||||||
component_changes: vec![ProtocolComponent {
|
component_changes: vec![ProtocolComponent {
|
||||||
id: event.pair.to_hex(),
|
id: event.pair.to_hex(),
|
||||||
tokens: vec![event.token0, event.token1],
|
tokens: vec![event.token0.clone(), event.token1.clone()],
|
||||||
contracts: vec![],
|
contracts: vec![],
|
||||||
static_att: vec![
|
static_att: vec![
|
||||||
// Trading Fee is hardcoded to 0.3%, saved as int in bps (basis points)
|
// Trading Fee is hardcoded to 0.3%, saved as int in bps (basis points)
|
||||||
@@ -69,7 +69,7 @@ fn get_pools(block: ð::Block, new_pools: &mut Vec<TransactionChanges>, params
|
|||||||
},
|
},
|
||||||
Attribute {
|
Attribute {
|
||||||
name: "pool_address".to_string(),
|
name: "pool_address".to_string(),
|
||||||
value: event.pair,
|
value: event.pair.clone(),
|
||||||
change: ChangeType::Creation.into(),
|
change: ChangeType::Creation.into(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -82,7 +82,18 @@ fn get_pools(block: ð::Block, new_pools: &mut Vec<TransactionChanges>, params
|
|||||||
}),
|
}),
|
||||||
tx: Some(tycho_tx),
|
tx: Some(tycho_tx),
|
||||||
}],
|
}],
|
||||||
balance_changes: vec![],
|
balance_changes: vec![
|
||||||
|
BalanceChange {
|
||||||
|
token: event.token0,
|
||||||
|
balance: BigInt::from(0).to_signed_bytes_be(),
|
||||||
|
component_id: event.pair.clone(),
|
||||||
|
},
|
||||||
|
BalanceChange {
|
||||||
|
token: event.token1,
|
||||||
|
balance: BigInt::from(0).to_signed_bytes_be(),
|
||||||
|
component_id: event.pair,
|
||||||
|
},
|
||||||
|
],
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user