BorrowLogic

This contract tracks borrow lifecycle events:

  • Borrowing liquidity

  • Repaying debt

  • Switching between stable/variable interest rate

  • Rebalancing rates

  • Debt tracking in isolation mode

Events

  • Borrow(reserve, user, onBehalfOf, amount, interestRateMode, borrowRate, referralCode) Emitted when a user borrows an asset from the protocol.

    • reserve: Asset being borrowed.

    • user: Address initiating the borrow.

    • onBehalfOf: Address that receives the debt.

    • amount: Amount borrowed.

    • interestRateMode: Type of interest rate chosen (stable or variable).

    • borrowRate: Rate applied at the moment of borrowing.

    • referralCode: Referral code for partner integrations.


  • IsolationModeTotalDebtUpdated(asset, totalDebt) Emitted when the total debt of an asset in isolation mode changes.

    • asset: Address of the reserve in isolation mode.

    • totalDebt: Updated total debt for this asset.


  • RebalanceStableBorrowRate(reserve, user) Emitted when a user’s stable borrow rate is rebalanced by the protocol.

    • reserve: Asset where the rebalance occurs.

    • user: Address of the borrower whose stable rate is adjusted.


  • Repay(reserve, user, repayer, amount, useATokens) Emitted when a loan is repaid.

    • reserve: Asset being repaid.

    • user: Borrower whose debt is being reduced.

    • repayer: Address that actually performs the repayment (can be the user or another address).

    • amount: Amount repaid.

    • useATokens: Whether aTokens were used to repay the debt directly.


  • SwapBorrowRateMode(reserve, user, interestRateMode) Emitted when a borrower switches their interest rate mode.

    • reserve: Asset where the swap happens.

    • user: Borrower changing the mode.

    • interestRateMode: New interest rate mode (stable or variable).

Last updated

Was this helpful?