ZetaMarket: under-collateralized DeFi derivatives platform
(Archive).
- 24k follower; Discord 14k, active ~1.2k; Very active 中文channel, other language little quiter
-Jan 17, 2022 go live on Solana; Nov 2021 had testnet
-Team members
-> Chinese, LyraFinance discord中文mod

Context:

Crypto derivatives trading volume represented $3.6tn, or 57.9% market share of total trading volumes, as of October 2021, the second-highest level recorded since November 2020

Problems on Derivative Protocol

High on-chain fee
No liquidity pool has been able to both attract significant TVL and remain profitable
fully/over collateralize → higher option trading friction
Liquidity Stalemate - Core problem

What is ZetaMarket doing?

fast, under-collateralized options trading
deep liquidity, driven by a hybrid orderbook and unique options AMM

How does ZetaMarket do what they do?

Produce relevant information of every option (e.g. strike, expiry, etc) on-chain, automatically. Use better UI to present these info.
Pricing Mechanism, Hybrid orderbook, and Options Market Maker (OMM)
Using a derived model based on the BSM pricing model to price option. Zeta used a global volatility surface to adjust supply and demand for volatility. More on below
Collaborate with Project Serum and makes an on-chain orderbook-based DEX - this is revolutionary and difficult in the past, because 1) building an on-chain order-matching machine was hard, and 2) L1 gas super high
Detailed mechanics and math of OMM . TLDR: Zeta will include dynamic volatility into option pricing, reflect the “true price” of any option, reduce arbitraguer, and brings better return for LPs.
Delta hedging and other Impermanent Loss are also discussed, but those are too technical for here.
To prevent platform overbankrupcy, Zeta created a liquidation engine and Portfolio Margining System to auto-liquidate risky position. This is achieved through the 400ms blocktime of the Solana Chain. More below.

Archetecture of trading on Zeta overview⬇️
image.png

Zeta’s Margin System

Utilizing the 400ms block time of Solana, Zeta is able to monitor multiple times per second, enabling the implementation of a margining system which allows for an under-collateralized trading experience that rivals centralized exchanges.
There are three core component of Zeta’s Margin System:
Mark Pricing: Zeta has its own internal pricing engine which calculates the Mark Price of all tradable assets and uses this to inform its margin and collateralization system.
Collateral Framework: Under-collateralized trading meaning higher capital efficiency and risk. This framework ensures that the exchange can, at large, remain functioning
Liquidation Mechanism: allows liquidators to step in when a user's trading account is too risky to continue trading. When this occurs the user is liquidated to ensure that the losses do not extend beyond isolated users and keeps the platform from losing money.
Note that, there is a one-time margin account fee (~0.044 SOL) every time you start trading on a new new asset class. This account is used to keep track of all your option-related information for this asset class.

Mark Pricing

A key component of pricing options is volatility - this measures how much an underlying asset moves. The Zeta Protocol maintains its own volatility surface for each expiry. For each trade that occurs between 5d and 60d the volatility surfaces are adjusted as there is new information that must be factored into pricing.
Zeta uses the Black-76 model to price its options, this is a model based on BSM model. The model has the following inputs:
Future Price: Is calculated using the underlying price provided by the oracle, the risk free rate and the time till expiry.
Volatility: Of the underlying asset is calculated by the volatility surface that Zeta maintains (mentioned above).
Interest Rate: Is returned from the risk free rate curve which is stored by Zeta.
Strike: Is the price predefined in the contract for which to buy or sell the underlying - this a parameter defined in the options contract.
Time to Expiry: Calculated from the expiry time - which is a parameter defined in the options contract.

The details of Zeta’s volatility surface calibration and mark pricing for futures will not be discussed in in detail here. You may refer to this page for a more mathematically verbose information:

Collateral Framework

Zeta currently only accepts USDC as collateral. So users can only deposit and withdraw USDC from the system. All trades are settled and margined in USDC.
The following specifications are used in the margin system:
Account Balance (AB): USDC deposited in account. Changes on deposit, withdrawal, position close and settlement
Unrealized PnL (UP): Profit and loss from existing open positions
Initial Margin (IM): Capital reserved for collateralizing opening orders
Maintenance Margin (MM): Capital reserved for collateralizing open position

When a user places an order that adds to their existing position, the initial margin requirements are checked. This is done to ensure that opening the position will not push the user into a state of bankruptcy:
where IPnL = instantaneous PnL from execution.
The margin system also monitors a user's existing positions and orders to ensure that the user does not enter a state of bankruptcy:
User withdrawals are also considered by the Zeta margin system ensuring that a withdrawal does not push a user into bankruptcy. As such withdrawals are limited to:
where UPnL = unrealized PnL. Orders that close a position are not charged margin.
Margin Requirements for options and futures:
Options⬇️
image.png
Futures⬇️
image.png

Liquidation Mechanism - the liquidation engine mentioned above

When accounts do not have sufficient capital they will need to be liquidated to ensure that the system at large does not become bankrupt and to ensure that risks are isolated to individual user accounts where possible.
The element underpinning this process is the margin check:
If a user fails the margin check, the liquidation process will begin:
Step 1:
3rd party liquidators can cancel all open orders on a person’s book. The user will not be able to send orders during this time until all orders are cancelled.
Step 2:
If the user is still below maintenance margin after the above cancels, they are able to be liquidated by sending a liquidation instruction. This instruction specifies a particular margin account, the market’s position and the size to be liquidated.

Upon a successful liquidation, the liquidator will trade with the liquidatee at the current mark price stored by Zeta, as well as gain a fixed % of the liquidatee’s collateral put up for maintenance margin as a reward. This reward is currently set at 35% of the maintenance margin for both options and futures positions, with 30% going to the liquidator and 5% going to the insurance fund. Liquidation is a permissionless instruction, open to anyone, and is a risky endeavour and not guaranteed to be profitable.

Insurance Fund - continued on Liquidation Mechanism

In the scenario that a liquidator does not step in to secure risky positions, or a liquidated user’s account does not have enough capital to reward the liquidator, the required capital will be drawn from the insurance fund.
This insurance fund will comprise of all platform fees, a fixed proportion of liquidation incentives and an initial seed at day 0.

Socialized Loss - should Insurance Fund fails

If both the liquidation process and insurance fund fail to cover over-bankruptcy, losses will be shared across depositors in the Zeta platform. This will be implemented by applying an over-bankruptcy ratio to withdrawals ensuring that the platform has sufficient capital to continue operating. Withdrawals will be subject to the below ratio:
where:
AB = Account Balance
DP = Deposits To Platform
BA = Bankruptcy Amount

Derivative Framework

is described in detail over here. I reckon no further processing is required

Zeta Infrastructure

Historically in DeFi, due to network congestion, blockchains have been too slow to facilitate the transaction volume required to create an experience similar to that of a centralized exchange; slow block time also added to the complexity of accurately reflecting dynamic volatility. This has created friction for both institutional and retail traders.
The Solana chain’s speed-first approach paved a way ahead for Zeta Market:
High Transactional Throughput: 50,000 per second.
Low Fees: Less than $0.1 of a cent.
Fast Settlement Times: 400ms block times.

Orderbook & Matching Engine

Zeta’s order-book style matching machine is composed in collaboration with Project Serum. Each unique market index that the user trades on is a separate serum market. This will require the creation of a serum open orders account. This is done atomically in the first order you place on that market. (This will have a one time cost per market index of ~0.024 SOL). Markets are reused on expiration, so a user will at most pay once per market index.
Orderbook constraints
The serum orderbook has enough space allocated to store a maximum of 455 orders per side (bid and ask). It uses a FIFO mechanism (first in first out). If more than 455 orders are placed, the first order placed on the orderbook will be booted off, and the corresponding order is cancelled for the user.

Pyth Oracle

The Pyth oracle provides per slot asset price updates, which is a key piece of building a robust exchange with up to date pricing. This ensures chain pricing is accurate and the Zeta platform security mechanisms can function as expected (margining system and liquidations).

Emergency Procedures

Platform Halt

Zeta's administrators hold the ability to halt the platform at any time, stopping withdrawals, trading, liquidations and settlement from occurring. This action may be undertaken if there are any significant bugs or oracle risks that are found. During a platform halt Zeta's administrators can override the oracle price, pricing parameters and internal exchange clock. All open orders will be cancelled during a platform halt.
If the platform is halted check Zeta's Discord for announcements on issues and current status.

Early Settlement

Early settlement on the Zeta platform can occur when the platform is halted, in the case that the platform is expected to be down for an extended period of time. Early settlement will settle users at mark prices determined by Zeta's risk engine. Funds will be safe and available to be withdrawn on platform resumption.
Zeta will announce on Discord before early settlement occurs and will communicate the mark prices of settlement to all parties.

Platform Resumption

Resumption of trading on the Zeta platform will occur when potential issues are confirmed to be resolved.Prior to resumption of trading an announcement will be made on Zeta's Discord.

Tools built by Zeta

To further support the Option trading ecosystem surrounding Zeta, the dev team at Zeta create Zeta Flex, a permissionless, customisable options creation and auction protocol, for options vaults and DAOs who want to monetize risk on their assets. Zeta SDK is also available and can be found here .
The Zeta Fuze Project is for Zeta's cross-program integration ecosystem on Solana. This tool allows anyone to integrate with Zeta from their own project on Solana.

bib

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.