You've successfully subscribed to Synthetix Blog
Great! Next, complete checkout for full access to Synthetix Blog
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.

Decentralised synthetic assets

Manually interacting with multi-collateral loans

Manually interacting with multi-collateral loans

The Shaula release deployed two major protocol changes, SIP-97 and SIP-103. These two SIPs enable new forms of borrowing as well as a new mechanism to short Synths. This new shorting mechanism includes several improvements and is intended to replace the existing iSynths.

First let’s do a quick review of the collateral options within Synthetix. SNX is still the primary form of collateral within the protocol, only SNX stakers receive protocol rewards in the form of inflation and exchange fees. But it is important to diversify the collateral used within the system to both reduce systemic risk and ensure the Synth supply can scale effectively. Earlier this year Ether was enabled as a form of collateral, however, you were only able to borrow sETH with ETH which limited the impact of this initial version. The second iteration enabled borrowing sUSD against ETH. This upgrade saw a significant increase in borrowing with almost 10k ETH used to issue sUSD over the first few months. However, awareness of this functionality is still low outside the Synthetix community. Taking the lessons from these earlier trials, the multi-collateral system implemented in SIP-97/103 represents a complete redesign of the original Ether collateral mechanism.

SIP-97 makes it possible to borrow sUSD and sBTC using renBTC. This is the first time BTC has been added as a form of collateral within Synthetix, and like ETH it represents a significant expansion of the potential collateral pool available to increase the Synth supply. In addition to renBTC you can still use sETH to borrow sUSD and sETH.

SIP-103 is an extension of SIP-97 which enables users to deposit sUSD as collateral and short sBTC and sETH. This is the first time you have been able to use a Synth as collateral. Let’s consider the example of shorting sBTC. You deposit sUSD to borrow sBTC and then in a single transaction the system sells that sBTC into sUSD. Now you have a loan denominated in sBTC but you are holding sUSD from selling the borrowed sBTC. If the price of sBTC drops you will be able to use the sUSD to buy back the borrowed sBTC and repay your loan and will have excess sUSD as profit from the position. However, if the price rises, the collateralisation ratio of your position will drop. If it falls below the minimum required (currently 120%), your position may be liquidated and you risk losing your sUSD collateral.

This is a more optimal form of shorting than iSynths for several reasons. Since you receive the sUSD proceeds of the sale, you can deploy these funds throughout DEFI to earn yield. Not many projects accept iSynths, but sUSD is integrated widely across the ecosystem. Secondly, there are no upper and lower bounds, so you don’t need to worry about your position being frozen as you do with iSynths and you do not need to factor in the implicit leverage caused by the iSynth pricing mechanism.

There are some trade-offs compared with the current iSynth mechanism. The first is that you pay an interest rate based on the skew of the synth in the system, compared to iSynths which have no cost to hold. However, when the synth is skewed long, it is free to short, which is currently the case with sBTC and sETH. The second is that the position needs to be overcollateralised, so that the system is protected from positions that lose value. This means it is less capital efficient than holding an iSynth, but we believe this will be offset by the ability to earn yield on the short proceeds (sUSD) while the position is open. Finally, positions must be monitored to ensure they do not fall under the minimum collateralisation ratio, otherwise they will become eligible for  liquidation.

That covers the high level benefits of this new system, for more detail please see SIP-97 and SIP-103. So let’s jump into how to interact with it. There is currently no UI, the functionality will be integrated into Kwenta and Staking in late January. However, in the interim, I’m announcing a personal bounty. I will pay up to 3k SNX for the best UI or integration that enables shorting and multi-collateral loans. Bonus points for speed! No other rules, just build the UI and ping me on discord or twitter and I will judge the best ones as they come in.

While we wait for a UI let’s use Etherscan to manually interact with the contracts.

Borrowing with renBTC

  1. First go to the renBTC contract
  2. Connect your wallet
  3. In the first function “Approve”
  4. Spender: 0x3B3812BB9f6151bEb6fa10783F1ae848a77a0d46Amount: 10000000000000000000000 (this is effectively an infinite approval) unless you are @zhusu ;)
  5. Now click “write” to execute the transaction
  1. Now got to the renBTC multi-collateral contract
  2. In function 9 “Open”
  3. Collateral: 100000000 (1 renBTC because it uses 8 decimals)
  4. Amount: 500000000000000000 (.5 sBTC because it uses 18 decimals)
  5. Currency: 0x7342544300000000000000000000000000000000000000000000000000000000 (code for sBTC)
  6. Alternatively, if  you wanted to borrow sUSD you would use this code. 0x7355534400000000000000000000000000000000000000000000000000000000.
  7. Now click write to execute the transaction
  8. Congrats you have just borrowed sBTC using renBTC as collateral!

If you want to borrow using ETH just follow the instructions above but go to this contract. You don’t need to worry about approving ETH transfers.

Now let’s really have some fun!

Shorting sBTC with sUSD

  1. First go to the sUSD contract
  2. Connect your wallet
  3. In the first function “Approve”
  4. Spender: 0x188C2274B04Ea392B21487b5De299e382Ff84246
  5. Amount: 100000000000000000000000000 (this is effectively an infinite approval)
  1. Now click write to execute the transaction
  2. Now got to the sUSD multi-collateral contract
  3. In function 10 “Open”
  4. Collateral: 1000000000000000000000 (1,000 sUSD because it uses 18 decimals)
  5. Amount: 30000000000000000 (0.3 sBTC because it uses 18 decimals)
  6. Currency: 0x7342544300000000000000000000000000000000000000000000000000000000 (code for sBTC)
  7. Now click write to execute the transaction
  8. Congrats you have just shorted sBTC using sUSD as collateral!
  9. Bonus step, you can use the sUSD to buy renBTC, tBTC or WBTC to effectively cover your short exposure outside Synthetix if you are trying to take advantage of upcoming shorting incentives (alpha leak) without losing exposure to your BTC or ETH collateral.

If you want to short sETH just follow the instructions above but replace sBTC with sETH.

Remember to monitor the collateralisation ratio of your position. It is equal to the USD value of the collateral divided by the USD value of the loan. In the case of the above sBTC short, its ratio is (1000 * 1) / (0.03 * 25000) = 133%. If it falls below 120%, it will be eligible for liquidation!

That’s it, you can now use many different collateral types to open loans and short positions. Next steps for this functionality will be for the community to decide whether to expand collateral types to other ERC-20 assets as well as whether to expand the range of Synths which can be shorted. Both of which will require an SIP to be written and approved by the community.

Kain Warwick

Kain Warwick

Kain is the founder of Synthetix.