function collectInterests() external
Mints accumulated interest to the fee receiver. Reverts if no interest is payable.
function fetchPrice() public returns (uint256)
Fetches the latest collateral price from the price feed contract.
Return Values:
Current price of collateral from the price feed
function getEntireSystemBalances() external returns (uint256, uint256, uint256)
Returns a snapshot of the system's total collateral, debt, and current price in one call.
Return Values:
Sum of active + defaulted collateral
Sum of active + defaulted debt (with interest)
Current collateral price from oracle
function claimCollateral(uint256 _troveId, address _receiver, bool _useNative) external
Claims remaining collateral from a closed trove. Only callable by trove owner.
Input Parameters:
Address to receive collateral
Whether to send native ETH
Return Values:
Function does not return a value
Allows front-end operators to collect accrued interest.
Input Parameters:
Front-end operator address
Return Values:
Function does not return a value
Returns the most recent price without updating it (gas-efficient).
Return Values:
Last recorded price of collateral (cached)
Calculates the current week and day based on the system’s start time.
Return Values:
Current week since system start
Current day within the week (0–6)
Returns the volume of debt minted per day in a specific week.
Input Parameters:
Return Values:
Array of daily mint amounts for the week
Returns the length of the TroveIds array.
Return Values:
Total number of active troves
Returns a trove ID from the active troves array.
Input Parameters:
Index in the TroveIds array
Return Values:
ID of the trove at the given index
Fetches all trove data (collateral, debt, status, etc.) for a given owner.
Input Parameters:
Return Values:
Array of all troves owned by account
Returns the complete data structure for a specific trove.
Input Parameters:
Return Values:
Struct containing:
- debt (uint256)
- coll (uint256)
- stake (uint256)
- status (Status enum)
- arrayIndex (uint128)
- activeInterestIndex (uint256)
- frontEndId (address)
- referrerId (address)
Returns the status of a trove (e.g., active, closedByLiquidation).
Input Parameters:
Return Values:
Trove status (0–4, matching Status enum)
Returns the stake (collateral-weighted value) of a trove.
Input Parameters:
Return Values:
Stake amount for the trove
Returns trove collateral and debt (view).
Input Parameters:
Return Values:
Total collateral in the trove
Returns the full state of a trove, including pending rewards.
Input Parameters:
Return Values:
Total debt (including pending rewards)
Total collateral (including pending rewards)
Pending debt redistribution reward
Pending collateral redistribution reward
Returns the total collateral locked in the system.
Return Values:
Sum of active + defaulted collateral
Returns the total debt in the system, including pending interest.
Return Values:
Sum of active + defaulted debt (with accrued interest)
Returns nominal collateral ratio (view).
Input Parameters:
uint256 (only for getCurrentICR)
Current price of collateral
Return Values:
Collateral ratio (nominal or current)
Input Parameters:
uint256 (only for getCurrentICR)
Current price of collateral
Return Values:
Collateral ratio (nominal or current)
Sum of collateral in all non-liquidated/non-redeemed troves.
Return Values:
Total collateral in active troves (excluding defaulted)
Calculates active debt with compounded interest since last update.
Return Values:
Total debt in active troves (including accrued interest)
Computes unclaimed rewards from liquidations affecting the trove.
Input Parameters:
Return Values:
Pending collateral from redistributions
Pending debt from redistributions
Returns the address of the TroveNFT contract (used for ownership checks).
Return Values:
Interface of the TroveNFT contract
Checks if a trove has unclaimed redistribution rewards.
Input Parameters:
Return Values:
true if trove has pending rewards
Returns the borrowing fee rate (e.g., 0.5% as 5000000000000000).
Return Values:
Current borrowing rate (based on baseRate)
Estimates the borrowing rate if no new fees are charged.
Return Values:
Borrowing rate after decay (simulated)
Calculates the fee to borrow _debt.
Input Parameters:
Debt amount to calculate fee for
Return Values:
Borrowing fee for _debt at current rate
Estimates the borrowing fee after base rate decay.
Input Parameters:
Debt amount to calculate fee for
Return Values:
Fee for _debt at decayed rate
Simulates the decay of baseRate over time.
Return Values:
Aggregates pending rewards (debt + minting) for an account.
Input Parameters:
Address to receive rewards
Return Values:
Input Parameters:
Return Values:
Input Parameters:
Return Values:
Input Parameters:
Total collateral in trove
Return Values:
Collateral reserved for gas
Structs and Enums
Note: on the Oasis Sapphire blockchain all events are disabled for privacy preservation purposes
Last updated