😀
Nexus Market
  • Introduction
    • 👋Hi !
    • Overview
      • Start BUIDLing
  • Links
    • Money Market App
    • Github
    • Telegram
  • Concepts
    • At a Glance
      • Supply
      • Borrow
      • Repay
      • Withdraw
      • Liquidation
      • Flash Loan
      • Risks
    • Protocol
      • Liquidity Pool
      • Reserve
      • Oracle
      • Governance
      • Incentives
      • Safety Module
  • LST as Collateral
  • Coming Soon
  • Guides
    • User Flows
    • Follow-on Steps
  • Developers
    • Smart Contract
      • Pool
      • L2 Pool
      • Wrapped Token Gateway
      • View Contracts
      • Incentives
      • Tokenisation
      • Interest Rate Strategy
      • Access Control Manager
      • Oracles
      • PoolAddressesProvider
      • Pool Configurator
      • Switch Adapters
    • Safety Module
    • Governance
    • Flash Loan
      • Premium Distribution
      • Example Calculation
  • Credit Delegation
  • Resources
    • Web3
    • Glossary
    • Contracts Dashboard
      • Ethereum Sepolia
      • Base Sepolia
      • BSC Chapel
    • Parameters Dashboard
    • Access Control Dashboard
    • FAQ
      • General
      • Risk
      • Supplying and Earning
      • Borrowing
      • Liquidations
      • Governance
      • Safety Module
      • Developers
      • Other Features
      • Brand-related
Powered by GitBook
On this page
  • Approving the delegation
  • Borrowing the credit
  • Repaying the credit

Was this helpful?

Credit Delegation

PreviousExample CalculationNextWeb3

Last updated 21 days ago

Was this helpful?

Credit delegation enables a liquidity supplier to deposit assets into the Nexus protocol, earning interest while also granting their borrowing power (i.e., their credit) to other users. The supplier and borrower establish the borrow position and its terms either through offchain legal agreements or onchain smart contracts. This setup allows:

  • The supplier (delegator) to generate additional yield on top of the protocol’s standard interest.

  • The borrower (delegatee) to access liquidity without needing collateral.

The delegatee cannot misuse the credit delegation to liquidate the delegator.

For example, if a borrowing action would drop the delegator’s health factor below the HEALTH_FACTOR_LIQUIDATION_THRESHOLD, the borrow will be rejected.

Approving the delegation

The approveDelegation or delegationWithSig function on the contract must be called by the supplier (delegator), approving the borrower (delegatee) a certain amount.

This is done for each debt token that needs to be delegated.

The delegator does not need to already have supplied funds in the protocol to approveDelegation. However, before the delegatee executes borrow, there must be sufficient collateral supplied by delegator in the protocol.

Borrowing the credit

The borrower (delegatee) calls the borrow function on the , using the supplier's (delegator's) address in final parameter onBehalfOf.

The borrower's available credit is reduced by the borrowed amount.

Repaying the credit

Anyone can repay the borrow position OnBehalf of the user, by calling one of the following functions - repay or repayWithPermit. The supplier (aka creditor) can also use the repayWithZTokens function to repay a borrow position with their zTokens of the underlying asset in the same pool.

VariableDebtToken
Pool
Pool