0g-chain/x/hard/spec/06_begin_block.md

16 lines
321 B
Markdown
Raw Normal View History

<!--
order: 6
-->
# Begin Block
At the start of each block, interest is accumulated, and automated liquidations are attempted
```go
// BeginBlocker updates interest rates and attempts liquidations
func BeginBlocker(ctx sdk.Context, k Keeper) {
k.ApplyInterestRateUpdates(ctx)
k.AttemptIndexLiquidations(ctx)
}
```