Borrower Operations
Unlock the power of your collateral with the Borrower Operations contract. This crucial component of the Roots protocol empowers users to manage their financial positions (Troves) with precision. Explore functions for opening new Troves, adjusting existing collateral and debt levels, claiming rewards, and more. Key events will keep you informed of every significant operation.
Functions
CCR()
Returns the Collateralization Ratio of the system. (View)
DEBT_GAS_COMPENSATION()
Returns the gas compensation amount for debt-related operations. (View)
DECIMAL_PRECISION()
Returns the decimal precision used in calculations. (View)
PERCENT_DIVISOR()
Returns the divisor used for percentage calculations. (View)
ROOTS_CORE()
Returns the address of the IRootsCore
contract. (View)
addColl
Adds collateral to a user’s Trove.
adjustTrove
Adjusts a user’s Trove by depositing/withdrawing collateral and/or increasing/decreasing debt.
checkRecoveryMode
Checks if the system is in recovery mode based on the provided Total Collateralization Ratio (TCR). (Pure)
claimRewards
Claims rewards for a user from specified Trove Managers.
closeTrove
Closes a user’s Trove.
configureCollateral
Configures a collateral token for a specific Trove Manager.
debtToken()
Returns the address of the IDebtToken
contract. (View)
factory()
Returns the factory address. (View)
fetchBalances()
Fetches system balances. (Nonpayable)
getCompositeDebt
Calculates the composite debt including fees. (View)
getGlobalSystemBalances()
Gets the global system balances. (Nonpayable)
getTCR()
Gets the Total Collateralization Ratio of the system. (Nonpayable)
guardian()
Returns the guardian address. (View)
initialize
Initializes the BorrowerOperations contract.
isApprovedDelegate
Checks if a caller is an approved delegate for an owner. (View)
minNetDebt()
Returns the minimum net debt required for a Trove. (View)
openTrove
Opens a new Trove for a user with specified collateral and debt amounts.
owner()
Returns the owner address of the contract. (View)
removeTroveManager
Removes a Trove Manager from the system.
repayDebt
Repays a specified amount of debt for a user’s Trove.
setDelegateApproval
Sets or revokes delegate approval for an address.
setMinNetDebt
Sets the minimum net debt for Troves.
troveManagersData
Returns data for a specific Trove Manager, including its collateral token and other parameters. (View)
withdrawColl
Withdraws collateral from a user’s Trove.
withdrawDebt
Withdraws (borrows) a specified amount of debt from a user’s Trove.
Events
BorrowingFeePaid
(Version 1)
Emitted when a borrowing fee is paid, specifying the collateral token.
BorrowingFeePaid
(Version 2)
Emitted when a borrowing fee is paid.
CollateralConfigured
Emitted when a collateral token is configured for a Trove Manager.
DelegateApprovalSet
Emitted when delegate approval status is changed for a caller.
TroveCreated
Emitted when a new Trove is created.
TroveManagerRemoved
Emitted when a Trove Manager is removed.
TroveUpdated
Emitted when a Trove is updated.