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