Jump to content
The Coin Wire

Crypto moves, protocols and policy

How does credit delegation work in Aave V3 forks?

Credit delegation lets a borrower use your collateral through a debt-token allowance; the borrower receives funds, while the delegator carries the debt and liquidation risk.

By The Coin Wire Editorial5 min read

How does credit delegation work in Aave V3 forks?

Credit delegation lets one DeFi user borrow against another user’s collateral: the delegator approves borrowing on a debt token, and the delegatee borrows with the delegator named in onBehalfOf. The delegatee receives the assets, while the debt and its effect on the health factor belong to the delegator.

  • Supply collateral and make sure it is enabled for borrowing.
  • Approve a delegatee on the variable debt token for the asset they may borrow.
  • The delegatee calls borrow() with onBehalfOf set to the delegator.
  • The delegator bears the position’s interest and liquidation risk.

What changes when you delegate credit?

Credit delegation separates the person who receives borrowed tokens from the account that incurs the protocol debt. With an ordinary borrow, one account supplies collateral, borrows the asset, and carries the resulting debt. With delegation, another account can initiate the borrow, but the delegator’s collateral and health factor support it.

That changes who controls the transaction, not who carries the onchain position. The protocol checks the delegator’s collateral and borrowing capacity. If the borrow would take the delegator’s health factor below the required level, the transaction reverts. A later fall in collateral value or rise in debt can still put that position at risk of liquidation.

This is the mechanism described in Aave V3’s credit delegation documentation. Aave V3 forks such as SparkLend use the same basic pattern where their deployed debt-token and pool interfaces support it. For any particular market, confirm the relevant contracts and supported borrow modes on that deployment.

How do the allowance and borrow fit together?

The delegator first supplies collateral and enables it for use. Then the delegator calls approveDelegation(delegatee, amount) on the variable debt token for the asset the delegatee will borrow. This allowance is a borrowing permission recorded by the debt token; it is not an ERC-20 approval giving the Pool permission to move the delegator’s supplied tokens.

The distinction matters because each debt token keeps its own allowance. Approving 10,000 units of WETH variable debt does not give the delegatee permission to borrow DAI. To delegate DAI borrowing, the delegator must approve the delegatee on the DAI variable debt token. The amount limits borrowing in that debt asset, while the delegator’s collateral, market rules, and available borrowing capacity still constrain what can actually be borrowed.

Once approved, the delegatee calls borrow() on the Pool and sets onBehalfOf to the delegator’s address. The Pool checks the allowance on the corresponding debt token, the delegator’s collateral position, and the market’s borrowing conditions. If the call succeeds, the borrowed asset goes to the delegatee and the debt is recorded on the delegator.

The token interface also supports delegationWithSig, which lets the delegator authorize the allowance with an EIP-712 signature. That can avoid a separate approval transaction from the delegator’s wallet; the signature still specifies the delegatee, amount, nonce, and deadline. The contract interface for ICreditDelegationToken defines the approval and signed-approval functions.

Who owes the debt, and who repays it?

The delegator owes the protocol debt and carries the interest and liquidation exposure. The delegatee receives the borrowed asset, but the protocol’s debt position remains on the delegator’s account. Delegation therefore relies on an agreement about what the delegatee will do with the funds, how they will cover interest, and when they will repay.

That agreement may be offchain, or a contract wrapper may impose terms and coordinate repayment. The protocol’s allowance alone does not set repayment terms between the two users. Onchain, another account can repay the debt on the delegator’s behalf using the market’s repayment function; that does not itself establish who is responsible under their separate arrangement.

Take Alice, who supplies wstETH on SparkLend and enables it as collateral. She approves Bob to borrow up to 10,000 DAI on the DAI variable debt token. Bob calls borrow() with Alice’s address as onBehalfOf. DAI is sent to Bob, but the DAI debt and its interest accrue to Alice’s position. The borrow must fit Alice’s available capacity, and any later deterioration in that position puts Alice’s collateral at risk.

How do you close or audit a delegation?

To stop new borrowing, the delegator can set the allowance to zero on the relevant variable debt token. Unused allowance otherwise remains available to that delegatee until it is consumed or replaced by a new allowance. Setting it to zero prevents further use of that permission, but it does not erase debt already borrowed.

Existing debt must be repaid separately. The delegator and delegatee should track both the remaining allowance and the actual debt: one records permission to borrow, the other records what has already been borrowed. When reviewing a position, check the debt token and asset, the delegatee address, allowance amount, debt balance, collateral status, and health factor. Aave V3 forks may share this pattern, while deployment details and supported assets can vary.

  • Allowance is approved per debt token and does not replace collateral.
  • The delegatee receives borrowed assets; the delegator carries the debt and liquidation exposure.
  • Zero the allowance to close unused borrowing permission, then repay any outstanding debt.