Skip to content

Commit

Permalink
Build fixes 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
thetroyharris committed Dec 12, 2023
1 parent 10302da commit 5a545e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mappings/helpers/weighted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function updatePoolWeights(poolId: string, blockTimestamp: BigInt): void
let tokenAddress = changetype<Address>(tokensList[i]);
let weight = ZERO;
if (!latestWeightUpdateId) {
weight = scaleDown(weights[i], 18);
weight = weights[i];
} else {
weight = calculateCurrentWeight(
latestUpdate.startWeights[i],
Expand Down
5 changes: 2 additions & 3 deletions src/mappings/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a545e9

Please sign in to comment.