🖥️
Term Finance v1 Developer Documentation
  • Overview
  • Term Finance Protocol
    • Term Repo
      • Term Auction Group
        • Initialization Parameters
        • Administrative Functions
      • Term Servicer Group
        • Initialization Parameters
        • Administrative Functions
      • Term Repo Token
        • Initialization Parameters
        • Administrative Functions
    • Protocol Contracts
      • Price Feeds
    • Conventions
    • Terminology
  • Access Controls
    • Upgradeability
  • Deployed Contracts
    • Smart Contract Audits
    • Formal Verification
    • [Ethereum]
    • [Avalanche]
  • Protocol Security
    • Smart Contract Monitoring
    • Front-End Security
  • Solidity API - latest
    • Term Repo Class
      • Term Auction Group
        • TermAuction.sol
        • TermAuctionBidLocker.sol
        • TermAuctionOfferLocker.sol
      • Term Servicer Group
        • TermRepoServicer.sol
        • TermRepoLocker.sol
        • TermRepoCollateralManager.sol
        • TermRepoRolloverManager.sol
      • TermRepoToken.sol
    • Protocol Class
      • TermController.sol
      • TermEventEmitter.sol
      • TermInitializer.sol
      • TermPriceConsumerV3.sol
  • Solidity API - 0.5.31
    • Term Repo Class
      • Term Auction Group
        • TermAuction.sol
        • TermAuctionBidLocker.sol
        • TermAuctionOfferLocker.sol
      • Term Servicer Group
        • TermRepoServicer.sol
        • TermRepoLocker.sol
        • TermRepoCollateralManager.sol
        • TermRepoRolloverManager.sol
      • TermRepoToken.sol
    • Protocol Class
      • TermController.sol
      • TermEventEmitter.sol
      • TermInitializer.sol
      • TermPriceConsumerV3.sol
  • Solidity API - 0.5.32
    • Term Repo Class
      • Term Auction Group
        • TermAuction.sol
        • TermAuctionBidLocker.sol
        • TermAuctionOfferLocker.sol
      • Term Servicer Group
        • TermRepoServicer.sol
        • TermRepoLocker.sol
        • TermRepoCollateralManager.sol
        • TermRepoRolloverManager.sol
      • TermRepoToken.sol
    • Protocol Class
      • TermController.sol
      • TermEventEmitter.sol
      • TermInitializer.sol
      • TermPriceConsumerV3.sol
  • Solidity API - 0.6.0
    • Term Repo Class
      • Term Auction Group
        • TermAuction.sol
        • TermAuctionBidLocker.sol
        • TermAuctionOfferLocker.sol
      • Term Servicer Group
        • TermRepoServicer.sol
        • TermRepoLocker.sol
        • TermRepoCollateralManager.sol
        • TermRepoRolloverManager.sol
      • TermRepoToken.sol
    • Protocol Class
      • TermController.sol
      • TermEventEmitter.sol
      • TermInitializer.sol
      • TermPriceConsumerV3.sol
  • Solidity API - 0.9.0
    • Term Repo Class
      • Term Auction Group
        • TermAuction.sol
        • TermAuctionBidLocker.sol
        • TermAuctionOfferLocker.sol
      • Term Servicer Group
        • TermRepoServicer.sol
        • TermRepoLocker.sol
        • TermRepoCollateralManager.sol
        • TermRepoRolloverManager.sol
      • TermRepoToken.sol
    • Protocol Class
      • TermController.sol
      • TermEventEmitter.sol
      • TermInitializer.sol
      • TermPriceConsumerV3.sol
  • DeFiSafety - detailed report
  • Github Repo
  • Periphery Contracts
    • Blue Sheets
      • Core Architecture
      • Core Functionality
      • Administration
      • Deployed Contracts
        • Smart Contract Audits
        • [Ethereum]
      • Solidity API - latest
        • RepoTokenLinkedList.sol#RepoTokenLinkedList
        • RepoTokenLinkedList.sol#RepoTokenLinkedListStorageV1
        • RepoTokenLinkedListEventEmitter.sol
        • TermDiscountRateAdapter.sol
    • Github Repo
    • Term Strategy Vaults
      • Core Architecture
        • Yearn V3 Framework
        • Term Integration
      • Core Functionality
        • YearnV3 Base Operations
        • Term Protocol Operations
          • Core Integration
          • Portfolio Valuation
          • Protocol Interactions
          • Portfolio Constraints
      • Administration
        • Yearn Roles & Governance
        • Term Vault Governance
      • Configuration Guide
      • Deployed Contracts
        • Smart Contract Audits
        • [Ethereum]
      • Solidity API - latest
        • RepoTokenList.sol#RepoTokenList
        • RepoTokenList.sol#RepoTokenListData
        • RepoTokenList.sol#RepoTokenListNode
        • RepoTokenUtils.sol#RepoTokenUtils
        • Strategy.sol#Strategy
        • TermAuctionList.sol#TermAuctionList
        • TermAuctionList.sol#PendingOffer
        • TermAuctionList.sol#TermAuctionListData
        • TermAuctionList.sol#TermAuctionListNode
        • TermDiscountRateAdapter.sol#TermDiscountRateAdapter
        • TermVaultEventEmitter.sol#TermVaultEventEmitter
        • TermFinanceVaultWrappedVotesToken.sol#TermFinanceVaultWrappedVotesToken
    • Github Repo
Powered by GitBook
On this page
  • State Variables
  • ORACLE_ROLE
  • prevTermController
  • currTermController
  • rateInvalid
  • repoRedemptionHaircut
  • Functions
  • constructor
  • getDiscountRate
  • getDiscountRate
  • setAuctionRateValidator
  • setTermController
  • setRepoRedemptionHaircut
  • _identifyTermController
  • _getDiscountRate
  • _validateAuctionExistence
  1. Periphery Contracts
  2. Term Strategy Vaults
  3. Solidity API - latest

TermDiscountRateAdapter.sol#TermDiscountRateAdapter

Last updated 4 months ago

Inherits: , AccessControl

State Variables

ORACLE_ROLE

bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE");

prevTermController

Previous term controller

ITermController public prevTermController;

currTermController

Current term controller

ITermController public currTermController;

rateInvalid

mapping(address => mapping(bytes32 => bool)) public rateInvalid;

repoRedemptionHaircut

mapping(address => uint256) public repoRedemptionHaircut;

Functions

constructor

constructor(address termController_, address oracleWallet_);

getDiscountRate

Retrieves the discount rate for a given repo token

This function fetches the auction results for the repo token's term repo ID and returns the clearing rate of the most recent auction

function getDiscountRate(address termController, address repoToken) public view virtual returns (uint256);

Parameters

Name
Type
Description

termController

address

The address of the term controller

repoToken

address

The address of the repo token

Returns

Name
Type
Description

<none>

uint256

The discount rate for the specified repo token

getDiscountRate

Retrieves the discount rate for a given repo token

This function fetches the auction results for the repo token's term repo ID and returns the clearing rate of the most recent auction

function getDiscountRate(address repoToken) public view virtual returns (uint256);

Parameters

Name
Type
Description

repoToken

address

The address of the repo token

Returns

Name
Type
Description

<none>

uint256

The discount rate for the specified repo token

setAuctionRateValidator

Sets the invalidity of the result of a specific auction for a given repo token

This function is used to mark auction results as invalid or not, typically in cases of suspected manipulation

function setAuctionRateValidator(address repoToken, bytes32 termAuctionId, bool isInvalid)
    external
    onlyRole(ORACLE_ROLE);

Parameters

Name
Type
Description

repoToken

address

The address of the repo token associated with the auction

termAuctionId

bytes32

The unique identifier of the term auction to be invalidated

isInvalid

bool

The status of the rate invalidation

setTermController

Sets the term controller

function setTermController(address termController) external onlyRole(ORACLE_ROLE);

Parameters

Name
Type
Description

termController

address

The address of the term controller

setRepoRedemptionHaircut

Set the repo redemption haircut

function setRepoRedemptionHaircut(address repoToken, uint256 haircut) external onlyRole(ORACLE_ROLE);

Parameters

Name
Type
Description

repoToken

address

The address of the repo token

haircut

uint256

The repo redemption haircut in 18 decimals

_identifyTermController

function _identifyTermController(address termRepoToken) internal view returns (ITermController);

_getDiscountRate

function _getDiscountRate(ITermController termController, address repoToken) internal view returns (uint256);

_validateAuctionExistence

function _validateAuctionExistence(AuctionMetadata[] memory auctionMetadata, bytes32 termAuctionId)
    private
    pure
    returns (bool auctionExists);
Git Source
ITermDiscountRateAdapter