From 5a545e95226b280c5f39165c1cc97bcff8a0f1f0 Mon Sep 17 00:00:00 2001 From: thetroyharris Date: Tue, 12 Dec 2023 17:07:26 -0500 Subject: [PATCH] Build fixes 2. --- src/mappings/helpers/weighted.ts | 2 +- src/mappings/vault.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mappings/helpers/weighted.ts b/src/mappings/helpers/weighted.ts index da0ff0c8..d3ea8407 100644 --- a/src/mappings/helpers/weighted.ts +++ b/src/mappings/helpers/weighted.ts @@ -35,7 +35,7 @@ export function updatePoolWeights(poolId: string, blockTimestamp: BigInt): void let tokenAddress = changetype
(tokensList[i]); let weight = ZERO; if (!latestWeightUpdateId) { - weight = scaleDown(weights[i], 18); + weight = weights[i]; } else { weight = calculateCurrentWeight( latestUpdate.startWeights[i], diff --git a/src/mappings/vault.ts b/src/mappings/vault.ts index 81bf70f5..54952375 100644 --- a/src/mappings/vault.ts +++ b/src/mappings/vault.ts @@ -478,14 +478,13 @@ export function handleSwapEvent(event: SwapEvent): void { // pool.swapEnabled = true; // } - let blockTimestamp = event.block.timestamp; if (isVariableWeightPool(pool)) { // Some pools' weights update over time so we need to update them after each swap - updatePoolWeights(poolId.toHexString(), blockTimestamp); + updatePoolWeights(poolId.toHexString(), event.block.timestamp); log.debug('updatePoolWeights called: {}', [poolId.toHexString()]); } else if (isStableLikePool(pool)) { // Stablelike pools' amplification factors update over time so we need to update them after each swap - updateAmpFactor(pool, blockTimestamp); + updateAmpFactor(pool, event.block.timestamp); } // If swapping on a pool with preminted BPT and the BPT itself is being swapped then this is equivalent to a mint/burn in a regular pool