TransactionSEALED

▓◆░$^#■!@▒╲○◆■●█○◆◇#◇^?●█◆█●╲╱▫■●░░~◆##●~╳@@▒■●▒■◆?&░░#~╲~█◇▪&■■

Transaction ID

Timestamp

Sep 05, 2024, 12:47:02 PM UTC
1y ago

Block Height

86,041,824

Computation

0

Execution Fee

0.00004292 FLOW

Proposerseq:1186 key:5

Authorizers

1

Transaction Summary

Contract Call

Called 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}