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_SECONDSADMIN_ROLE
bytes32 ADMIN_ROLEAUCTION_LOCKER
bytes32 AUCTION_LOCKERAUCTIONEER
bytes32 AUCTIONEERCOLLATERAL_MANAGER
bytes32 COLLATERAL_MANAGERDEVOPS_ROLE
bytes32 DEVOPS_ROLESPECIALIST_ROLE
bytes32 SPECIALIST_ROLEROLLOVER_MANAGER
bytes32 ROLLOVER_MANAGERROLLOVER_TARGET_AUCTIONEER_ROLE
bytes32 ROLLOVER_TARGET_AUCTIONEER_ROLEINITIALIZER_ROLE
bytes32 INITIALIZER_ROLEtermRepoId
bytes32 termRepoIdtotalOutstandingRepurchaseExposure
uint256 totalOutstandingRepurchaseExposuretotalRepurchaseCollected
uint256 totalRepurchaseCollectedmaturityTimestamp
uint256 maturityTimestampendOfRepurchaseWindow
uint256 endOfRepurchaseWindowredemptionTimestamp
uint256 redemptionTimestampblock timestamp at which term repo tokens can be redeemed
servicingFee
uint256 servicingFeepercentage share of bid amounts charged to bidder
shortfallHaircutMantissa
uint256 shortfallHaircutMantissaproportion of redemption value for redemption
purchaseToken
address purchaseTokentermRepoCollateralManager
contract ITermRepoCollateralManager termRepoCollateralManagertermRepoRolloverManager
contract ITermRepoRolloverManager termRepoRolloverManagertermRepoLocker
contract ITermRepoLocker termRepoLockertermRepoToken
contract ITermRepoToken termRepoTokentermController
contract ITermController termControlleremitter
contract ITermEventEmitter emitterrepurchaseExposureLedger
mapping(address => uint256) repurchaseExposureLedgertermContractPaired
bool termContractPairednotTermContractPaired
modifier notTermContractPaired()constructor
constructor() publicinitialize
function initialize(string termRepoId_, uint256 maturityTimestamp_, uint256 repurchaseWindow_, uint256 redemptionBuffer_, uint256 servicingFee_, address purchaseToken_, contract ITermController termController_, contract ITermEventEmitter emitter_, address termInitializer_) externalpairTermContracts
function pairTermContracts(address termRepoLocker_, address termRepoCollateralManager_, address termRepoToken_, address termAuctionOfferLocker_, address termAuction_, address rolloverManager_, address devopsMultisig_, address adminWallet_, string version_) externalsubmitRepurchasePayment
function submitRepurchasePayment(uint256 amount) externalThe 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) externalParameters
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) externalThis 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) externalParameters
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) externalParameters
offeror
address
The address of the offeror
amount
uint256
The amount of purchase tokens to lock
unlockOfferAmount
function unlockOfferAmount(address offeror, uint256 amount) externalParameters
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) externalParameters
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) externalParameters
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) externalParameters
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) externalParameters
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) externalParameters
authedUser
address
The address of user granted acces to create mint exposure
reopenToNewAuction
function reopenToNewAuction(struct TermAuctionGroup termAuctionGroup) externalParameters
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) internalrequired override by the OpenZeppelin UUPS module
Parameters
impl
address
new impl address for proxy upgrade
Last updated