Skip to content

Commit d8ddb1f

Browse files
authored
Merge pull request #158 from aave/fix/ink
fix: flashloan premium
2 parents 223ad66 + bc8cd1f commit d8ddb1f

File tree

1 file changed

+3
-1
lines changed
  • src/mapping/lending-pool

1 file changed

+3
-1
lines changed

src/mapping/lending-pool/v3.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,10 @@ export function handleFlashLoan(event: FlashLoan): void {
247247
let pool = Pool.load(poolId) as Pool;
248248

249249
let premium = event.params.premium;
250+
// The event to update the flashloanPremiumToProtocol was deprecated in v3.4, and now always returns a default value of 10000
251+
let flashloanPremiumToProtocol = pool.flashloanPremiumToProtocol || BigInt.fromI32(10000);
250252
let premiumToProtocol = premium
251-
.times(pool.flashloanPremiumToProtocol as BigInt)
253+
.times(flashloanPremiumToProtocol as BigInt)
252254
.plus(BigInt.fromI32(5000))
253255
.div(BigInt.fromI32(10000));
254256
let premiumToLP = premium.minus(premiumToProtocol);

0 commit comments

Comments
 (0)