Efficient Frontier
Published in

Efficient Frontier

The ultimate guide to decentralized derivatives part 1: Opium and UMA

How do on-chain derivatives work? And how decentralized are they? Our first in-depth overview of this new financial derivatives technology includes all the details you’ll need about Opium Protocol and UMA Network

Trading Tencent stock derivatives for USDT or DAI in a non-custodial environment has a much more wide-ranging appeal than swapping blockchain native $SUSHI tokens for $YAM tokens, and that’s why derivatives built with blockchains are so interesting. Most of the new non-custodial derivatives platforms are quite new, but they might be exactly what gives application type blockchains financial relevance in the long term.

In this series of posts we’ll be reviewing and explaining in detail decentralized derivative, starting with the projects which are live on the Ethereum network and its incumbents subsequently.

Decentralization reality check

Decentralization is removing a central point of control from a system and replacing it with many points of control, without downgrading the integrity of the system. In cryptocurrency this sums up to:

A) trustlessness — complete transparency and strong predictability including resistance to being shut-down.

B) permissionlessness — anyone can enjoy the service without being limited by a specific jurisdiction.

Decentralized derivatives and exchanges use many of the same tech components: order-matching (on or off the blockchain), hosting (on a webpage or app) and custody, all in order to try and intermediate trading activity. As you’ll see, each project’s chosen solutions place it on a scale from vaguely non-custodial to fairly trustless and permissionless.

Most defi applications in 2020 have a catch. Most DEXs and decentralized derivatives are permissionless (no KYC), but only a few of them are trustless (a central point of failure exists). That’s why it’s useful to rate the economic and technological feasibility of these schemes, as well as examining the level of decentralization.

Two types of ‘magic’

Decentralized derivative exchanges add another layer of complexity to a normal DEX. In spot markets, profitable arbitrage creates price consistency across venues. For a synthetic instrument to consistently track the underlying asset there has to be an other incentive.

Two methods are currently used to make synthetic asset track the underlying:

A) Creating a perpetual contract on a DEX. Here the price of this instrument tracking the underlying asset is incentivised by the funding rate, popularized by BitMEX. (more about perpetual on- chain contacts in our next posts).

B) Creating synthetic tokens using over-collateralized liabilities. The incentives in this case vary from the ability of the minter to gain leverage and the ability of liquidators to profit to various short term compensation programs.

The growth is real

Left: Currently 237,000 ETH tokens are locked in Derivatives contracts and are on the rise. Right: 2.4 million ETH tokens are in DEX’s (spot on-chain exchanges). Source: DeFiPulse

DefiPulse currently shows 237,000 Ethereum coins and over $1.03 Billion worth of tokens in total locked in decentralized derivative applications on Ethereum’s blockchain, amounting to 3.5% of the 6.9 million $ETH currently being hosted in online programs. This small percentage has been rising quickly over the last months.

DefiPulse’s derivatives lists 2 Ethereum-based synthetic products: Synthetix and Opium. UMA which is only listed on DeBank also has accrued a decent amount of liquidity. Though Synthetix holds at least an order of magnitude more funds that its runner ups Opium and UMA, this has been largely due to its liquidity mining compensation program, and it’s not clear that it will keep its lead.

How it works: Design of non-custodial synthetic assets

Most synthetic assets in the blockchain environment work in a similar way. There needs to be two parties; one party is long while the other side is short on the same asset or instrument. One or both sides of the trade lock collateral worth more than their bet into an automated contract. Then, either immediately or when the contract ends, the program will transfer collateral from one side to the other according to the price movement and the configuring of the automated contract mediating between the sides. This can create a derivative based on any type of asset, not just cryptocurrency, as long as there is a price feed for the relevant asset or index.

All synthetic derivatives contracts are over-collateralized to remove the need for trust between the counterparties. The transparent and automated mechanism of the blockchain-hosted program controls enough funds to re-allocate them as well as award the winner of this trade the appropriate amount. All funds relevant to the derivatives contract must be controlled directly by the smart-contract program. But the issue of connecting smart contracts to the outside world, and receiving reliable price feeds, is definitely a big weakness for many of these projects.

Opium protocol

Source: Debank

Went live: May 2020

Method: Matched over-collateralized individual derivatives cleared by smart contract

Venues: theart.exchange, opium.exchange, swaprate.finance

Amount of collateral currently locked: $106,000 in derivatives contracts through opium.exchange, unknown amount by other exchanges.

Opium’s smart-contract system allows a very wide range of contracts. It lets developers originate derivatives contracts (futures, options or even CDSs) on any asset, as long a compatible price feed (oracle) can be found. Opium allows using any ERC-20 token. Developers of Opium derivatives configure the required collateral levels, maturity date, oracle source and strike price. The Opium Protocol verifies and executes contracts, leaving the matching to off-chain exchanges and the specifications of the derivatives to developers.

Different types of opium derivatives are currently available on the 3 off-chain relays and contracts can also be matched independently and sent directly with collateral to the Opium Match contract, which is hosted on Ethereum’s blockchain.

How Opium works

When a contract is sent to Opium Match, the matching contract verifies that the parameters are compatible and configured correctly and then locks the margin deposited to it by both sides of the derivative contract. Then the program mints a token for each side of the bet. These two position tokens can be traded on a secondary market before the contract ends. At this point, the program awards the collateral to the appropriate token holders according to the results of the contract, and the tokens are burned.

Today, close to 70% of the Opium derivatives volume is traded using opium.exchange, which currently offers matching for 3 derivatives products: Compound token futures, gas price options, and AAVE CDSs. The flexible and simple structure of Opium Protocol makes it an interesting offering, with investors deploying $3.25 million more last month for continuing this project’s development.

Future plans

According to Opium CEO Andrey Belyakov, Opium’s team is looking into ZK Rollups and layer 2 scalability solutions. Their future plans include adding CDSs (credit default swaps — a type of insurance), for WBTC and USDT on opium.exchange, improving their UX, launching liquidity mining, and launching a $OPIUM governance token.

Points of failure quiz

Contracts: The Opium contracts have been audited by SmartDec, but future versions are still being worked on by the Opium development team who can update and change the contracts. Opium’s product & community manager, Deniz Yilmaz, emphasized that new software updates only affect contracts originated after the update, while live contracts that already have funds vested in them can not be altered.

Price oracle: Any oracle can be used for Opium, so the reliability of the price feed highly depends on the chosen information source. opium.exchange currently relies mostly on ChainLink for price feeds. There is currently no well known solution to making oracles both fully trustless and manipulation free. Opium allows using solutions that are currently standered within the DeFi space, which suffer from many vulnerabilities that merit their own discussion.

The UFO test: Opium.exchange is currently open to anyone, as well as the Opium Match contracts, making them accessible even to alien life forms who do not own an international ID.

UMA Network

Source: Debank

Method: Individual contracts over-collateralized with threat/incentive of liquidation, arbitrated by DAO

Went live: March 2020

Venues: Uniswap, EMP-tools, perlinx.finance, mario.cash and ugas-station

Amount of funds currently locked: $49 M in UMA’s liquidity mining incentivised pools according to Debank, $300K in derivatives contracts on PerlinX and an unknown amount it others.

UMA protocol lets users create overcollateralized synthetic assets, in a method similar to Marker DAO. Like Opium, UMA sees itself as a universal protocol and invites other companies to build assets with its contracts. UMA also maintains a basic minting interface at their EMP-tools page. Perlinx.finance was the first exchange to independently use UMA’s contracts.

Using UMA, After a synthetic token is minted, it can be traded freely on exchanges such as Uniswap until its expiry date.

How UMA works

UMA synthetic token can be bought and sold on an exchange as long as the expiration date hasn’t passed. If the expiration date passes, the token holders can redeem the appropriate amount of collateral from the UMA contracts.

The collateralization and minting of the tokens happen behind the scenes: the developers of a contract can choose collateralization level and create any asset to be backed by any ERC-20 approved by UMA token holders for use as collateral. To mint an asset you first need to lock the collateral in the UMA contract. The required collateralization ratio on EMPTools is 125%. After the collateral is locked the token sponsor receives synthetic tokens which can be traded on exchanges.

Liquidation

If a token sponsor fails to maintain the right level of collateral, let’s say above 125% of the underlying asset’s price, his position can be liquidated and taken by an opportunistic liquidator.

Liquidators first need to mint an identical synthetic token and send it to the liquidation contract. This ensures that there is new collateral backing the token whose sponsor is soon to be wiped out. After the contract is liquidated, there is a two hour waiting period to allow the token sponsor to request a dispute.

What’s unique in UMA’s scheme is that a liquidator can try to liquidate positions based not on a price feed but on their own view of the price of the asset. UMA uses no outside price feed but trusts its own users to report the correct price and settle problems in this realm with the DAO. In practice a liquidator can try to liquidate a fully collateralized position, but if he is disputed he stands to lose his collateral.

Original oracle solution using DAO voting

Inspired by Vitalik Buterin’s ShellingCoin article, UMA uses a counterintuitive approach to determining the real price of an asset: anyone can try to liquidate a token sponsor’s position. If the price is correct everything goes smoothly. If someone tries to liquidate a fully collateralized position for example, claiming an incorrect price, the other side of the deal can send this contract to dispute, freezing the funds for both the liquidator and token sponsor. The UMA system then requests them to ‘post a bond’- add more collateral before the dispute is settled by a price request to the DVM (“Data Verification Mechanism”), which is a voting mechanism set up by the UMA DAO.

The UMA DAO is made of UMA token holders who adjudicate and vote on each price dispute. The vote is determined by the percentage of votes, with a minimum of 5% of total UMA token holders needed for a vote to be accepted. If less than 5% of the UMA token holders vote, the decision is rolled over to a future vote.

After a dispute the position is closed. According to UMA’s head of community development, Clayton Roche, three disputes were voted on in the last 6 months. One of them was a test done by the UMA team.

Available assets:

There are currently two live pairs available on EMP Tools:uUSD collateralized rBTC synthetic tokens, and uUSD collateralized synthetic wETH. Synthetic Bitcoin Cash is available on Mario.Cash, and Ethereum Gas contracts can be found at ugas-statio. Perlinx also offers trading YUSD, BAL, WTH, DAI, BUSD against the exchanges native token.

Future plans:

UMA plans to initiate perpetual tokens with no expiration date. They also plan to phase out their liquidity mining program and start a developer incentivisation program. UMA as a company is looking for its product market fit, which may end up being not only serving DeFi enthusiasts but also institutions looking for solutions for leverage or stablecoin minting.

Points of failure quiz

Contrasts: UMA’s DVM price oracle contracts have been locked after being audited by OpenZeppelin. UMA’s other contracts are currently under audit and development. UMA’s contracts construct can’t be changed without a vote from the UMA DAO. Of course creators of UMA contract still need to configure them correctly to avoid losses.

Oracles: UMA avoided the regular shortfalls of streaming oracles, that either rely on a central point of control or on-chain oracles that can be gamed using supply and demand. Common oracles are also vulnerable to blockchain congestion and front-running. UMA’s design avoids this category of problems but has other vulnerabilities and is less battle tested. UMA’s solution is vulnerable to DOS attacks, though according to the team this issue has been mitigated with contract upgrades. It is also vulnerable to attack by UMA whales (owners of large amounts of tokens). That said, this original solution seems to be in the right direction as it bypasses the known and well understood problems in common Ethereum orcales.

UFO Test: UFO’s can currently access all UMA contracts and pools

The next post will dive into the specs of the notoriously confusing synthetic asset protocol —Synthetix $SNX. Stay tuned!

Want to join the Efficient Frontier team? We’re hiring

Interested in our markets research? Subscribe to our newsletter here.

--

--

--

With over 12 years of high frequency and algorithmic trading experience, our technology powers weekly over $1 Billion of trade. We’re passionate about digital assets and our mission is to bring professional, trusted technology that adds value to the industry and the markets.

Recommended from Medium

ZB Academy:The pace of newcomers from the traditional financial sector has not slowed down

Multi-Faceted vs Polymorphic

[公司觀點] Harvest Finance 被動式去中心化金融基金協助風險承擔者獲利

State of the DApps Weekly Overview. Week of 22/10/2018.

Monthly AMA Series — mBTC Launch

Welcome to BLOXtime

The truth behind Bitcoin energy consumption

Proof of Bitcoin energy consumption

MGT Solar Launches An Innovative New Project Combining Blockchain With A Sustainable Green Energy…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Efficient Frontier

Efficient Frontier

Leading research & algorithmic trading firm for the cryptocurrency markets efrontier.io

More from Medium

Solana Riptide Hackathon —  Pyth Ideas

Analysis of Supplementary Measures for Algorithmic Stablecoin Model

Solana (SOL) Accounts and Deposits on Evolve Markets

Bridges in a Multichain Future