Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Matthews Lab
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Synthetix
(section)
Page
Discussion
British English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Maintaining the stable coin = In the previous section I explained that X worth of sUSD is more than X USD worth of SNX collateral. It’s equal to X + (X * Y) USD worth of SNX, where Y = 7.5 or 750% [issuance_ratio][issuance_ratio2]. The value of Y represents the ‘collateralization ratio’ between a spendable sUSD balance and how much extra SNX is required to hedge against price swings. You can see that 750% is a very inconvenient number (how useful is an investment platform that only lets investors leverage a pittance of their wealth?) To ensure investors keep their sUSD balances well collateralized there is a function to flag accounts for violations, along with a penalty cost if their collateral isn’t increased above a threshold within a set timeframe. The full values can be found in the [SystemSettings.sol] settings contract. One point to pay attention to is like most so-called ‘decentralized’ applications- almost every aspect of Synthetix Exchange can be changed by it’s owners, making it trivial to steal funds or destroy the exchange. # [Liquidations.sol#L172] '''flagAccountForLiquidation(address account)''' # [Synthetix.sol#L301] '''liquidateDelinquentAccount(address account, uint susdAmount)''' # [Issuer.sol#L613] '''liquidateDelinquentAccount(address account, uint susdAmount, address liquidator)''' Users can call '''calculateAmountToFixCollateral(uint debtBalance, uint collateral)''' [Liquidations.sol#L145] to obtain the amount in sUSD that needs to be paid to fix their collateral ratios should they fall under the required limits. One of the most important pieces of code in Synthetix: <pre class="solidity"> /** * r = target issuance ratio * D = debt balance * V = Collateral * P = liquidation penalty * Calculates amount of synths = (D - V * r) / (1 - (1 + P) * r) */ function calculateAmountToFixCollateral(uint debtBalance, uint collateral) external view returns (uint) { uint ratio = getIssuanceRatio(); uint unit = SafeDecimalMath.unit(); uint dividend = debtBalance.sub(collateral.multiplyDecimal(ratio)); uint divisor = unit.sub(unit.add(getLiquidationPenalty()).multiplyDecimal(ratio)); return dividend.divideDecimal(divisor); }</pre> <span id="wrapping-your-head-around-synthetic-assets"></span>
Summary:
Please note that all contributions to Matthews Lab may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Matthews Lab:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)