TermDiscountRateAdapter.sol

Git Source

Inherits: ITermDiscountRateAdapter, AccessControl

State Variables

ORACLE_ROLE

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

TERM_CONTROLLER

ITermController public immutable TERM_CONTROLLER;

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 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

Note: access: Restricted to accounts with the ORACLE_ROLE

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

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

_validateAuctionExistence

function _validateAuctionExistence(AuctionMetadata[] memory auctionMetadata, bytes32 termAuctionId)
    private
    view
    returns (bool auctionExists);

Last updated