Skip to content

Commit

Permalink
fix: move update NAV call (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
hieronx committed Jun 1, 2024
1 parent 90d22c3 commit cffc3b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mappings/handlers/blockHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ async function _handleBlock(block: SubstrateBlock): Promise<void> {
const pools = await PoolService.getCfgActivePools()
for (const pool of pools) {
await pool.updateState()
await pool.updateNAV()
await pool.resetDebtOverdue()

// Update tranche states
Expand Down Expand Up @@ -72,6 +71,9 @@ async function _handleBlock(block: SubstrateBlock): Promise<void> {
}
await pool.updateNumberOfActiveAssets(BigInt(Object.keys(activeLoanData).length))

// NAV update requires updated offchain cash value
await pool.updateNAV()

//PoolFees operations
const accruedFees = await pool.getAccruedFees()
for (const accruals of accruedFees) {
Expand Down

0 comments on commit cffc3b3

Please sign in to comment.