diff --git a/x/hard/keeper/deposit.go b/x/hard/keeper/deposit.go index 3562ca62..23201fc5 100644 --- a/x/hard/keeper/deposit.go +++ b/x/hard/keeper/deposit.go @@ -23,15 +23,19 @@ func (k Keeper) Deposit(ctx sdk.Context, depositor sdk.AccAddress, coins sdk.Coi } } - // Call incentive hook + // Call incentive hooks existingDeposit, hasExistingDeposit := k.GetDeposit(ctx, depositor) if hasExistingDeposit { k.BeforeDepositModified(ctx, existingDeposit) } + existingBorrow, hasExistingBorrow := k.GetBorrow(ctx, depositor) + if hasExistingBorrow { + k.BeforeBorrowModified(ctx, existingBorrow) + } // Sync any outstanding interest - k.SyncBorrowInterest(ctx, depositor) k.SyncSupplyInterest(ctx, depositor) + k.SyncBorrowInterest(ctx, depositor) err := k.ValidateDeposit(ctx, coins) if err != nil {