Comment on page
VaultEngine
The VaultEngine contract is the core accounting module for the Probity system. User can modify their debt or equity position through vaultEngine
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. |
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 |
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 vaultEngineNote: 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
function
getVaultList()
external view
returns (
address
[]
memory
list)
Returns the list of addresses that have interacted with Probity.
function
balanceOf(
bytes32
assetId,
address
user)
external view
returns (
uint256
activeAssetAmount,
uint256
debt,
uint256
equity)
Returns the active asset ratio, debt balance, and equity balance of the provided address.
function
modifyStandByAsset(
bytes32
asset,
address
user,
int256
amount)
external
onlyByProbity
Only callable by Probity
Modifies the vault's asset balance by the specified amount. Only callable by Probity.
function
moveAsset(
bytes32
asset,
address
from,
address
to,
uint256
amount)
external
onlyByProbity
Only callable by Probity
Move the standby Asset balance to another user within vault Engine
function
moveStablecoin(
address
from,
address
to,
uint256
amount)
external
onlyByProbity
Only callable by Probity
Move stablecoin balance from one user to another within vault Engine
function
addStablecoin(
address
user,
uint256
amount)
external
onlyBy("treasury")
Only callable by Treasury
Add stablecoin to an user's balance
function
removeStablecoin(
address
user,
uint256
amount)
external
onlyByProbity
Only callable by Probity
Remove stablecoin from an user's balance
function
reducePbt(
bytes32
asset,
address
user,
int256
amount)
external
onlyBy("treasury")
Only callable by Treasury
Reduce Pbt balance of an user
function
collectInterest(
bytes32
assetId)
public
Calculate interest based on the current equity position, equity accumulator and initial equity position.
function
modifyEquity(
bytes32
assetId,
address
treasuryAddress,
int256
underlyingAmount,
int256
equityAmount)
external
onlyBy("whitelisted")
Only callable by WhiteListed User
Modify the Equity position of the caller
function
modifyDebt(
bytes32
assetId,
address
treasuryAddress,
int256
collAmount,
int256
debtAmount)
external
onlyBy("whitelisted")
Only callable by WhiteListed User
Modify the Debt position of the caller
function
liquidateDebtPosition(
bytes32
assetId,
address
user,
address
auctioneer,
address
reservePool,
int256
collateralAmount,
int256
debtAmount)
external
onlyByProbity
Only callable by Probity
Liquidate a debt position of the user
function
liquidateEquityPosition(
bytes32
assetId,
address
user,
address
auctioneer,
int256
assetToAuction,
int256
assetToReturn,
int256
equityAmount,
int256
initialEquityAmount)
external
onlyByProbity
Only callable by Probity
Liquidate a equity position of the user
function
settle(
uint256
amount)
external
onlyByProbity
Only callable by Probity
Repay the caller's system debt by using the caller's stablecoin
function
increaseSystemDebt(
uint256
amount)
external
onlyByProbity
Only callable by Probity
Take on additional system debt for the caller
function
initAsset(
bytes32
assetId)
external
onlyBy("gov")
Only callable by Gov
Initialize a new Asset
function
updateCeiling(
bytes32
assetId,
uint256
ceiling)
external
onlyBy("gov")
Only callable by Gov
Update ceiling variable for an asset
function
updateFloor(
bytes32
assetId,
uint256
floor)
external
onlyBy("gov")
Only callable by Gov
Update floor variable for an asset
function
updateAccumulator(
bytes32
asset,
address
reservePool,
uint256
debtRateIncrease,
uint256
equityRateIncrease,
uint256
protocolFeeRates)
external
onlyBy("teller")
Only callable by Teller
updates the debt & equity accumulator, also collect protocol fees.
function
updateAdjustedPrice(
bytes32
assetId,
uint256
price)
external
onlyByProbity
Only callable by Probity
Update the adjustedPrice variable of the asset
Last modified 1yr ago