Debt Management

Borrow and repay the underlying token.

For SDK implementation, see Debt Management.

Why

Debt management enables leveraged positions:

  • Increase debt - Borrow to deploy capital into DeFi strategies

  • Decrease debt - Repay to reduce interest costs or close position

  • Partial repayment - Reduce exposure while keeping position open

Debt directly affects your health factor. Higher debt lowers health factor; lower debt raises it.

What

Two operations manage debt:

Operation
Description

increaseDebt

Borrow underlying token from the pool

decreaseDebt

Repay underlying token to the pool

Increase Debt Flow

  1. Pool transfers underlying to Credit Account

  2. Debt counter incremented

  3. Interest starts accruing immediately

Decrease Debt Flow

  1. Underlying transferred from Credit Account to pool

  2. Debt counter decremented

  3. Full repayment enables special "zero debt" mode

How

Borrowing

Repaying

Combined Strategy: Add Collateral + Borrow

Typical account opening pattern:

Gotchas

Same-Block Restriction

Debt cannot be increased AND decreased in the same block:

Debt Limits

The resulting debt must be within configured limits:

Per-Block Borrowing Limit

Total borrowing in a block is limited:

Forbidden Tokens Block Borrowing

If account has forbidden tokens enabled as collateral, borrowing is blocked:

Solution: Swap forbidden tokens to allowed ones first.

Zero Debt Mode

Full repayment (decreaseDebt(type(uint256).max)) enables zero debt mode:

  • Collateral checks are skipped

  • All quotas must be disabled (zero)

  • Account can be closed without collateral check

Opening vs Closing Restrictions

Operation
On Open
On Close

increaseDebt

Allowed

Prohibited

decreaseDebt

Prohibited

Allowed

See Also

Last updated