Skip to content

Commit

Permalink
Small change to vault.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
thetroyharris committed Dec 12, 2023
1 parent 64da743 commit 28bdad2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mappings/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +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(), event.block.timestamp);
updatePoolWeights(poolId.toHexString(), blockTimestamp);
} else if (isStableLikePool(pool)) {
// Stablelike pools' amplification factors update over time so we need to update them after each swap
updateAmpFactor(pool, event.block.timestamp);
updateAmpFactor(pool, blockTimestamp);
}

// 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 28bdad2

Please sign in to comment.