Function: redeem(TokenType tokenType, uint256 depositAmount, uint256 minAmount)

This function is used to redeem bond or leverage tokens for reserve tokens. The function calculates the amount of reserve tokens to receive based on the current pool state and oracle price.

Inputs

  • tokenType

    • Control: Arbitrary.

    • Constraints: Bond or leverage token.

    • Impact: Type of token to redeem.

  • depositAmount

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: The amount of derivative tokens to redeem.

  • minAmount

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: The minimum amount of reserve tokens to receive.

Branches and code coverage

Intended branches

  • Invoke the _redeem function.

Negative behavior

  • Revert if the contract is paused.

  • Revert if the function is reentrant.

Zellic © 2025Back to top ↑