TransactionSEALED
▓◆░$^#■!@▒╲○◆■●█○◆◇#◇^?●█◆█●╲╱▫■●░░~◆##●~╳@@▒■●▒■◆?&░░#~╲~█◇▪&■■
Transaction ID
Execution Fee
0.00004292 FLOWTransaction Summary
Contract CallCalled LendingAprSnapshot, LendingComptroller, LendingConfig +1 more
Script Arguments
Cadence Script
1import LendingAprSnapshot from 0x5da615e7385f307a
2import LendingComptroller from 0xf80cb737bfe7c792
3import LendingConfig from 0x2df970b6cdee5735
4import LendingInterfaces from 0x2df970b6cdee5735
5
6// Bot periodically sample all lending markets' apr data and store them on-chain.
7transaction() {
8 prepare(bot: &Account) {
9 let comptrollerRef = getAccount(LendingComptroller.comptrollerAddress).capabilities.borrow<&{LendingInterfaces.ComptrollerPublic}>(LendingConfig.ComptrollerPublicPath)
10 ?? panic("cannot borrow reference to ComptrollerPublic")
11
12 let poolArrays = comptrollerRef.getAllMarkets()
13 for poolAddr in poolArrays {
14 let sampled = LendingAprSnapshot.sample(poolAddr: poolAddr)
15 getAccount(poolAddr).capabilities.borrow<&{LendingInterfaces.PoolPublic}>(/public/incrementLendingPoolPublic)!.accrueInterest()
16 }
17 }
18}