How to Solana — Chapter 6: Synthetic Assets

Ryze Labs
11 min readDec 23, 2021

--

TLDR:

Synthetic assets protocols are essentially structured as a call of duty style free-for-all; the game (debt pool) starts, everyone chooses their loadout (debt denominated in some asset), and winners (+PnL) are rewarded based on their debt’s performance relative to the rest of the pool.

The reason you choose to compete with other players instead of playing solo and trading on a DEX is because all these positions are created by accounting on the backend- just moving debt numbers around- which means there’s effectively infinite liquidity, no slippage, and a wide range of supported assets from metals to equities to currencies, etc…

What are synthetic assets?

Synthetic assets (synths) are assets that act like other assets. This is facilitated by smart contract systems that enable the creation of debt denominated in arbitrary assets with exchange rates determined by price oracles. This enables protocols to provide exposure to essentially any asset with a reasonably liquid market from which an oracle can pull the latest price.

We’ll spend some time explaining the general concept before moving to Solana specifically.

Source: https://synthetix.io/synths

Often, we say that a synth “tracks” some “underlying” asset; by this we mean the synth’s price will follow or move in tandem with some other asset. E.g. synthetic TSLA might be an SPL or ERC-20 token that moves in lockstep with the price of TSLA shares trading on the NASDAQ. Usually these prices are kept in check by both a price oracle and a system that allows for market arbitrage.

Take for example, oil futures. These financial derivatives allow market participants to manage their exposure to the price of oil without actually shipping barrels of oil all across the world to different buyers and sellers. This is massively important because the synthetic asset, i.e. the contract, allows for the creation of liquid markets which makes the process of hedging exposure significantly more efficient.

Source: https://www.cmegroup.com/markets/energy/crude-oil/light-sweet-crude.html

The key takeaway here is that having an asset in one place that tracks the price of some arbitrary asset somewhere else is an important part in designing efficient markets.

Synths in Crypto

One use case for synths is tracking equity prices on-chain. Imagine you are a market participant and have a portfolio consisting of tech stocks and cryptocurrency. If you wish to rebalance your portfolio more heavily into stocks, you must:

  1. Sell crypto for USDC
  2. Move USDC to centralized exchange
  3. Initiate wire/ACH withdrawal (3–5 business days processing time) to bank account
  4. Transfer dollars from bank account to brokerage account
  5. Wait for cash to settle (3 business days)
  6. Purchase shares of stock with settled cash

OR- enter synthetic assets:

  1. Sell crypto for UDSC or native platform token (SNX, SNY, etc…)
  2. Deposit proceeds as collateral into smart contract
  3. Mint “synthetic” shares of e.g. TSLA against collateral

The other advantage of synthetic asset protocols is they have “infinite liquidity.”

Since exposure is generated by a pool of debt (synths minted against collateral), and exchange ratios are determined by price oracles, the protocol is liquid for any supported asset up to the size of the total outstanding protocol debt. If you’re a trader moving $10M, it might be hard to find decentralized liquidity for some niche assets, but if you deposit that $10M into the synthetics protocol, your liquidity is limited only to your minimum collateralization ratio.

Additionally, re-denominating your debt comes without any concern about incurring slippage.

Source: https://app.synthetify.io/statistics

This will be discussed in more detail in the next sections, but essentially the global debt pool acts as a counterparty to your trades.

Synthetic Asset Protocol Example:

OK, so now it’s clear why something like a synthetic stock or synthetic commodity might be useful, now how does this actually work in practice? How does a smart contract manage to mimic the performance of an off-chain asset?

First, let’s walk through the process of using a “typical” synthetic asset protocol:

1. User deposits 100 USDC as collateral into protocol

2. User mints 25 synthetic dollars against collateral.

  • This is the user’s working capital inside the system
  • We would say this user has a “c-ratio” or collateralization ratio of 400%

3. User debt is now $25

4. User swaps 25 synthetic dollars for .125 synthetic sol

  • Thus, the oracle price for synthetic Solana was 200USDC/SOL at swap

5. Time passes and Solana doubles in price, now trading at 400USDC/SOL

  • User debt has likely also gone up (explained later), let’s say to $30

6. User swaps .125 synthetic Solana into 50 synthetic dollars

7. User burns 30 synthetic dollars to pay back all debt and unstake USDC

8. User swaps 20 remaining synthetic dollars for USDC in the secondary market, realizing a $20 profit

Synthetic Asset Protocol Architecture (under the hood)

The way this works under the hood is that everyone who locks up (stakes) USDC and mints synthetic assets (debt) is “on the hook” for some percentage of the protocol’s total debt.

Historically, users have tended to mint risk-on assets as if they were taking a long position on the asset, and when the value of these assets increase, the total debt increases and each user is responsible for paying back more debt than they originally minted.

Essentially, you’re competing to out-perform the pool as a whole via taking exposure to your choice of synthetic asset.

Here’s an example of this protocol-vs-individual debt mechanic in action:

But this only paints a small part of the entire picture. In fact, the reason this whole system works at all is because not everyone in the pool holds exposure to the same assets. If everyone in the system held exclusively BTC debt, and BTC price increased, their debt would increase 1:1 with the value of their synthetic assets, and everyone would be at a wash.

Source: Synthetify.io

So how do protocols get people to hold different assets?

Typically, users are paid staking rewards for minting synthetic debt in either inflationary protocol tokens, a percentage of trading fees generated by other users, or a combination of both.

This way, the pool is comprised of roughly 3 types of traders:

  1. Traders who stake stablecoins or the platform’s native token and hedge their (usually) short exposure with long positions on other platforms and collect the spread on the rate they pay for their long positions and the rate they’re paid to stake with the synthetics platform (synthetify pays 40% APR at the time of writing, for reference).
  2. Traders who want the yield AND short exposure to the assets in the debt pool (remember, if the risk assets in the pool lose value, the total debt decreases and stablecoin debt holders make a profit as they are able to pay back their debt more cheaply). In essence, these traders are getting paid to short spot assets, which is a very unique feature.
  3. Traders who want long exposure to a variety of synthetic assets offered by the platform and/or think their market view is more correct than the collective view expressed by the aggregate positions of the debt pool.

Here’s an example of a more complete system, with 50% of the original debt held in stablecoins. This is much closer to what’s seen in production synthetic assets protocols than the two-party transaction shown earlier, and illustrates how a diverse set of financial interests come together to make the collective debt pool work:

Note that $250 is 12.5% of $2000. If this scenario played out over the course of a year, during which stakers were rewarded >12.5% in protocol tokens plus trading fees, it actually would have been a profitable endeavour for the stablecoin stakers.

Finally, note that if no new debt is added to the system, a single trader’s debt remains “pro-rata” (proportional to the total debt), but, obviously, new debt is not the responsibility of the existing participants and does dilute their share of the overall debt in proportion to the amount of debt entering or exiting the system.

Additionally, some synthetic assets will trade on the open market for ease of access/liquidity. These synths are primarily kept in line with the protocol’s oracle price by third party arbitrageurs.

If the price of the synthetic asset trades at a discount to the underlying, users who have synthetic exposure are incentivized to buy the synthetic asset at a discount and use it to pay back their debt more cheaply, since the protocol always quotes prices according to where the oracle says the spot price is trading.

On the other hand, if the synthetic asset trades at a premium, users will be incentivized to sell the synthetic for a higher price and use the proceeds to mint back more of their synthetic asset at the spot price, thus capturing the spread between the two and pushing the market towards equilibrium.

Below, we can see this effect in action on the ethereum blockchain, looking at the historical ratio between synthetic ether and “real” ether, which tends around 1, as expected:

Attack Vectors

Of course, crypto is a highly adversarial environment, and when there’s an opportunity to make money by exploiting a protocol, it is usually taken by some anonymous market participant.

Historically, there have been a number of attacks on the flagship Ethereum-based synthetic assets protocol, Synthetix, utilizing an exploitative technique referred to as “oracle arbitrage.”

Since oracle price updates happen as a result of on-chain transactions (calls to update the price from a smart contract), there are always opportunities to frontrun the price updates with transactions that take an out of date, more favorable price.

If you’re interested in the specifics, you can read more here:

Why Solana

There are two main reasons why synthetic asset protocols are well suited for the Solana Blockchain:

  1. The lack of a mempool and fast block times reduces the attack surface for oracle arbitrage, which removes a potentially massive externality to the system as a whole.
  2. Given the number of calculations involved with debt accounting and risk management, the smart contracts for these platforms tend to be computationally intensive, which means transaction costs on chains like Ethereum tend to be high and make the system extremely costly to trade on.
  • This isn’t bashing eth for high fees- the point is the contracts behind synthetics protocols will still be high relative to other ethereum contracts, so in *this particular instance,* using an L1 like solana makes a lot of sense, especially if you’re working with a smaller pool of capital.

Synthetic Assets on Solana

Note: The remaining screenshots are sourced from Synthetify.io and Phantom wallet.

Now that we’ve covered the fundamentals of synthetic assets protocols, let’s take a look at how to use them. Our case study here will be Synthetify: https://synthetify.io/.

First, open the webapp in the top right corner of the landing page. You’ll then be redirected to this page:

Then, connect your wallet of choice with the “connect” button in the top right. We’ll use the phantom wallet (https://phantom.app/) here.

Now, let’s deposit some collateral and take out a synthetic position:

  1. Click “deposit”

2. Choose which asset you want to use as collateral

3. Deposit some of your chosen asset (leave a small balance of solana to pay for transaction fees

4. You should see your staked balance update:

5. Next- mint xUSD (synthetic dollars).

  • (Make sure you leave a good bit of wiggle room to avoid being liquidated. What you’re doing here is taking out dollar-denominated debt, and giving the protocol access to your solana as an assurance you’ll pay it back- but if the value of that assurance (i.e. the solana) loses value, the protocol will sell your position at a loss to ensure its own stability.)

6. Confirm the transaction in your wallet

7. Your debt status should look something like this:

8. Migrate to the “exchange” tab

9. Pick the asset you want synthetic exposure to, and convert your dollar-debt to debt denominated in that asset. In this case, we’ll pick FTT.

10. Hit the “swap” button and approve the transaction

11. Navigate back to: https://app.synthetify.io/staking, and check your position by selecting “Synthetic” under the deposit interface:

12. It’s important to check up on this position often to avoid liquidations, so knowing where to find the USD value of your individual debt positions as well as your overall debt level (the same in this case).

Now, to unwind this position, you simply execute the steps in reverse order:

  1. Swap synthetic FTT back to xUSD
  2. Use the “burn” tab to remove your debt

3. If you’ve left the position open for some time, make sure to check the “rewards” tab:

The protocol pays out it’s governance token to attract more yield-hungry capital into the protocol and diversify the debt pool- so you should make sure to take advantage!

Further Reading:

We’ve covered the basics of *typical* synthetic assets platforms, and gone through a single Solana-specific synthetic asset user journey.

Other synthetic assets protocols may differ in their implementation details, so make sure you DYOR before investing your own money! Additionally, nothing in this document is intended as investment advice- it is intended to be an educational resource.

If you want to learn more about other synthetic assets protocols on Solana, we recommend checking out the following:

--

--