feat: move initial lp fee to static attributes (#161)
This initial lp fee value is used for generating the PoolKey. It is static and should be part of the ProtocolComponent static attributes.
This commit is contained in:
2
substreams/Cargo.lock
generated
2
substreams/Cargo.lock
generated
@@ -404,7 +404,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ethereum-uniswap-v4"
|
name = "ethereum-uniswap-v4"
|
||||||
version = "0.1.1"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ethabi 18.0.0",
|
"ethabi 18.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ethereum-uniswap-v4"
|
name = "ethereum-uniswap-v4"
|
||||||
version = "0.1.1"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
specVersion: v0.1.0
|
specVersion: v0.1.0
|
||||||
package:
|
package:
|
||||||
name: "base_uniswap_v4"
|
name: "base_uniswap_v4"
|
||||||
version: v0.1.1
|
version: v0.2.0
|
||||||
|
|
||||||
protobuf:
|
protobuf:
|
||||||
files:
|
files:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
specVersion: v0.1.0
|
specVersion: v0.1.0
|
||||||
package:
|
package:
|
||||||
name: "ethereum_uniswap_v4"
|
name: "ethereum_uniswap_v4"
|
||||||
version: v0.1.1
|
version: v0.2.0
|
||||||
|
|
||||||
protobuf:
|
protobuf:
|
||||||
files:
|
files:
|
||||||
|
|||||||
@@ -37,22 +37,11 @@ fn get_new_pools(
|
|||||||
entity_changes: vec![EntityChanges {
|
entity_changes: vec![EntityChanges {
|
||||||
component_id: event.id.to_vec().to_hex(),
|
component_id: event.id.to_vec().to_hex(),
|
||||||
attributes: vec![
|
attributes: vec![
|
||||||
// Represents the pool's LP Fee. The fee is either static or dynamic.
|
|
||||||
// Static fees are represented in hundredths of a bip, and can be set to a
|
|
||||||
// value between 0 and 1000000 (100%) and are immutable. If
|
|
||||||
// the value is set to 0x800000 (1 in the most significant bit of uint24) then
|
|
||||||
// the pool has a dynamic fee. This pool is initialized
|
|
||||||
// with 0 fee which can be changed later via hooks (dynamic fee).
|
|
||||||
Attribute {
|
Attribute {
|
||||||
name: "balance_owner".to_string(),
|
name: "balance_owner".to_string(),
|
||||||
value: hex::decode(pool_manager_address).unwrap(),
|
value: hex::decode(pool_manager_address).unwrap(),
|
||||||
change: ChangeType::Creation.into(),
|
change: ChangeType::Creation.into(),
|
||||||
},
|
},
|
||||||
Attribute {
|
|
||||||
name: "fee".to_string(),
|
|
||||||
value: event.fee.to_signed_bytes_be(),
|
|
||||||
change: ChangeType::Creation.into(),
|
|
||||||
},
|
|
||||||
Attribute {
|
Attribute {
|
||||||
name: "liquidity".to_string(),
|
name: "liquidity".to_string(),
|
||||||
value: BigInt::from(0).to_signed_bytes_be(),
|
value: BigInt::from(0).to_signed_bytes_be(),
|
||||||
@@ -102,6 +91,18 @@ fn get_new_pools(
|
|||||||
value: event.hooks.to_vec(),
|
value: event.hooks.to_vec(),
|
||||||
change: ChangeType::Creation.into(),
|
change: ChangeType::Creation.into(),
|
||||||
},
|
},
|
||||||
|
// Represents the pool's LP Fee. The fee is either static or dynamic. Static
|
||||||
|
// fees are represented in hundredths of a bip, can be set to a value between 0
|
||||||
|
// and 1000000 (100%) and are immutable. If the value is set to 0x800000 then
|
||||||
|
// the pool is flagged as using dynamic fees. The dynamic fees changes should
|
||||||
|
// be tracked in state attributes and the flag value set
|
||||||
|
// here should remain untouched (it is needed for
|
||||||
|
// generating the PoolKey for contract interactions).
|
||||||
|
Attribute {
|
||||||
|
name: "key_lp_fee".to_string(),
|
||||||
|
value: event.fee.to_signed_bytes_be(),
|
||||||
|
change: ChangeType::Creation.into(),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
change: i32::from(ChangeType::Creation),
|
change: i32::from(ChangeType::Creation),
|
||||||
protocol_type: Some(ProtocolType {
|
protocol_type: Some(ProtocolType {
|
||||||
|
|||||||
Reference in New Issue
Block a user