From ca5cd4636336ece74c9d5c67527b3f37f627da7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pr=C3=A9vost?= <998369+prevostc@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:18:48 +0100 Subject: [PATCH] Fix indexing error --- package.json | 6 ++++-- src/mapping/price.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 64b8a4a..c3c1c14 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,12 @@ "deploy-local": "graph deploy beefyfinance/beefy-cl --node http://127.0.0.1:8020 --ipfs http://localhost:5001", "remove-local": "graph remove beefyfinance/beefy-cl --node http://127.0.0.1:8020", "deploy:all": "yarn --silent prepare:arbitrum && yarn --silent deploy:arbitrum && yarn --silent prepare:optimism && yarn --silent deploy:optimism", + "deploy:arbitrum": "yarn --silent prepare:arbitrum && yarn --silent publish:arbitrum", + "deploy:optimism": "yarn --silent prepare:optimism && yarn --silent publish:optimism", "prepare:arbitrum": "mustache config/arbitrum.json subgraph.template.yaml > subgraph.yaml && mustache config/arbitrum.json src/config.template.ts > src/config.ts ", "prepare:optimism": "mustache config/optimism.json subgraph.template.yaml > subgraph.yaml && mustache config/optimism.json src/config.template.ts > src/config.ts ", - "deploy:arbitrum": "0xgraph remove beefyfinance/clm-arbitrum && sleep 10 && 0xgraph create beefyfinance/clm-arbitrum && yarn --silent codegen && 0xgraph build && sleep 5 && 0xgraph deploy beefyfinance/clm-arbitrum --version-label=v0.0.1", - "deploy:optimism": "0xgraph remove beefyfinance/clm-optimism && sleep 10 && 0xgraph create beefyfinance/clm-optimism && yarn --silent codegen && 0xgraph build && sleep 5 && 0xgraph deploy beefyfinance/clm-optimism --version-label=v0.0.1" + "publish:arbitrum": "0xgraph remove beefyfinance/clm-arbitrum && sleep 10 && 0xgraph create beefyfinance/clm-arbitrum && yarn --silent codegen && 0xgraph build && sleep 5 && 0xgraph deploy beefyfinance/clm-arbitrum --version-label=v0.0.1", + "publish:optimism": "0xgraph remove beefyfinance/clm-optimism && sleep 10 && 0xgraph create beefyfinance/clm-optimism && yarn --silent codegen && 0xgraph build && sleep 5 && 0xgraph deploy beefyfinance/clm-optimism --version-label=v0.0.1" }, "main": "./bin/index.js", "bin": { diff --git a/src/mapping/price.ts b/src/mapping/price.ts index 79b7703..a023ab1 100644 --- a/src/mapping/price.ts +++ b/src/mapping/price.ts @@ -97,8 +97,8 @@ export function getVaultPriceRangeInToken1(strategyAddress: Bytes, throwOnError: } // this is purposely inverted as we want prices in token1 const encodingDecimals = BigInt.fromU32(36) - const rangeMinToken1Price = tokenAmountToDecimal(BigInt.fromI32(rangeRes.value.value0), encodingDecimals) - const rangeMaxToken1Price = tokenAmountToDecimal(BigInt.fromI32(rangeRes.value.value1), encodingDecimals) + const rangeMinToken1Price = tokenAmountToDecimal(BigInt.fromU64(rangeRes.value.value0), encodingDecimals) + const rangeMaxToken1Price = tokenAmountToDecimal(BigInt.fromU64(rangeRes.value.value1), encodingDecimals) return new PriceRange(rangeMinToken1Price, rangeMaxToken1Price) }