Trustline
Probity
Search…
⌃K

VaultEngine

The VaultEngine contract is the core accounting module for the Probity system. User can modify their debt or equity position through vaultEngine

Data Structures

Vault

Property
Type
Description
standby
uint256
The amount of an asset in your vault, but not actively covering in a position.
underlying
uint256
collateral
uint256
The amount of an asset in your vault that is actively covering a debt or equity position.
debt
uint256
The amount of debt in the vault.
equity
uint256
The amount of equity in the vault.
initialEquity
uint256
The most recent value of the equity rate accumulator.

Asset

Property
Type
Description
debtAccumulator
uint256
The cumulative debt rate
equityAccumulator
uint256
The cumulative equity rate
adjustedPrice
uint256
The asset price, adjusted for the asset ratio.
normDebt
uint256
Total normalized debt balance of the asset
normEquity
uint256
Total normalized equity balance of the asset
ceiling
uint256
The max amount of the asset that can be active
floor
uint256
The min amount of the asset that must be active to open a position

Methods

Public Methods

function totalDebt() returns(uint256 totalDebt)
Returns the totalDebt positions based on all assets
function totalEquity() returns(uint256 totalEquity)
Returns the totalEquity positions based on all assets
function totalStablecoin() returns(uint256 totalStablecoin)
Returns totalStablecoin that has been created within vaultEngine
Note: this doesn't represent circulating stablecoin supply which can be check through stablecoin ERC20's totalSupply
function totalSystemDebt() returns(uint256 totalSystemDebt)
Returns totalSystemDebt
function vaultExists(address user) returns(bool exists)
Check if a user's vault exists. Vault only exists if user has either equity or debt position at one point.
function stablecoin(address user) returns(uint256 balance)
Returns user's stablecoin balance
function pbt(address user) returns(uint256 balance)
Returns user's pbt balance
function systemDebt(address user) returns(uint256 balance)
Return user's systemDebt balance
Note: systemDebt is the amount of stablecoin that is not backed by any asset.
function assets(bytes32 assetId) returns(uint256 debtAccumulator, uint256 equityAccumulator, uint256 adjustedPrice, uint256 normDebt, uint256 normEquity, uint256 ceiling, uint256 floor)
Returns variables related the the Asset, see data structure above for variables in the Asset struct
function vaults(bytes32 assetId, address user) returns(uint256 standby, uint256 underlying, uint256 collateral, uint256 debt, uint256 equity, uint256 initialEquity)
Returns variables related to a specific Vault , see data structure above for variables in the Vault struct

External Methods

functiongetVaultList()external viewreturns (address[]memorylist)
Returns the list of addresses that have interacted with Probity.
functionbalanceOf(bytes32assetId,addressuser)external viewreturns (uint256activeAssetAmount,uint256debt,uint256equity)
Returns the active asset ratio, debt balance, and equity balance of the provided address.
functionmodifyStandByAsset(bytes32asset,addressuser,int256amount) externalonlyByProbity
Only callable by Probity
Modifies the vault's asset balance by the specified amount. Only callable by Probity.
functionmoveAsset(bytes32asset,addressfrom,addressto,uint256amount) externalonlyByProbity
Only callable by Probity
Move the standby Asset balance to another user within vault Engine
functionmoveStablecoin(addressfrom,addressto,uint256amount) externalonlyByProbity
Only callable by Probity
Move stablecoin balance from one user to another within vault Engine
functionaddStablecoin(addressuser,uint256amount) externalonlyBy("treasury")
Only callable by Treasury
Add stablecoin to an user's balance
functionremoveStablecoin(addressuser,uint256amount) externalonlyByProbity
Only callable by Probity
Remove stablecoin from an user's balance
functionreducePbt(bytes32asset,addressuser,int256amount) externalonlyBy("treasury")
Only callable by Treasury
Reduce Pbt balance of an user
functioncollectInterest(bytes32assetId)public
Calculate interest based on the current equity position, equity accumulator and initial equity position.
functionmodifyEquity(bytes32assetId,addresstreasuryAddress,int256underlyingAmount,int256equityAmount)externalonlyBy("whitelisted")
Only callable by WhiteListed User
Modify the Equity position of the caller
functionmodifyDebt(bytes32assetId,addresstreasuryAddress,int256collAmount,int256debtAmount)externalonlyBy("whitelisted")
Only callable by WhiteListed User
Modify the Debt position of the caller
functionliquidateDebtPosition(bytes32assetId,addressuser, addressauctioneer, addressreservePool,int256collateralAmount, int256debtAmount)externalonlyByProbity
Only callable by Probity
Liquidate a debt position of the user
functionliquidateEquityPosition(bytes32assetId,addressuser, addressauctioneer,int256assetToAuction,int256assetToReturn, int256equityAmount,int256initialEquityAmount)externalonlyByProbity
Only callable by Probity
Liquidate a equity position of the user
functionsettle(uint256amount) externalonlyByProbity
Only callable by Probity
Repay the caller's system debt by using the caller's stablecoin
functionincreaseSystemDebt(uint256amount)externalonlyByProbity
Only callable by Probity
Take on additional system debt for the caller
functioninitAsset(bytes32assetId)externalonlyBy("gov")
Only callable by Gov
Initialize a new Asset
functionupdateCeiling(bytes32assetId,uint256ceiling)external
onlyBy("gov")
Only callable by Gov
Update ceiling variable for an asset
functionupdateFloor(bytes32assetId,uint256floor) externalonlyBy("gov")
Only callable by Gov
Update floor variable for an asset
functionupdateAccumulator(bytes32asset,addressreservePool,uint256debtRateIncrease, uint256equityRateIncrease, uint256protocolFeeRates) externalonlyBy("teller")
Only callable by Teller
updates the debt & equity accumulator, also collect protocol fees.
functionupdateAdjustedPrice(bytes32assetId,uint256price) externalonlyByProbity
Only callable by Probity
Update the adjustedPrice variable of the asset