Trove Manager
Step into the heart of individual collateralized debt positions with the Trove Manager. This contract is the central hub for all operations related to a specific collateral type, managing its Troves, associated fees, rates, and overall system health for that asset. Explore its comprehensive suite of functions for opening Troves, managing debt and collateral, processing redemptions, and handling liquidations, along with events that track every critical state change.
Functions
BOOTSTRAP_PERIOD()
Returns the duration of the bootstrap period. (View)
CCR()
Returns the Collateralization Ratio of this Trove Manager. (View)
DEBT_GAS_COMPENSATION()
Returns the gas compensation for debt operations. (View)
DECIMAL_PRECISION()
Returns the decimal precision used. (View)
L_collateral()
Returns the L_collateral term for reward calculations. (View)
L_debt()
Returns the L_debt term for reward calculations. (View)
MAX_INTEREST_RATE_IN_BPS()
Returns the maximum interest rate in basis points. (View)
MCR()
Returns the Minimum Collateralization Ratio for Troves in this manager. (View)
PERCENT_DIVISOR()
Returns the divisor for percentage calculations. (View)
ROOTS_CORE()
Returns the address of the IRootsCore
contract. (View)
SUNSETTING_INTEREST_RATE()
Returns the interest rate applied during the sunsetting period. (View)
Troves
Returns details of a specific Trove. (View)
activeInterestIndex()
Returns the current active interest index. (View)
addCollateralSurplus
Adds collateral surplus to a borrower’s account (typically after liquidation).
applyPendingRewards
Applies pending rewards to a borrower’s Trove.
baseRate()
Returns the current base rate for borrowing fees. (View)
borrowerOperationsAddress()
Returns the address of the Borrower Operations contract. (View)
borrowingFeeFloor()
Returns the floor for borrowing fees. (View)
claimCollateral
Allows a user to claim their collateral surplus.
claimReward
(Version 1)
Claims rewards for a specified ‘from’ address to a ‘receiver’.
claimReward
(Version 2)
Claims rewards for the message sender.
claimReward
(Version 3)
Claims rewards for the message sender to a specified ‘receiver’.
claimableReward
Returns the amount of reward a borrower can claim.
closeTrove
Closes a borrower’s Trove.
closeTroveByLiquidation
Closes a Trove due to liquidation.
collateralToken()
Returns the address of the collateral token for this Trove Manager. (View)
collectInterests
Collects accrued interest, updating relevant system parameters.
debtToken()
Returns the address of the IDebtToken
contract. (View)
decayBaseRateAndGetBorrowingFee
Decays the base rate and returns the current borrowing fee for a given debt amount.
decreaseDebtAndSendCollateral
Decreases debt and sends collateral, typically during redemptions.
defaultedCollateral()
Returns the amount of collateral defaulted in this Trove Manager. (View)
defaultedDebt()
Returns the amount of debt defaulted in this Trove Manager. (View)
emissionId()
Returns emission IDs related to this Trove Manager. (View)
fetchPrice()
Fetches the current price of the collateral token from the price feed.
finalizeLiquidation
Finalizes a liquidation process, distributing collateral and gas compensation.
getBorrowingFee
Calculates the current borrowing fee for a given debt amount without decaying the base rate. (View)
getBorrowingFeeWithDecay
Calculates the current borrowing fee for a given debt amount after decaying the base rate. (View)
getBorrowingRate()
Returns the current borrowing rate without decaying. (View)
getBorrowingRateWithDecay()
Returns the current borrowing rate after decaying. (View)
getCurrentICR
Calculates the Individual Collateralization Ratio (ICR) of a borrower’s Trove at a given price. (View)
getEntireDebtAndColl
Returns the entire debt and collateral details for a borrower. (View)
getEntireSystemBalances()
Returns the entire system balances for this Trove Manager.
getEntireSystemColl()
Returns the total collateral in the system for this Trove Manager. (View)
getEntireSystemDebt()
Returns the total debt in the system for this Trove Manager. (View)
getNominalICR
Calculates the nominal ICR of a borrower’s Trove (ICR at a price of 1). (View)
getPendingCollAndDebtRewards
Returns the pending collateral and debt rewards for a borrower. (View)
getRedemptionFeeWithDecay
Calculates the redemption fee for a given amount of collateral drawn, after decaying the base rate. (View)
getRedemptionRate()
Returns the current redemption rate without decaying. (View)
getRedemptionRateWithDecay()
Returns the current redemption rate after decaying. (View)
getTotalActiveCollateral()
Returns the total active collateral in this Trove Manager. (View)
getTotalActiveDebt()
Returns the total active debt in this Trove Manager. (View)
getTroveCollAndDebt
Returns the collateral and debt of a specific Trove. (View)
getTroveFromTroveOwnersArray
Returns a Trove owner’s address from the array by index. (View)
getTroveOwnersCount()
Returns the total number of Trove owners. (View)
getTroveStake
Returns the stake associated with a borrower’s Trove. (View)
getTroveStatus
Returns the status of a borrower’s Trove. (View)
getWeek()
Returns the current week. (View)
getWeekAndDay()
Returns the current week and day. (View)
guardian()
Returns the guardian address. (View)
hasPendingRewards
Checks if a borrower has pending rewards. (View)
interestPayable()
Returns the amount of interest currently payable. (View)
interestRate()
Returns the current interest rate. (View)
lastActiveIndexUpdate()
Returns the timestamp of the last active index update. (View)
lastCollateralError_Redistribution()
Returns the last collateral error from redistribution. (View)
lastDebtError_Redistribution()
Returns the last debt error from redistribution. (View)
lastFeeOperationTime()
Returns the timestamp of the last fee operation. (View)
liquidationManager()
Returns the address of the Liquidation Manager contract. (View)
maxBorrowingFee()
Returns the maximum borrowing fee. (View)
maxRedemptionFee()
Returns the maximum redemption fee. (View)
maxSystemDebt()
Returns the maximum system debt allowed for this Trove Manager. (View)
minuteDecayFactor()
Returns the minute decay factor for fee calculations. (View)
movePendingTroveRewardsToActiveBalances
Moves pending Trove rewards to active balances for a given debt and collateral amount.
openTrove
Opens a new Trove for a borrower.
owner()
Returns the owner address of the contract. (View)
paused()
Returns true if the contract is paused, false otherwise. (View)
priceFeed()
Returns the address of the IPriceFeed
contract. (View)
redeemCollateral
Processes a collateral redemption request.
redemptionFeeFloor()
Returns the floor for redemption fees. (View)
rewardSnapshots
Returns reward snapshot data for a given account. (View)
setAddresses
Sets essential contract addresses. Note: This function signature seems to be duplicated from a general parameter configuration context and might be specific to this TroveManager’s setup if it only sets limited addresses.
setParameters
Configures various system parameters for this Trove Manager.
setPaused
Pauses or unpauses the contract.
setPriceFeed
Sets the price feed address for this Trove Manager.
setStaker
Sets the Staker contract address.
sortedTroves()
Returns the address of the ISortedTroves
contract. (View)
staker()
Returns the address of the IStaker
contract. (View)
startSunset()
Initiates the sunset mode for this Trove Manager.
sunsetting()
Returns true if this Trove Manager is in sunset mode. (View)
surplusBalances
Returns surplus balance for a given account. (View)
systemDeploymentTime()
Returns the system deployment time. (View)
totalCollateralSnapshot()
Returns the total collateral snapshot. (View)
totalStakes()
Returns the total stakes. (View)
totalStakesSnapshot()
Returns the total stakes snapshot. (View)
updateBalances()
Updates balances, likely related to rewards or interest.
updateTroveFromAdjustment
Updates a Trove based on an adjustment operation.
Events
BaseRateUpdated
Emitted when the base rate for borrowing fees is updated.
CollateralSent
Emitted when collateral is sent from the Trove Manager.
LTermsUpdated
Emitted when L_collateral and L_debt terms are updated.
LastFeeOpTimeUpdated
Emitted when the last fee operation time is updated.
Redemption
Emitted upon a redemption operation processed by this Trove Manager.
RewardClaimed
Emitted when rewards are claimed.
SystemSnapshotsUpdated
Emitted when system-wide snapshots are updated.
TotalStakesUpdated
Emitted when total stakes are updated.
TroveIndexUpdated
Emitted when a Trove’s index in the sorted list is updated.
TroveSnapshotsUpdated
Emitted when a Trove’s reward snapshots are updated.
TroveUpdated
Emitted when a Trove is updated (creation, adjustment, liquidation).