RedemptionManager

Write Methods

function redeemCollateral(
        ITroveManager troveManager,
        uint256 _debtAmount,
        uint256 _firstRedemptionHint,
        uint256 _upperPartialRedemptionHint,
        uint256 _lowerPartialRedemptionHint,
        uint256 _partialRedemptionHintNICR,
        uint256 _maxIterations,
        uint256 _maxFeePercentage
    ) external

Main redemption function: exchanges debt tokens for collateral while applying fees and managing Trove state updates.

Input Parameter

Type

Description

troveManager

ITroveManager

The TroveManager handling the redemption.

_debtAmount

uint256

The amount of debt tokens to redeem.

_firstRedemptionHint

uint256

Hint for the first Trove to redeem from (optimizes gas).

_upperPartialRedemptionHint

uint256

Upper hint for partial redemption (reinsertion).

_lowerPartialRedemptionHint

uint256

Lower hint for partial redemption (reinsertion).

_partialRedemptionHintNICR

uint256

Expected Nominal ICR after partial redemption.

_maxIterations

uint256

Max Troves to process (prevents OOG).

_maxFeePercentage

uint256

Maximum acceptable fee percentage (reverts if exceeded).

View Methods

Returns the redemption fee for a given collateral amount, considering the decayed base rate.

Input Parameter

Type

Description

troveManager

ITroveManager

The TroveManager contract.

_collateralDrawn

uint256

The collateral amount being redeemed.

Returns:

Return Value

Type

Description

fee

uint256

The computed redemption fee.

Computes the current redemption rate with decayed base rate.

Input Parameter

Type

Description

troveManager

ITroveManager

The TroveManager contract.

Returns:

Return Value

Type

Description

rate

uint256

The decay-adjusted redemption rate.

Computes the current redemption rate using the latest base rate (without decay).

Input Parameter

Type

Description

troveManager

ITroveManager

The TroveManager contract.

Returns:

Return Value

Type

Description

rate

uint256

The current redemption rate.

Structs

Events

Last updated