TermRepoCollateralManager.sol
This contract belongs to the Term Servicer group of contracts and is specific to a Term Repo deployment. This contract enforces margin maintenance rules for adding/withdrawing, and liquidating tokens.
TermRepoCollateralManager
This contract enforces margin maintenance rules for adding/withdrawing, repurchasing and liquidating collateral
This contract belongs to the Term Servicer group of contracts and is specific to a Term Repo deployment
ADMIN_ROLE
AUCTION_LOCKER
DEVOPS_ROLE
INITIALIZER_ROLE
SERVICER_ROLE
ROLLOVER_MANAGER
ROLLOVER_TARGET_AUCTIONEER_ROLE
termRepoId
liquidationsPaused
termContractPaired
numOfAcceptedCollateralTokens
deMinimisMarginThreshold
liquidatedDamagesDueToProtocol
netExposureCapOnLiquidation
termRepoServicer
purchaseToken
termPriceOracle
termRepoLocker
termController
emitter
collateralTokens
encumberedCollateralBalances
maintenanceCollateralRatios
initialCollateralRatios
liquidatedDamages
lockedCollateralLedger
isCollateralTokenAccepted
whileLiquidationsNotPaused
notTermContractPaired
constructor
initialize
pairTermContracts
externalLockCollateral
Parameters
collateralToken
address
The address of the collateral token to lock
amount
uint256
The amount of collateral token to lock
externalUnlockCollateral
Parameters
collateralToken
address
The address of the collateral token to unlock
amount
uint256
The amount of collateral token to unlock
batchLiquidation
Parameters
borrower
address
The address of the borrower
closureAmounts
uint256[]
An array specifying the amounts of Term Repo exposure the liquidator proposes to cover in liquidation; an amount is required to be specified for each collateral token
batchLiquidationWithRepoToken
Parameters
borrower
address
The address of the borrower
closureRepoTokenAmounts
uint256[]
An array specifying the amounts of Term Repo Tokens the liquidator proposes to cover borrower repo exposure in liquidation; an amount is required to be specified for each collateral token
batchDefault
Parameters
borrower
address
The address of the borrower
closureAmounts
uint256[]
An array specifying the amounts of Term Repo exposure the liquidator proposes to cover in liquidation; an amount is required to be specified for each collateral token
calculateMintableExposure
Parameters
collateralToken
address
The collateral token address of tokens locked
amountToLock
uint256
The amount of collateral tokens to lock
getCollateralBalances
Parameters
borrower
address
The address of the borrower
Return Values
[0]
address[]
An array of collateral token addresses
[1]
uint256[]
An array collateral token balances locked on behalf of borrower
getCollateralBalance
Parameters
borrower
address
The address of the borrower
collateralToken
address
The collateral token address to query
Return Values
[0]
uint256
uint256 The amount of collateralToken locked on behalf of borrower
encumberedCollateralRemaining
Return Values
[0]
bool
bool A boolean that tests whether any encumbered collateral remains locked
auctionLockCollateral
Parameters
bidder
address
The bidder's address
collateralToken
address
The address of the token to be used as collateral
amount
uint256
The amount of the token to lock
auctionUnlockCollateral
Parameters
bidder
address
The bidder's address
collateralToken
address
The address of the token used as collateral
amount
uint256
The amount of collateral tokens to unlock
acceptRolloverCollateral
Parameters
borrower
address
The address of the borrower
collateralToken
address
The address of a collateral token
amount
uint256
The amount of collateral tokens to lock
transferRolloverCollateral
Parameters
borrower
address
The borrower's address
rolloverProportion
uint256
The proportion of the collateral to be unlocked, equal to the proportion of the collateral repaid
rolloverTermRepoLocker
address
The address of the new TermRepoLocker contract to roll into
Return Values
[0]
address[]
An array representing a list of accepted collateral token addresses
[1]
uint256[]
An array containing the amount of collateral tokens to pairoff and transfer to new TermRepoLocker to roll into
approveRolloverAuction
Parameters
rolloverAuction
address
The address of the rollover auction
unlockCollateralOnRepurchase
Parameters
borrower
address
The address of the borrower
journalBidCollateralToCollateralManager
Parameters
borrower
address
The address of the borrower
collateralTokenAddresses
address[]
Collateral token addresses
collateralTokenAmounts
uint256[]
Collateral token amounts
mintOpenExposureLockCollateral
Parameters
borrower
address
The address of the borrower
collateralToken
address
Collateral token addresse
amount
uint256
Collateral token amount
reopenToNewAuction
Parameters
termAuctionGroup
struct TermAuctionGroup
A struct of auction contracts
pauseLiquidations
unpauseLiquidations
isBorrowerInShortfall
Parameters
borrower
address
The address of the borrower
Return Values
[0]
bool
Boolean testing whether the given borrower is in shortfall or margin deficit
getCollateralMarketValue
Parameters
borrower
address
The address of the borrower
Return Values
[0]
uint256
The market value of borrower's locked collateral denominated in USD
_lockCollateral
_unlockCollateral
_partialUnlockCollateral
_validateBatchLiquidationForFullLiquidation
A helper function to validate various conditions required to liquidate
Return Values
[0]
bool
A boolean for whether borrower position eligible for full liquidation
_unencumberRemainingBorrowerCollateralOnZeroObligation
_withinNetExposureCapOnLiquidation
_collateralSeizureAmounts
returns total amount of collateral seized in liquidation and the amount of that total going protocol
_transferLiquidationCollateral
A helper function to transfer tokens and update relevant state variables and mappings
_isAcceptedCollateralToken
_usdValueOfBalances
_authorizeUpgrade
required override by the OpenZeppelin UUPS module
Parameters
impl
address
new impl address for proxy upgrade
Last updated