TermRepoServicer.sol
This contract belongs to the Term Servicer group of contracts and is specific to a Term Repo deployment. This contract maintains records, collects and disburse repurchase payments.
TermRepoServicer
This contract maintains records, collects and disburse repurchase payments
This contract belongs to the Term Servicer group of contracts and is specific to a Term Repo deployment
YEAR_SECONDS
uint256 YEAR_SECONDS
ADMIN_ROLE
bytes32 ADMIN_ROLE
AUCTION_LOCKER
bytes32 AUCTION_LOCKER
AUCTIONEER
bytes32 AUCTIONEER
COLLATERAL_MANAGER
bytes32 COLLATERAL_MANAGER
DEVOPS_ROLE
bytes32 DEVOPS_ROLE
SPECIALIST_ROLE
bytes32 SPECIALIST_ROLE
ROLLOVER_MANAGER
bytes32 ROLLOVER_MANAGER
ROLLOVER_TARGET_AUCTIONEER_ROLE
bytes32 ROLLOVER_TARGET_AUCTIONEER_ROLE
INITIALIZER_ROLE
bytes32 INITIALIZER_ROLE
termRepoId
bytes32 termRepoId
totalOutstandingRepurchaseExposure
uint256 totalOutstandingRepurchaseExposure
totalRepurchaseCollected
uint256 totalRepurchaseCollected
maturityTimestamp
uint256 maturityTimestamp
endOfRepurchaseWindow
uint256 endOfRepurchaseWindow
redemptionTimestamp
uint256 redemptionTimestamp
block timestamp at which term repo tokens can be redeemed
servicingFee
uint256 servicingFee
percentage share of bid amounts charged to bidder
shortfallHaircutMantissa
uint256 shortfallHaircutMantissa
proportion of redemption value for redemption
purchaseToken
address purchaseToken
termRepoCollateralManager
contract ITermRepoCollateralManager termRepoCollateralManager
termRepoRolloverManager
contract ITermRepoRolloverManager termRepoRolloverManager
termRepoLocker
contract ITermRepoLocker termRepoLocker
termRepoToken
contract ITermRepoToken termRepoToken
termController
contract ITermController termController
emitter
contract ITermEventEmitter emitter
repurchaseExposureLedger
mapping(address => uint256) repurchaseExposureLedger
termContractPaired
bool termContractPaired
notTermContractPaired
modifier notTermContractPaired()
constructor
constructor() public
initialize
function initialize(string termRepoId_, uint256 maturityTimestamp_, uint256 repurchaseWindow_, uint256 redemptionBuffer_, uint256 servicingFee_, address purchaseToken_, contract ITermController termController_, contract ITermEventEmitter emitter_, address termInitializer_) external
pairTermContracts
function pairTermContracts(address termRepoLocker_, address termRepoCollateralManager_, address termRepoToken_, address termAuctionOfferLocker_, address termAuction_, address rolloverManager_, address devopsMultisig_, address adminWallet_, string version_) external
submitRepurchasePayment
function submitRepurchasePayment(uint256 amount) external
The max repurchase amount is the repurchase balance less any amounts earmarked for rollover
Parameters
amount
uint256
The amount of purchase token to submit for repurchase
burnCollapseExposure
function burnCollapseExposure(uint256 amountToBurn) external
Parameters
amountToBurn
uint256
The amount of TermRepoTokens to burn
getBorrowerRepurchaseObligation
function getBorrowerRepurchaseObligation(address borrower) external view returns (uint256)
Parameters
borrower
address
The address of the borrower to query
Return Values
[0]
uint256
The total repurchase price due at maturity for a given borrower
mintOpenExposure
function mintOpenExposure(uint256 amount, uint256[] collateralAmounts) external
This method allows SPECIALIST_ROLE to open repurchase price exposure against a TermRepoToken mint of corresponding value outside of a Term Auction to create new supply
Parameters
amount
uint256
The amount of Term Repo Tokens to mint
collateralAmounts
uint256[]
An array containing an amount of collateral token for each token in collateral basket
redeemTermRepoTokens
function redeemTermRepoTokens(address redeemer, uint256 amountToRedeem) external
Parameters
redeemer
address
The address of redeemer
amountToRedeem
uint256
The amount of TermRepoTokens to redeem
isTermRepoBalanced
function isTermRepoBalanced() external view returns (bool)
Return Values
[0]
bool
A boolean that represents whether the term repo locker is balanced
lockOfferAmount
function lockOfferAmount(address offeror, uint256 amount) external
Parameters
offeror
address
The address of the offeror
amount
uint256
The amount of purchase tokens to lock
unlockOfferAmount
function unlockOfferAmount(address offeror, uint256 amount) external
Parameters
offeror
address
The address of the offeror
amount
uint256
The amount of purchase tokens to unlocked
fulfillOffer
function fulfillOffer(address offeror, uint256 purchasePrice, uint256 repurchasePrice, bytes32 offerId) external
Parameters
offeror
address
The address of the offeror
purchasePrice
uint256
The offer amount to fulfill
repurchasePrice
uint256
The repurchase price due to offeror at maturity
offerId
bytes32
Unique identifier for this offer
fulfillBid
function fulfillBid(address bidder, uint256 purchasePrice, uint256 repurchasePrice, address[] collateralTokens, uint256[] collateralAmounts, uint256 dayCountFractionMantissa) external
Parameters
bidder
address
The address of the bidder
purchasePrice
uint256
The bid amount to fulfill
repurchasePrice
uint256
The repurchase price due at maturity
collateralTokens
address[]
Collateral token addresses
collateralAmounts
uint256[]
Collateral token amounts
dayCountFractionMantissa
uint256
Actual/360 day count fraction parameter from Term Auction Group
approveRolloverAuction
function approveRolloverAuction(address termAuction) external
Parameters
termAuction
address
The address of a TermAuction contract to receive autioneer role
openExposureOnRolloverNew
function openExposureOnRolloverNew(address borrower, uint256 purchasePrice, uint256 repurchasePrice, address previousTermRepoLocker, uint256 dayCountFractionMantissa) external returns (uint256)
Parameters
borrower
address
The address of the borrower rolling into new Term Repo
purchasePrice
uint256
The purchase price received from new TermRepo
repurchasePrice
uint256
The new repurchase price due at maturity of new TermRepo
previousTermRepoLocker
address
The address of the old TermRepoLocker contract
dayCountFractionMantissa
uint256
Actual/360 day count fraction parameter from Term Auction Group
Return Values
[0]
uint256
The net purchase price received in after deducing protocol servicing fees
closeExposureOnRolloverExisting
function closeExposureOnRolloverExisting(address borrower, uint256 rolloverSettlementAmount) external returns (uint256)
Parameters
borrower
address
The address of the borrower
rolloverSettlementAmount
uint256
The amount of net proceeds received from new TermRepo to pay down existing repurchase obligation due to old Term Repo
Return Values
[0]
uint256
A uint256 representing the proportion of total repurchase due to old Term Repo from borrower settled by proceeds from new TermRepo
liquidatorCoverExposure
function liquidatorCoverExposure(address borrower, address liquidator, uint256 amountToCover) external
Parameters
borrower
address
The address of the borrower
liquidator
address
The address of the liquidator
amountToCover
uint256
The amount of repurchase exposure to cover in liquidation
liquidatorCoverExposureWithRepoToken
function liquidatorCoverExposureWithRepoToken(address borrower, address liquidator, uint256 amountOfRepoToken) external returns (uint256)
Parameters
borrower
address
The address of the borrower
liquidator
address
The address of the liquidator
amountOfRepoToken
uint256
The amount of term tokens used to cover in liquidation
Return Values
[0]
uint256
A uint256 representing purchase value of repo tokens burned
grantMintExposureAccess
function grantMintExposureAccess(address authedUser) external
Parameters
authedUser
address
The address of user granted acces to create mint exposure
reopenToNewAuction
function reopenToNewAuction(struct TermAuctionGroup termAuctionGroup) external
Parameters
termAuctionGroup
struct TermAuctionGroup
A struct containing contract addresses of a Term Auction deployment to pair for a reopening of a TermRepo
_isTermRepoBalanced
function _isTermRepoBalanced() internal view returns (bool)
Truncation is by 4 decimal places due to the assumption that number of participants < 10000
_getMaxRepaymentAroundRollover
function _getMaxRepaymentAroundRollover(address borrower) internal view returns (uint256)
_repay
function _repay(address _borrower, address repayer_, uint256 amount_) internal
_parRedemption
function _parRedemption(address redeemer_, uint256 amount_) internal
_proRataRedemption
function _proRataRedemption(address redeemer_, uint256 amount_) internal
_authorizeUpgrade
function _authorizeUpgrade(address impl) internal
required override by the OpenZeppelin UUPS module
Parameters
impl
address
new impl address for proxy upgrade
Last updated