A Look into Decentralized Exchange- Perpetual Protocol
Profiling a DeFi Exchange in Taiwan
Author’s note: If you want to watch the video first, watch below. Both were released simultaneously.
You can read his post here. It was a pleasure working with 0xKowloon on this. I don’t often do collaborations, but I could not resist dipping my toe into DeFi a bit. This is only the second time I have published anything mentioning crypto, and though I am collaborating with someone who knows this stuff a lot more than me, of course mistakes will be made.
And again, Jesus, don’t make an investment because I wrote about it a little.
Perpetual Protocol is growing quite well. The rolling 28 day average of traders is going up and to the right.
This seems to be in part due to a low base and a “rising boat lifts all tides” situation. But also an indication that there’s some interest in what they are doing.
Decentralized Finance or DeFi is starting to come into real use. Something that had been just Bitcoin is blooming into something that can actually rival traditional financial structures.
Really, I mean it. These crypto-analogs of financial markets are something to behold. Here, I want to look at one particularly interesting DeFi protocol by a team based out of Taiwan: Perpetual Protocol.
This profile of Perpetual Protocol is done in conjunction with 0xKowloon, a good friend of mine. He is publishing a Substack in which he dissects DeFi protocols at a code level. If that is something that interests you, I recommend you subscribe to it.
The Golden Path to Decentralized Exchanges
DeFi is a massive field. It deserves hours and hours of video. In this particular section, I am going to just take us down a golden path towards what Perpetual Protocol does.
If you already know much of this, feel free to skip ahead to the section where I discuss Perpetual Protocol's particular contribution.
That is all. I caution you from thinking that since you watched this video, you now know everything.
Cuz you don't. You know nothing, Jon Snow.
Also. Just FYI. I’ve never met these guys. I wrote this profile using publicly available information. I did my best to be accurate but this stuff changes fast. But as the phrase goes, the best way to find the right answer on the internet is to make an incorrect statement.
And I am definitely … absolutely … 100% for sure not telling you to buy or invest in anything. I am seriously going to be disappointed if any of y’all bought a thing because a random voice on YouTube talked about it.
Over the Counter to Centralized
Let us begin. If you want to trade one crypto for another, let us say Ether and Bitcoin, you need to have a counter-party to receive and complete the trade.
In the beginning, the way of doing this was to find some other guy who does the transaction direct with you. To do it this way is called an "over the counter" transaction or OTCs.
Direct trades between two parties however are inefficient and risky. Prices are haphazard and rife with fraud. If you have tried to buy or sell a second-hand item on Craigslist before, you might get what I mean here.
So the world developed market exchanges where buyers and sellers can aggregate, facilitate, and regulate transactions. A stock exchange like the New York Stock Exchange or the Taiwan Stock Exchange is an example of this. Coinbase is an example of this in the crypto world. And AirBnb is a non-financial example relating to housing.
In a centralized market, buyers and sellers submit orders for buys and sells to an order book. The order book's orders are often made public so that participants can best judge what offers to submit. The market then matches up the buys and sells in an attempt to create the most efficient outcome.
Undoing the Centralized
Centralized market exchanges are dominant in today's world because they largely ameliorate the risks associated with OTC transactions. But they have their own risks and drawbacks. This is especially the case in the crypto world, where traditional regulation cannot help clean up market messes.
For instance, maintaining custody of crypto assets. The theft of 850,000 bitcoins from Mt. Gox, once the world's leading bitcoin exchange, really sucked for its clients. Or rampant price manipulation like what happened in the early 2010s.
Or exit scams like a recent one in Turkey. A crypto exchange called Thodex with 400,000 users suddenly went offline in April 2021 with the CEO taking off with $2 billion of investors' money.
One of crypto's key points is decentralization. So what is the point of decentralizing the asset if the exchanges are all centralized?
The main question, though: How to do it? An increasingly popular alternative would be through the use of Automated Market Makers or AMMs. Like with other aspects of DeFi, the AMM is an algorithmic implementation of a traditional financial concept: the market maker.
Market makers exist to deal with temporary situations where "liquidity" is in short supply. "Liquidity" meaning the ease with which an asset can be exchanged. Market makers stand ready to provide that liquidity - constantly buying and selling stocks, foreign exchange, or other financial assets at the publicly quoted price.
The NYSE and London Stock Exchanges have "official" market makers who help move the market along when buyers and sellers get out of balance. Official market makers are real, actual companies that make money from the difference in the prices of the submitted buy and sell in the order book.
The AMM seeks to achieve the same results as the traditional market maker. Traders can submit orders to the AMM. The AMM algorithmically provides a price to those traders that executes the trade. The liquidity comes from other DeFi users who want to earn fees from their holdings.
Similar outcome, but the mechanism is different. How it is implemented depends on the particular DeFi startup. UniSwap, a decentralized exchange pioneer, has one approach called liquidity pools.
Perpetual Protocol offers an interesting implementation that allows it to replicate certain trading options offered by other, more centralized crypto exchanges like Binance.
Okay, we have completed the golden path. Now we can actually start talking about what Perpetual Protocol brings to the table.
Perpetual Protocol adopted some popular aspects of the AMM concept while rejecting others to offer their users new trading options with fewer drawbacks. Namely, leverage options of up to 10x margin, shorting, and perpetual contracts.
A perpetual contract is a crypto-version of futures - a type of financial derivative instrument. Pioneered by Bitmex, they allow traders to speculate on the future price of a crypto-asset.
Traditional finance traders trade gold, wheat and oil futures to speculate on their price movements. But futures are also useful in business. Oil producers and other commodity providers like farmers can use futures to lock in a price ahead of time and avoid getting burned by prices suddenly changing on them due to unavoidable conditions.
Perpetual contracts are not one-to-one the same as traditional financial futures. Most critically, they do not have expiry dates. But the key point is that they allow for leveraged bets on an asset's future price movements.
So to sum up our progress so far: Perpetual Protocol's key differentiation is a decentralized-exchange-offering of a crypto-version of a traditional financial derivative asset. Ha! Got all that?
The Virtual Automated Market Maker
Perpetual Protocol enables these in a decentralized way with what they call a Virtual Automated Market Maker or vAMM.
When traders want to trade on leverage, they deposit funds (a common one would be USDC, a digital dollar stablecoin linked to the US Dollar) into a separate vault that holds it as collateral. The vAMM credits the trader with their requested buying power.
The vAMM does not handle assets, nor is it moving them around. Rather, it is making marks to keep track of leveraged virtual positions - virtual ether or virtual USDC - and setting prices based on a constant price discovery function.
An interesting consequence of Perpetual Protocol doing things this way is that it gets a lot easier to trade asset pairs right off the bat. Other decentralized exchanges like UniSwap are making swaps against accumulated pools of the asset pair. This means that the pool has to first reach a critical threshold size before decentralized trading can happen.
Perpetual Protocol's approach sidesteps the two-sided buyers and sellers problem that plagues so many new marketplaces. Per the management team, launching this new feature is expected to greatly expand the protocol’s usefulness.
The Beauty of Leverage
The way Perpetual Protocol works, with its virtual tracking of assets and position values, reminds me a little of a total return swap or TRS in traditional finance. Hedge funds use them to gain exposure to an asset without actually needing to own it.
They pay a counter-party a set rate. And in return the counter-party makes payments based on the return of an underlying object. The TRS owner never owns the asset, but gets cash payments like as if they did. They start and end with cash.
Likewise, on Perpetual Protocol, traders always start and end with a stable-coin, the crypto analogue to cash. The vMM makes it such that they are not ever holding the underlying asset.
TRS are popular in traditional finance but it is not entirely clear if crypto traders and early adopters will be as interested in their DeFi versions. It might take some time for traders to get their minds around the thing.
Furthermore, leverage is a beautiful, but dangerous thing. As many a Wall Street trader might know, having excessive leverage when a position goes against you can have disastrous consequences. It is worth noting that when Archegos blew themselves up, they were using TRS.
Likewise if your trade goes against you, Perpetual Protocol will - like any other exchange - close your position and take your collateral. For them, if your margin position reaches a 16x threshold then the trade might get automatically stopped out.
Team and Challenges
For Perpetual Protocol itself, there remain many challenges. For instance, flash crashes. One large flash crash in April 2021 took the price of Ether down to $870 USD for a few moments.
Such things are probably unavoidable. Centralized markets like the New York Stock Exchange have had decades to deal with these market failures yet they still happen. My favorite is the August 24, 2015 ETF Flash Crash, when trading of 471 different stocks and ETFs had to be halted.
But the 10-person team seems well tasked for the job. Led by serial entrepreneur Yenwen Feng and Shao-Kang Lee, I found their documentation and marketing communications simple and straightforward. They seem to get how to make developers comfortable with developing on their platform - making themselves accessible and holding regular events.
And as 0xKowloon will point out in his piece, the code is ambitious and sophisticated.
Taiwan's relatively light crypto regulation, immense savings glut, highly educated population, and, perhaps, a brain drain from China after the PRC's crypto crackdown, is contributing to the Taiwanese DeFi industry.
Crypto meetups in Taipei are regularly packed. And I have begun to see a plethora of blockchain and DeFi startups recruiting in Taiwanese job fairs. A few other names of note include Steaker, HFT trading firm Kronos, and FuruCombo.
Something that I think is interesting is that many of these startups do not seem to be focused on the domestic market. They are looking to go outwards, based on my evaluation of their Web 3.0 design standards and English centric documentation.
Author’s note: The sad thing is that many of these services are not accessible to Americans. Likely due to financial regulations.
That being said, the DeFi space is in its early stages. There are 58 listed startups alone in the DeFi pulse list, all with their own schtick. Tracking their progress as they bloom and develop decentralized analogues to Wall Street financial markets and instruments will be exciting.