Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move update NAV call #181

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading