From synthetic assets to perpetual contracts, Kwenta is a DeFi derivatives trading solution that includes multiple products. It has relatively innovative liquidity sources and is a good example for learning derivatives products.
The FTX incident created huge demand for on-chain perpetual contract exchanges. Protocols are trying to absorb all the traders who survived the FTX crash. Decentralized derivatives, especially perpetual contracts, have seen booming growth in trading volume, fees, and user numbers in a matter of months. The on-chain sustainability market is becoming hotter than ever.

In December 2022, Synthetix, as the most well-known synthetic asset DeFi protocol on Ethereum, will soon launch the v2 version update of the perpetual contract on its exclusive decentralized exchange-Kwenta.
Competition in the derivatives field has become more intense, and more new players are brewing better products.

Previously, TokenInsight has launched a "Decentralized Derivatives Exchange Research Report 2022 Q3", which provides a very solid and detailed discussion of the history and current landscape of the derivatives market. Kwenta is certainly one of them. For those who haven’t read it yet, click on the link above to learn it.
However, the report mentions many trading concepts that are quite complex and difficult for junior players or novice DeFi users.
In this article, we try to explain how Kwenta’s perpetual contract product works from a beginner’s perspective, starting from the most basic concepts, what is the difference between Kwenta’s perpetual contract and other DeFi derivative protocols, and finally its v2 version How to improve its scalability, user experience and on-chain liquidity.
What are Crypto derivatives?
So before we get started, we need to know what derivatives in cryptocurrencies are and what their regular gameplay is. If you already know this part, you can jump directly to the synthetic assets part below.
In tradfi (traditional finance), derivatives refer to a special financial contract that carries its own risks. Its value depends on one or more sets of underlying underlying assets or indices. It is a very common financial instrument. Futures and options are the most common derivatives and can be used for hedging or speculation, etc.
In Crypto, derivatives such as perpetual contracts, options, and synthetic assets are also financial trading instruments derived from certain Crypto assets as the underlying underlying assets.
Perpetual contracts, the most common Cyrpto derivative, are now widely adopted by centralized exchanges such as Binance and BitMEX, as well as decentralized protocols such as Kwenta, dydx, GMX and Perpetual.
Synthetic assets are another great innovative tool in the DeFi space (more on this later). It improves on-chain transaction diversity and scalability, requiring transactions on specific synthetic asset protocols such as Synthetix, Linear Finance, and Mirror protocols.
Crypto options are relatively niche and are more targeted at professional hedgers rather than speculators who are willing to be actively exposed to volatile markets. This article will not cover this topic.
What is a perpetual contract? Why do traders love perpetual contracts?
Just remember: it can be a short-selling tool; it is also a capital leverage tool; it contains the four most basic elements: mark price, index price, funding fee and margin. For a more vivid understanding of perpetual contracts, please refer to the cartoon guide to perps written by Paradigm Dave White

Perp, short for perpetual contract swap, is a Crypto futures derivative with no expiration date invented by Arthur Hayes, the founder of Crypto derivatives exchange BitMEX, in 2016.
It is mainly similar to a futures contract in traditional finance. It is also a contract in which traders pay a margin to trade future assets, but it has no expiration date. This means that traders can speculate (long and short) on related assets by increasing leverage without holding any spot, and thus do not need to worry about the delivery risk or storage cost of spot (this is the most useful function of perpetual contracts, and also the main goal of inventing it).
The implementation of perpetual contracts varies greatly from centralized exchanges to decentralized exchanges, but generally speaking, a standard perpetual product has four basic elements in common:
Mark price: refers to the price of a perpetual contract itself at a certain point in time. It generally comes directly from the market transaction price of the contract. It is also used to calculate profit and loss and help trigger liquidations.
Index price: refers to the price calculated based on the proportionally weighted average of the spot market transaction prices of the underlying assets on major exchanges.
Ideally, in order to achieve the goals we have stated above, and without taking into account distracting factors such as trading rewards, the value of a perpetual contract should be approximately the same as the spot value of its underlying asset. The mark price should be roughly equal to the index price.
In traditional finance, as the expiration date approaches, the futures value will gradually converge to the spot value. But perpetual is different. Since it never expires, its mark price may deviate greatly from the index price of its target asset. Therefore, we need a mechanism to ensure that the mark price converges to the index price so that it floats near the index price.

Funding fee: It is a tool that helps the mark value of the perpetual contract move closer to the index price corresponding to the spot underlying. It is also the core innovation point of the perpetual contract. When the index price deviates from the marked price, the system transfers funding costs between longs (buyers) and shorts (sellers). If the price is higher than the index price, it means that there are more long (buy) positions than short (sell) positions, and the long sellers will pay a certain funding fee to the short sellers, and vice versa.
Margin: is the trader’s collateral. When the market moves in the opposite direction to a trader's position, the resulting loss will be deducted from the margin. If the margin balance is too low, the position will be liquidated, which means the position will be forcibly closed automatically. The margin ratio often determines the leverage of a position. A Bitcoin perpetual position with $1 margin and 100x leverage is like holding $100 in Bitcoin spot. The less margin you mortgage, the higher the leverage you get, which means the more capital efficient you are, but the higher the risk you take. If the Bitcoin perpetual mark price fluctuates 1% against the direction you opened the position, and you do not replenish more collateral in time, your position will face liquidation.
If the risks are so high, why do traders love perpetual products so much? We believe that it has three benefits that traders cannot refuse:
One is that as we mentioned above, perpetual contracts allow traders to expose themselves to the risk of an asset without holding it. This solves many problems, because no matter what the market environment is, the holding costs and risks of spot stocks are often higher than imagined.
Another is that perpetuals allow traders to borrow assets they don’t actually hold to gamble for higher returns. Such leverage can directly increase capital efficiency, allowing them to trade larger positions with less money (only pledging margin, which is usually much less than the position). But this of course also brings its own unique liquidation risks.
The last point is that traders can easily short an asset without going through the older process of borrowing from external channels + selling directly + buying spot at the right time to repay the money.
What are synthetic assets? Where did the risk of synthetic assets go?
Just remember: it is a derivative token that simulates the price of other assets, and liquidity comes from a shared debt pool. The Synthetic Asset Protocol is a casino that plays simulated games with real money.
After understanding what perpetuity is, before introducing Kwenta, we also need to know the basic mechanism of synthetic assets. If you already know this part, you can jump directly to the Kwenta part below.
Here we only introduce what people usually call synthetic assets, which we define as: derivative tokens that are anchored to the prices of other assets through price feeds by oracles.
Synthetic assets generally require a DeFi protocol to help users issue them, and exist on a certain blockchain in the form of standardized tokens. Synthetix Protocol (formerly known as Havven Payment Protocol) is the first DeFi protocol to invent such derivative trading instruments. In theory, any asset whose price can be provided by an oracle can be minted into a tokenized synthetic asset.
For ease of understanding, you can think of protocols such as Synthetix as a casino. The games they provide are: players use the chip simulation plate to speculate in stocks and coins.
What is the principle of synthetic assets?
The gameplay of synthetic assets is divided into two steps: asset mortgage casting and trading. To facilitate understanding, we explain it from the perspectives of two market participants.
Founder (borrows money and assumes debt)
What to do: Over-collateralize an asset in the protocol and mint synthetic stablecoin assets, such as $SNX that is overcollateralized by 750% to mint sUSD, which is equivalent to a mortgage loan, but can only lend out synthetic stablecoins such as sUSD. After issuing sUSD, the system will record an account to the minter: how much is owed, what is the ratio to total accounts receivable (total debt), and what is the value of the collateral.
What you can get after staking:
Synthetic assets for some stablecoins;
Earn a certain handling fee (shared according to the proportion);
Incur certain variable liabilities.
What can you do after getting it:
Become a synthetic asset trader to speculate on other synthetic assets or hedge your own debt risk (see more below);
Become a market maker in the over-the-counter market for synthetic assets;
Sold directly off-market.
Staker miners are players who obtain chips (sUSD is equivalent to chips) through the official channels of the casino, and the way this casino buys chips is to over-collateralize the casino's own stocks to cast them. The system will keep accounts for the caster, indicating how much chips you create and how much share you hold. At the same time, the total value of the mortgaged stocks must be more than 7.5 times the value of the chips. In order to encourage players to use official channels, the casino will distribute the transaction fee to the players who cast the chips in proportion.
Example: Alice has $75,000 worth of $SNX, which is pledged to Synthetix and minted 10,000 sUSD. At this time, Synthetix will record to Alice: an asset of $75,000 $SNX, a liability of $10,000 sUSD, and a mortgage rate of 750%. At this time, Alice has started to earn fees in proportion. She can also become a trader and trade sUSD for other synthetic assets. She can also hold it unchanged, or she can choose to enter Uniswap in the over-the-counter market and sell sUSD for sUSD/ $USDC market making and more.
What are the risks of casting people? All the risks go here.
The combined collateral of all minters forms a large liquidity pool, and synthetic asset traders are actually betting against this pool.
All minters share a changing total debt pool. If the total debt continues to rise and the debt allocated to your own account also continues to increase, there will be a risk of liquidation.

On the other side, all synthetic assets add up to form a large chip pool. The value of this pool should be exactly equal to the total debt value on the account, so it is also called a debt pool. It is not difficult to find that the total debt amount has been changing with the changes in the number, type, and anchor price of synthetic assets. The total value of collateral should always remain at 7.5 times or more than the total debt pool. The increase or decrease in the debt pool will be allocated to each caster according to the share, and the system will directly modify the caster's debt balance each time (although it is a fixed balance when casting a loan).
What really happens is this: the system tracks debt pools by issuing/burning special tokens for their share of the debt when minting or burning sUSD. A minter's debt share is his debt token balance divided by the total supply of debt tokens.
When one's own debt balance decreases, the mortgage rate increases, and the minter can mint new chips to lower the mortgage rate. When their debt balance increases and the mortgage rate decreases, the minter can destroy some chips or supplement collateral to increase the mortgage rate. When the mortgage rate is too low and operations are not performed in a timely manner, the system will force liquidation.
Therefore, Alice's debt balance of $10,000 is changing at this time. Assume that the total debt pool is worth $20,000. When the value of the sBTC synthetic asset increases by $5,000, the total debt pool will also increase to $25,000. Since Alice's debt ratio is 50%, she will pay half of the new debt, which is $2,500. So Alice's new debt balance after the increase becomes: $12,500. Alice's net loss is -$2,500. If Alice does not replenish collateral or destroy some sUSD at this time, the collateralization rate will be lower than the required 750% collateralization rate, but still less than the liquidation collateralization rate.
The difference between traditional casinos lies in the difference in counterparties: in traditional casinos, players make money from other players, and the casino takes commissions. However, this DeFi protocol is that the assets of the pledgers are the counterparties to the total volatility of all synthetic assets. Therefore, when the overall market rises, the dealer who pays the gamblers is the minter himself.
Overcollateralization is used for two reasons:
The volatility of collateral is high, and over-collateralization can reduce the risk of insufficient collateral value. If the value of the collateral drops too much, the system will liquidate and sell the collateral in advance before reaching the minimum requirement.
Total debt volatility is high. Even if the value of mortgage assets is stable, if the total debt pool rises too fast, there will be a risk of insufficient collateral.
Synthetic asset traders
What are the conditions: Hold synthetic assets, so the minter can become a trader directly.
Players who do not want to go through official channels to obtain chips (and do not want to take on debt) can buy chips directly off-site. Some synthetic assets have certain liquidity in external AMM pools (such as sUSD/$USDC in Curve, sETH/$ETH in Uniswap, etc.) and can be purchased directly.
What can be done:
Synthetic assets can be speculated and traded to earn the difference.
Advantage 1: Reduce the friction cost of operating spot goods. If you want to speculate in gold but don’t want to hold spot, because holding spot will bring a lot of trouble and cost, you need to consider specific trading venues, storage costs, transportation costs, security risks, etc., you can choose to trade synthetic assets sXAG (synthetic gold ) token, Kwenta v1 uses the Chainlink oracle to track the price of gold, and its price performance is consistent with gold spot. If you want to handle complex combinations such as long $BTC, short $ETH, and long $XRP at the same time, but do not want to use a centralized exchange, directly purchasing synthetic assets such as sBTC, iETH, sXRP, etc. will greatly reduce the friction costs caused by various operations. .
Advantage 2: There is no slippage when trading synthetic assets. Since the price of synthetic assets comes from oracles, holders do not need to worry about the liquidity of the asset, and there will be no slippage in trading.
Transaction process: Real synthetic asset transactions do not occur with other players, but are a process of system accounting, destruction, casting, and accounting again. All transaction prices come from external oracles, and synthetic assets do not have independent prices in their own markets.
After having the chips, the player holding the chips (sUSD) wants to buy which stock and pays the chips if he is optimistic about the price. The system will calculate the quantity based on the external real stock price (from oracle) and issue the correct number of stocks/Crypto to the player. Notes (sBTC, etc.). When players feel that their stocks have risen enough and they have made enough money to close their positions, they can exchange the notes back for chips. The system will update the accounting internally.
Example: Alice has 10,000 sUSD in hand and wants to buy all of it sETH. The system will first destroy 10,000 sUSD in Alice's wallet ➡️ Update the total supply balance of sUSD (-10,000) ➡️ Oracle determines the $ETH exchange rate (assumed to be $1,000) ➡️ Collect fees ➡️ Mint the corresponding number of new sETH (about 10) and send it to Alice Wallet ➡️ Updates sETH total supply balance (+10).
The risk of loss can be hedged against fluctuations in debt. (for casters only)
The Synthetix protocol has a synthetic asset that specifically tracks the total debt pool index. Purchasing this asset can hedge the minter's losses due to the increase in total debt.
Kwenta, a decentralized exchange that allows trading of both perpetual and synthetic assets
Finally, we talked about Kwenta, a decentralized synthetic asset spot exchange on Ethereum + a sUSD-based on-chain perpetual contract exchange on Optimism.
Kwenta is a marketplace (providing UI/UX) for spot swaps of all synthetic assets minted in the Synthetix protocol. Here you need to distinguish: every synthetic asset trader executes trades of sUSD and other synthetic assets (sBTC, sETH, etc.) on the Kwenta contract. Each staker (minter, debtor or liquidity provider) stakes mints, redeems and manages his share of the debt on the Synthetix contract. The process of spot market trading provided by Kwenta is just like the example we mentioned above, and will not be described in detail here. Let’s focus on Kwenta’s sustainable products.
What is the principle of Kwenta’s perpetual contract? How is it different from the centralized perpetual and the popular decentralized derivatives exchange GMX?
Just remember:
Kwenta uses Synthetix's debt pool as the counterparty; Kwenta has a funding rate mechanism but GMX does not; Kwenta uses sUSD as the standard.
Both Kwenta and GMX use oracles to directly feed the index price as the mark price, so there will be no price difference, and it can even be said that the two prices are the same thing here.
GMX limits total positions to approximately 1:1 with the total amount of collateral in the pool. Kwenta uses a capital fee mechanism to partially offset the risk of price fluctuations and achieve greater capital efficiency.
Kwenta also offers a perpetual contract trading market, but only on Optimism L2. Its mechanism is similar to GMX, which uses a pool as the counterparty for all traders. But unlike GMX, which uses a GLP pool (a basket of assets), Kwenta uses Synthetix’s debt pool directly. (This is why we need to explain the principle of Synthetix in advance)
We can think of Synthetix's debt pool as the casino chip pool we mentioned above. Synthetix is more like a cash management system for a casino, while Kwenta is more like a gaming lobby for a casino, offering different games. Spot trading synthetic assets (or virtual crypto market simulator games) is one of them, perpetual trading is another.
A standard perpetual product on a centralized exchange would look similar to the example we mentioned above. It has the following characteristics:
Order Book Pattern.
The mark price is determined by the perpetual transaction value and is aligned with the index price through transfer funding fees. But perpetual offerings from decentralized protocols like Kwenta and GMX may differ slightly from standard perpetual offerings.
In the cases of Kwenta and GMX, unlike the order book model, the counterparty of all positions is an asset pool rather than a certain counterparty in the market. This means that the long open contract volume can be unequal to the short position (in tradfi's order book model, the long volume must be equal to the short volume due to the existence of mutual counterparties). Specifically, the liquidity of the Synthetix debt pool shared by Kwenta also means that when the longs and shorts are imbalanced, all Synthetix minters bear the risk of exceeding the long-short difference.
Alice opens a 100x long position in Bitcoin on Kwenta, using 1 sUSD as margin (the sUSD she purchased from OTC), and her open position is 100 sUSD. When the price of Bitcoin increases by 50%, her position becomes 150 sUSD, which increases the total debt pool by 50 sUSD.
However, if Bob also opens an opposite 2x Bitcoin short position at the same time, using 50 sUSD as margin, Bob will be liquidated when the Bitcoin price increases by 50%, and the total debt pool remains the same.
At the same time, Kwenta's perpetual mark price (that is, the true value of the perpetual) is also an index price provided directly from the outside by oracles such as Chainlink, which means that the mark price is automatically equal to the index price, and it does not require a capital fee mechanism to Evening the price gap.
However, although the mark price is fixed equal to the index price and will never deviate, when extreme moves occur, the net position (the net value of longs and shorts offset) can tilt to a significant extent. If the market becomes too bullish or bearish on an asset, the debt pool will bear significant counterparty risk in the direction of the net position tilt. To reduce the volatility of the debt pool, funding fees continue to remain in Kwenta’s perpetual mechanism (although not required). With funding fees, positions on one side of a crowded market will be funded, while positions on the other side will be funded.
In contrast, GMX does not apply a funding fee mechanism because its GLP pool can fully bear the risk of all net position offsets. The GLP pool contains different underlying assets, and the total value of a certain asset in the GLP pool is the total position limit of the asset's perpetual contract. In GMX, traders essentially use margin collateral to borrow real underlying assets. So they only have to pay borrowing fees for GLP holders.
Therefore, GMX limits total positions to roughly 1:1 with the collateral in the pool.
GMX traders can only open perpetual contracts on assets included in the GLP pool (currently only $BTC, $ETH, $UNI, and $LINK). Details of GMX’s maximum position capacity can be viewed in this document.
Comparison: Similarities and differences between Kwenta’s sustainable products and other sustainable products

Other more detailed functions of Kwenta sustainable products:
Independent margin account (Isolated Margin). Allow traders to manage their position risk individually and provide collateral for a position/asset individually. In particular, separate margin accounts support the next price “next price” order type to prevent the front-running trades that Synthetix was criticized for long ago. Please visit here for details.
Cross margin account (Cross Margin). Allows users to trade on any market by staking to a single margin account. In cross margin mode, Kwenta supports limit orders, take profit and stop loss orders.
Kwenta Perp v2 updated to reduce risks and improve the trading experience of sustainable products
Just remember: improvements to the funding rate mechanism in v2 help reduce net position skew. The more balanced the market's tilt, the higher the market's total position limit.
On December 21, 2022, Kwenta announced that its Perp v2 alpha version was officially launched.

Below we list some of the major updates for Kwenta Perp v2:
Change oracle from Chainlink to Pyth Network. Pyth Network is a pull-based decentralized oracle that allows users to quickly request a price while conducting transactions. (Chainlink will provide back-up protection in case of price deviation)
Pull-based refers to an oracle that obtains data through the request + respond mode. For example, when a smart contract needs data, it requests the data from the oracle. After the oracle receives the request, it collects the information from off-chain data sources and provides it to the smart contract. This is called a pull-based inbound oracle. Inbound is actually a mode of writing content into a contract. On the contrary, outbound is the mode for reading smart contracts.
Push-based (inbound for example) mode oracles monitor any changes to a specific data source. When there are changes in the data source, these changes will be actively pushed to the smart contract on the blockchain.

After optimizing the oracle, the fees will be reduced.
After optimizing the oracle, more frequent price updates + regular pricing.
Optimization of funding fees. Perps v 2 achieves a smooth shift in funding rates. The capital interest rate under Perps v2 does not immediately jump to the opposite direction as the deviation turns, but "slowly drifts" from one direction to another according to the deviation. It will no longer drift when the deviation is balanced. gone. This pattern means that traders have more incentives to collect funds through trading strategies and are less likely to be exposed to risks due to sudden changes in the direction of funding rates.
The smaller the deviation of the market, the higher the limit of the total open position in the market. As a result, the market can support total open positions several times larger than GMX collateral as a backing asset, helping to bring deeper liquidity to traders.
Due to improved funding rate design, Perp v2 will be suitable for more volatile long-tail assets in the future.
But now only works with $ETH-sUSD Perp.

in conclusion! See what you learned
The Perp Perpetual Contract is one of the most successful Crypto innovative financial products. Because of its strong universality, cryptocurrency trading has spread from degens to Wall Street giants. With Perp DEX becoming a hot commodity following the collapse of FTX, we believe it is essential and practical for crypto enthusiasts of all levels to understand how this eye-catching trading method can be adopted on-chain. . As a scalable and complex DeFi protocol, Kwenta optimizes a more innovative Perp trading mechanism and deeper liquidity, which may be a bit too complex for novices to absorb. And now, after reading this article, beginners can understand the basic principles of how all these elements come together and function. This is not just for experienced traders but is friendly to players of all levels. The biggest innovative solution in v1 of Kwenta’s perpetual product is the shared debt pool as liquidity + counterparty. By leveraging Synthetix’s liquidity, Kwenta can offer more interesting simulated casino games like perpetual trading. At the same time, the biggest improvement of Kwenta Perp v2 is that a better skewness balancing method is applied, which enhances the upper limit of the largest position, which is difficult to achieve by other DEX such as GMX.
I hope this content is helpful to you and I wish you all a Merry Christmas 🎄.
Welfare is coming! Practical Tips for Evaluating Perp DEX
According to our Derivatives Ecosystem Report, when we try to evaluate a derivatives DEX, we should consider multiple dimensions such as liquidity, size, fees, mechanics, and more.
When considering using on-chain derivatives DEX, we should consider the following practical issues:
On which chain is DEX deployed?
How liquid are DEXs?
How many Crypto can I trade?
How big a position can I open? What is the maximum leverage?
What are its transaction fees? How to charge?
What is the fastest frequency I can trade at?
Is it decentralized enough?
I believe that after you find these answers one by one, you will naturally have a good idea of its products.
Special thanks to Wayne, WDK Paul, quant Z bra and Aidan Lan
Read the original article here: https://tokeninsight.com/zh/research/analysts-pick/beginners-guide-to-crypto-derivatives-kwenta-case-study

