diff --git a/substreams/Cargo.lock b/substreams/Cargo.lock index 0b3e18b..3f88db1 100644 --- a/substreams/Cargo.lock +++ b/substreams/Cargo.lock @@ -420,6 +420,25 @@ dependencies = [ "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", ] +[[package]] +name = "ethereum-uniswap-v3" +version = "0.3.0" +dependencies = [ + "anyhow", + "ethabi 18.0.0", + "getrandom", + "hex", + "hex-literal 0.4.1", + "num-bigint", + "prost 0.11.9", + "substreams", + "substreams-entity-change", + "substreams-ethereum", + "substreams-helper 0.0.2 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", + "tiny-keccak", + "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", +] + [[package]] name = "ethereum-uniswap-v3-logs-only" version = "0.1.1" @@ -1406,25 +1425,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "substreams-ethereum-uniswap-v3" -version = "0.2.1" -dependencies = [ - "anyhow", - "ethabi 18.0.0", - "getrandom", - "hex", - "hex-literal 0.4.1", - "num-bigint", - "prost 0.11.9", - "substreams", - "substreams-entity-change", - "substreams-ethereum", - "substreams-helper 0.0.2 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", - "tiny-keccak", - "tycho-substreams 0.2.0 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=b8aeaa3)", -] - [[package]] name = "substreams-helper" version = "0.0.2" diff --git a/substreams/ethereum-uniswap-v3/Cargo.toml b/substreams/ethereum-uniswap-v3/Cargo.toml index cd2bc2c..e397cba 100644 --- a/substreams/ethereum-uniswap-v3/Cargo.toml +++ b/substreams/ethereum-uniswap-v3/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "substreams-ethereum-uniswap-v3" -version = "0.2.1" +name = "ethereum-uniswap-v3" +version = "0.3.0" edition = "2021" [lib] -name = "substreams_ethereum_uniswap_v3" +name = "ethereum_uniswap_v3" crate-type = ["cdylib"] [dependencies] diff --git a/substreams/ethereum-uniswap-v3/arbitrum-uniswap-v3.yaml b/substreams/ethereum-uniswap-v3/arbitrum-uniswap-v3.yaml index 5498de4..d792953 100644 --- a/substreams/ethereum-uniswap-v3/arbitrum-uniswap-v3.yaml +++ b/substreams/ethereum-uniswap-v3/arbitrum-uniswap-v3.yaml @@ -1,7 +1,9 @@ specVersion: v0.1.0 package: - name: "substreams_arbitrum_uniswap_v3" - version: v0.2.1 + name: "arbitrum_uniswap_v3" + version: v0.3.0 + url: "https://github.com/propeller-heads/tycho-protocol-sdk/tree/main/substreams/ethereum-uniswap-v3" + protobuf: files: @@ -15,7 +17,7 @@ protobuf: binaries: default: type: wasm/rust-v1 - file: ../../target/wasm32-unknown-unknown/substreams/substreams_ethereum_uniswap_v3.wasm + file: ../target/wasm32-unknown-unknown/release/ethereum_uniswap_v3.wasm modules: - name: map_pools_created diff --git a/substreams/ethereum-uniswap-v3/ethereum-uniswap-v3.yaml b/substreams/ethereum-uniswap-v3/ethereum-uniswap-v3.yaml index db38c86..c5c2286 100644 --- a/substreams/ethereum-uniswap-v3/ethereum-uniswap-v3.yaml +++ b/substreams/ethereum-uniswap-v3/ethereum-uniswap-v3.yaml @@ -1,7 +1,8 @@ specVersion: v0.1.0 package: - name: "substreams_ethereum_uniswap_v3" - version: v0.2.1 + name: "ethereum_uniswap_v3" + version: v0.3.0 + url: "https://github.com/propeller-heads/tycho-protocol-sdk/tree/main/substreams/ethereum-uniswap-v3" protobuf: files: @@ -15,7 +16,7 @@ protobuf: binaries: default: type: wasm/rust-v1 - file: ../../target/wasm32-unknown-unknown/substreams/substreams_ethereum_uniswap_v3.wasm + file: ../target/wasm32-unknown-unknown/release/ethereum_uniswap_v3.wasm modules: - name: map_pools_created diff --git a/substreams/ethereum-uniswap-v3/src/modules/1_map_pool_created.rs b/substreams/ethereum-uniswap-v3/src/modules/1_map_pool_created.rs index fbe4e60..44d53ea 100644 --- a/substreams/ethereum-uniswap-v3/src/modules/1_map_pool_created.rs +++ b/substreams/ethereum-uniswap-v3/src/modules/1_map_pool_created.rs @@ -40,17 +40,17 @@ fn get_new_pools( attributes: vec![ Attribute { name: "liquidity".to_string(), - value: BigInt::from(0).to_signed_bytes_le(), + value: BigInt::from(0).to_signed_bytes_be(), change: ChangeType::Creation.into(), }, Attribute { name: "tick".to_string(), - value: BigInt::from(0).to_signed_bytes_le(), + value: BigInt::from(0).to_signed_bytes_be(), change: ChangeType::Creation.into(), }, Attribute { name: "sqrt_price_x96".to_string(), - value: BigInt::from(0).to_signed_bytes_le(), + value: BigInt::from(0).to_signed_bytes_be(), change: ChangeType::Creation.into(), }, ], @@ -62,12 +62,12 @@ fn get_new_pools( static_att: vec![ Attribute { name: "fee".to_string(), - value: event.fee.to_signed_bytes_le(), + value: event.fee.to_signed_bytes_be(), change: ChangeType::Creation.into(), }, Attribute { name: "tick_spacing".to_string(), - value: event.tick_spacing.to_signed_bytes_le(), + value: event.tick_spacing.to_signed_bytes_be(), change: ChangeType::Creation.into(), }, Attribute { diff --git a/substreams/ethereum-uniswap-v3/src/storage/pool_storage.rs b/substreams/ethereum-uniswap-v3/src/storage/pool_storage.rs index 5569ef5..c0fc2c7 100644 --- a/substreams/ethereum-uniswap-v3/src/storage/pool_storage.rs +++ b/substreams/ethereum-uniswap-v3/src/storage/pool_storage.rs @@ -77,7 +77,7 @@ impl<'a> UniswapPoolStorage<'a> { }; attributes.push(Attribute { name: storage_location.name.to_string(), - value: value.to_signed_bytes_le(), + value: value.to_signed_bytes_be(), change: ChangeType::Update.into(), }); } @@ -108,7 +108,7 @@ impl<'a> UniswapPoolStorage<'a> { // We need this to keep the references to the names alive until we call // `get_changed_attributes()` for tick_idx in ticks_idx.iter() { - tick_names.push(format!("ticks/{}/net-liquidity", tick_idx)); + tick_names.push(format!("ticks/{tick_idx}/net-liquidity")); } // Then, iterate over ticks_idx and tick_names simultaneously