# Welcome to Zeta

Trade your favourite assets with uncompromising security

<figure><img src="/files/n5gCmMAVkzTUctzJT1u1" alt=""><figcaption></figcaption></figure>

***Disclaimer: Zeta Markets has ceased operating as of May 2025.***&#x20;

Zeta Markets was a decentralised perpetual futures exchange built on the Solana L1. It was a pioneer in on-chain orderbook exchanges facilitating over $15bn in volume. Zeta Markets has since been discontinued and stopped operations. Bullet is a new network purpose-build for trading which extends many of things that Zeta achieved read more about Bullet [here](https://docs.bullet.xyz/) or visit the Bullet [FAQs](https://docs.bullet.xyz/faqs).

**Our Thesis:**

> *Defi is full of slow, clunky and expensive user experiences. We're changing that. Taking the best experiences of centralized trading apps and transferring them on-chain to bring users the benefit of transparency, self-custody, decentralization and community ownership.*

**Our Mission:**

> *To provide crypto traders the most reliable and secure platform to easily take advantage of market volatility.*

**Our Vision:**

> *The power of on-chain trading in the hands of every trader.*

Zeta has been a leading force in the DeFi space since its inception in 2021 and currently offers perpetual swaps trading across a number of popular cryptocurrencies. More info can be found on [Zeta's website](https://www.zeta.markets/).&#x20;

## Key features:

* **Secure**: Full self custody of assets, USDC margined.
* **Capital Efficient**: Up to 20x leverage with cross margin.
* **Price Discovery without Centralization**: Fully on-chain limit orderbook (CLOB).
* **Institutional Liquidity**: Programatic connectivity to our smart contract using our [**SDK / CPI programs**](/build-with-zeta/sdks/typescript-sdk) for Market Makers and other integration&#x73;**.**
* **Gamified**: Leaderboard, referrals and trading rewards.

Jump right in at [**dex.zeta.markets**](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=about\&utm_term=cta)

## **Quick links**

{% content-ref url="/pages/1gsxFQnSrddY2LfRkBmF" %}
[Support](/educational-resources/support)
{% endcontent-ref %}

{% content-ref url="/pages/RRCktMZncS6rJwb1V0B4" %}
[Trading Specifications](/zeta-protocol/trading-specifications)
{% endcontent-ref %}


# Official Links

All our official links

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Homepage</td><td></td><td></td><td><a href="https://zeta.markets">https://zeta.markets</a></td></tr><tr><td>DEX - Start Trading</td><td></td><td></td><td><a href="https://dex.zeta.markets">https://dex.zeta.markets</a></td></tr><tr><td>Telegram - Official</td><td></td><td></td><td><a href="https://t.me/realzetamarkets">https://t.me/realzetamarkets</a></td></tr><tr><td>Discord - Official</td><td></td><td></td><td><a href="https://discord.com/invite/SacGBFKNzQ">https://discord.com/invite/SacGBFKNzQ</a></td></tr></tbody></table>


# Learn how to trade on Zeta

Unpacking Zeta's perpetual futures offering and user interface

***Disclaimer: Zeta Markets has ceased operating as of May 2025.***&#x20;

## Quickstart

Don't have time to read the docs? Learn how to place your first trade on Zeta in minutes with this walkthrough.

{% @arcade/embed flowId="GILehB8750xs3PpASxr6" url="<https://app.arcade.software/share/GILehB8750xs3PpASxr6>" %}

## The Fundamentals of Zeta

{% content-ref url="/pages/jQbNSWCwaI42Dl106Una" %}
[Getting Started on Zeta](/zeta-protocol/learn-how-to-trade-on-zeta/getting-started-on-zeta)
{% endcontent-ref %}

{% content-ref url="/pages/hzwDo0OQygOJV5gSJbJ0" %}
[Order Types](/zeta-protocol/learn-how-to-trade-on-zeta/order-types)
{% endcontent-ref %}

{% content-ref url="/pages/Nbes3JObxZd4zrBJ1XPY" %}
[Margin Account Parameters](/zeta-protocol/learn-how-to-trade-on-zeta/margin-account-parameters)
{% endcontent-ref %}

{% content-ref url="/pages/5z0q4TjXszsDGoHShXAo" %}
[Asset Parameters](/zeta-protocol/learn-how-to-trade-on-zeta/asset-parameters)
{% endcontent-ref %}

{% content-ref url="/pages/YsxGIplmargQb3Ci1pc4" %}
[Funding Rates](/zeta-protocol/learn-how-to-trade-on-zeta/funding-rates)
{% endcontent-ref %}


# Introduction to Perpetuals

Perps 101

<figure><img src="/files/oOQkiF2L05UBO4MEH9YY" alt=""><figcaption></figcaption></figure>

## **What are Perpetual Futures (aka 'Perps')**

Perpetual futures, often referred to as "perps," are an efficient way to trade your favorite tokens. They allow you to speculate on the future price of a token or hedge against potential price movements. Unlike traditional futures, perpetual futures contracts do not have an expiry or settlement date. This means they can be held indefinitely, hence the term "perpetual.”

## **Why trade Perps?**

**Leverage**

The primary advantage of perpetual futures contracts is the ability to use leverage. This enables you to take larger positions than your account balance would normally permit. If the market moves in your favor, you could potentially earn a higher return than with spot trading.

**Short positions and hedging**

When you buy a cryptocurrency on the spot market, you actually own the underlying asset. This is great if you plan to use it in transactions, stake it in a DeFi protocol, lend it out, or hold it in your wallet. However, some of these actions can limit your ability to protect yourself from price movements.

Perpetual futures enable traders to take short positions, meaning they can bet on a price decrease which is not as easily achievable in spot markets. This allows traders to hedge their exposure to a particular asset. For example, if you hold a cryptocurrency and are concerned that its price might drop, you could open a short position in a perpetual futures contract to offset potential losses.

{% hint style="info" %}
For instance, let's say you have staked your SOL to a validator, but you are concerned about SOL's price dropping. If you want to sell your SOL, you must wait for a full epoch (2 days) to deactivate your SOL delegation.

While waiting for the cooldown/unstaking period to end, you can hedge your staked position by shorting the equivalent amount of SOL-Perp contracts.
{% endhint %}

## What are the risks?

While perpetuals can be a great tool for offsetting or hedging risks that exist in spot markets, it's important to understand the additional risks they come with in order to make the most of your trading experience on Zeta.

**What are the additional risks of trading perpetual futures over spot?**

* **Leverage risks:** Leverage can increase your profits, but it can also amplify your losses. If the market moves against your position, you may lose more than your initial margin. In the worst-case scenario, your account may be liquidated to cover the losses incurred by your losing position.
* **Liquidation risk:** If your account balance falls below the maintenance margin level due to market movements, your position may be liquidated.
* **Funding rate fluctuations:** When trading perps, you either pay or receive funding fees depending on the difference between the contract price and the spot price. These rates can fluctuate significantly, and if you're on the side that pays the funding rate, it could eat into your profits or even cause losses.

## Ready to get started?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=guide_intro\&utm_term=cta)


# Compatible Wallets

Updated 9th February 2023

There are a large number of established wallets on Solana that you can use to interact with Zeta:

* [Phantom](https://phantom.app/)
* [Backpack](https://www.backpack.app/)
* [Solflare](https://solflare.com/)
* [Torus](https://tor.us/)
* [WalletConnect](https://walletconnect.com/)
* [Clover](https://wallet.clover.finance/#/)
* [Coin98](https://wallet.coin98.com/)
* [Sentre](https://sentre.io/#/home)
* [Brave](https://brave.com/wallet/)
* [Nightly](https://wallet.nightly.app/)
* [Ledger](https://www.ledger.com/)

### Ready to get started trading?

[Trade now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=bridging_wallets\&utm_term=cta)


# Getting Started on Zeta

Beginners start here!

Once you click connect wallet in the top right hand corner, the wallets identified in your browser will appear in the menu displayed below.&#x20;

Don't have a solana wallet yet? Click [here](https://docs.zeta.markets/educational-resources/new-to-solana-start-here).

<div align="left"><figure><img src="/files/aKbt0c6Ca77PPBqI1i5L" alt=""><figcaption></figcaption></figure></div>

## Funding your account with USDC

1. Ensure you have SOL to pay for gas fees. You will need at least 0.10 of $SOL to pay for gas fees.&#x20;
2. Ensure you have USDC in your wallet to fund your account with.
3. Select which asset you want to trade and enter the amount of USDC you would like to deposit.&#x20;

<figure><img src="/files/4B5aYZSg3fJgcTKCfznv" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Zeta has one unified margin account for trading all assets.
{% endhint %}

## Asset selection

Zeta currently supports five perp trading pairs — SOL/USDC, BTC/USDC, ETH/USDC, APT/USDC and ARB/USDC. We take a strategic approach to asset listings and aim to list hot, liquid assets with staying power.&#x20;

To begin trading, select your trading pair using the dropdown asset menu in the upper left-hand corner of your screen. Star your favorite markets to save time upon returning to the platform.

<figure><img src="/files/eXmAeANMnb51pzYOOLCU" alt=""><figcaption></figcaption></figure>

## Opening a new position&#x20;

To enter a position, deice whether you are selling or buying at the top of the order form. Then, you simply select the desired number of contracts you want to purchase (or the amount in USDC), specify your entry price (if using a Limit Order), and then move the slider to adjust your account leverage.&#x20;

<figure><img src="/files/0r5IpFU42ZfruraJaXTE" alt=""><figcaption></figcaption></figure>

## Closing a position

Unlike dated futures and options, perpetual contracts don't expire, so your positions will remain open until your manually close them, or your are liquidated.

To close your position, select the *Close* button that relates to your position listed in the positions tab. Once you select the circle with the X in the middle, a close position box will pop up.

<div align="left" data-full-width="false"><figure><img src="/files/7ElrZVMrCyyaPWYx2P7y" alt=""><figcaption></figcaption></figure></div>

## Viewing your trade history

<figure><img src="/files/HUEoHhhOUi90MnIgNEVD" alt=""><figcaption></figcaption></figure>

## Ready to get started?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=guide_started\&utm_term=cta)


# Order Types

At present, Zeta offers the following general order types:

1. Market
2. Limit

Trigger Order Types:

1. Take Profit
2. Stop Loss

Advanced Order Types:

1. Fill-or-Kill (FoK)
2. Immediate-or-Cancel (IOC)
3. Post-Only
4. Post-Only Slide
5. Time-in-force

We also have Reduce Only orders.

{% tabs %}
{% tab title="General Order Types" %}

### Market Order

Market orders are your go-to order type when you're after immediate, unrestricted trade execution. Market orders are filled immediately at the best available bid-price or ask-price on the orderbook.&#x20;

Traders generally opt to enter and exit positions via market order when optimizing for timely trade execution over precision pricing.&#x20;

When you place a market order, you're opting to buy or sell your derivatives contracts at the best available price the market has to offer. Market orders are clutch for traders that need to get in and out of positions quickly.&#x20;

When time is of the essence, market orders are the fastest and most efficient tool for you to adjust your exposures, whether you're riding momentum or skirting a falling knife.

### Limit

Limit orders are used to specify the highest bid-price or lowest ask-price a trader is willing to accept. Traders use limit orders to define entry and exit prices to reduce their cost-bases and automate their entries and exits.&#x20;

When you place a limit order, you are opting to open or close a position at a particular price or better. This means that once your order is placed, execution will not occur unless the market is able to accommodate your specified limit price.&#x20;

Going long a perp on Zeta via limit order entails selecting a maximum price at which you are willing to buy (long) a perp. Your order will not be filled unless the price of the perp drops to your limit price.

Going short a perp on Zeta via limit order entails selecting a minimum price at which you are willing to sell (short) a perp. Your order will not be filled unless the price of the perp rises to your limit price.

Closing a long perp on Zeta via limit order is a take-profit order that entails placing a sell-to-close limit order at a specified price or higher in order to offset — and thereby close — your long perp position.

Closing a short perp on Zeta via limit order is a take-profit order that entails placing a buy-to-close limit order at a specified price or lower in order to offset — and thereby close — your short perp position.

Savvy traders will often enter a long or short position and then immediately place a buy (or sell)-to-close limit order at their desired profit-taking price.

This approach enables traders to realize positive PnL in the case of sudden and favorable price fluctuations.
{% endtab %}

{% tab title="Trigger Orders" %}
Trigger orders will execute when the trigger price is passed. We check the trigger price against both the mark price and midpoint price, executing the order if it has moved beyond either one. If the midpoint is further than 1.5% away from the mark price, it is not used for this check.

### Order Type

Trigger orders can either be **Market** or **Limit**. These function the same way as general market and limit orders.

* **Market** orders require the order to trade for its full size.
* **Limit** orders will remain as a resting order on the orderbook if they do not immediately trade.

### Take Profit

Lock in your profits! You can set a trigger price so that if the position you are holding is in profit and hits this price, some, or all, of your position will be closed. This allows you to take profit and lock in your gains.

### Stop Loss

Protect your capital! You can set a trigger price so that if the position you are holding is losing money and hits this price, some, or all, of your position will be closed. This allows you to cap your losses and protect capital (i.e. prevent liquidation!).

For more information on the underlying workings of trigger orders, see [Trigger orders](/zeta-protocol/exchange-architecture/trigger-orders)
{% endtab %}

{% tab title="Advanced Order Types " %}

#### Fill-or-Kill (FOK) Fill-or-Kill (FOK)&#x20;

Fill-or-Kill (FOK) orders must be filled in full at your limit price or better. If the order is not filled in full at your limit price or better, the order will be canceled. FOK orders prevent partial fills.

FOK orders are similar to All or None (AON) orders but include the added time component of an Imediate-or-Cancel (IOC) order. When placing a FOK order, you are saying, "fill the entirety of my order or cancel it."

Traders use FOK orders to achieve swift trade execution at desirable prices in their desired size.

FOK Order Example:

– LeGarrette places a FOK bid to long 1,000 SOL perps at a limit price of $20

– The orderbook shows 980 SOL perp offers on the books for $19.95

– Even though there's an offer in the orderbook for below LeGarrette's limit price — his order is canceled because it cannot be filled in full.

#### Immediate-or-Cancel (IOC)

IOC orders must be filled immediately at your limit price or better. Any portion of an IOC order that is not filled immediately will be canceled.&#x20;

IOC orders are not constrained by quantity — partial fills are allowed. IOC orders are useful to traders in need of prompt execution. The only two constraints for IOC limit orders are time and price.

When placing an IOC order, you are saying, "fill the maximum quantity of my order and cancel all unfilled orders after that time frame has elapsed."

Traders often place IOC orders when they are trading in size and want to avoid having their orders filled at multiple price levels. IOC orders can also shield traders from subprime fills in volatile or low-liquidity markets.

IOC Order Example:&#x20;

– Melvin places an IOC order to long 1,000 SOL perps at a limit price of $21

– The orderbook shows 690 SOL perp offers for $21 and 1500 offers for $21.50

– Melvin's order would be partially filled to the tune of 690 SOL perps at $21, and the remainder of his order (310 contracts) would be canceled.

#### Post-Only

Post-only orders enable market makers to be more surgical with their liquidity provision in order to save on trading fees.&#x20;

They augment limit orders by ensuring they are posted to the orderbook strictly as limit orders (i.e., they are not executed immediately).

If a standalone limit order is placed and price jumps to the trigger threshold, the limit order will convert to a market order, potentially resulting in a suboptimal full.&#x20;

Post-only limit orders remedy this by only permitting resting maker orders to hit the orderbook.

Post-only orders prevent limit orders from converting to market orders immediately upon hitting the orderbook.&#x20;

If any part of the order would be instantly filled, the entire order is rejected. Makers use post-only orders to prevent paying taker fees.

Post-Only Order Example:&#x20;

– Randy places a post-only limit order to long 1000 SOL perps at $20.50.&#x20;

– The best bid and ask in the orderbook are $19 and $20 respectively.&#x20;

– Randy's order would be rejected because it can't be displayed on the orderbook with a limit price.

#### Post-Only Slide&#x20;

Post-only slide orders are post-only orders with the additional stipulation that if the request would cross the orderbook, the order price will be adjusted to the best possible non-crossing price (i.e., one tick away from the best bid or ask price).

Post-Only Slide Example:

– Gabe places a post-only slide limit order to long 1000 SOL perps at $20.50.&#x20;

– The best bid and ask in the orderbook are $19 and $20 respectively.&#x20;

– Gabe's order would be accepted and displayed on the orderbook at $19.9999.

#### Time-in-Force (TIF)

TIF orders are orders that deactivate after a specified period of time, hence *time in force.* Once the specified period of time elapses, the order will no longer be active. TIF orders are only available via SDK.
{% endtab %}

{% tab title="Reduce Only" %}

#### Reduce Only

A reduce only order is an order that is only valid when you have a corresponding open position that is able to be reduced (larger than 0 size).\
\
By default, if you choose reduce only for a limit order, we are limiting advanced order types to only FoK or IOC (prioritising FoK).<br>
{% endtab %}
{% endtabs %}

## Ready to get started?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=order_types\&utm_term=cta)


# Margin Account Parameters

## Definitions

#### Account Equity&#x20;

This is the current value of your account, including the current market value of all open positions and your USDC equity.

$$
equity = balance+unrealizedPnL + unpaidFunding
$$

#### Buying Power

Your buying power is the amount of capital you are able to deploy after factoring in the leverage offering for the market you are trading.&#x20;

$$
buyingPower = freeCollateral \* \frac{markPrice}{initialMarginPerLot}
$$

#### Free Collateral

The amount of free collateral your account has that is not being used to collateralise other positions or open orders.

$$
freeCollateral = balance + unrealizedPnL + unpaidFunding - initialMargin
$$

#### Margin Usage

The percentage of equity you have used to collateralise positions.&#x20;

$$
marginUsage = \frac{maintenanceMargin}{equity}
$$

#### Current Account Leverage

The overall leverage ratio of your account. Your account leverage is equal to the value of all open positions divided by your account equity.&#x20;

$$
leverage = equity \* \sum{positions}
$$

### Ready to get started?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=margin_params\&utm_term=cta)


# Asset Parameters

Specifications for each trading pair.

## Market Details&#x20;

#### Mark Price

The fair value of the perpetual contract, which is taken to be the [oracle price](/zeta-protocol/exchange-architecture/oracles) of the underlying asset. For Pyth, this updates every Solana block (400ms).

#### Open Interest

[Open interest (OI)](https://open.substack.com/pub/zetamarkets/p/open-interest-oi?r=1k5frz\&utm_campaign=post\&utm_medium=web) refers to the total number of unsettled derivatives contracts in a given market.

I.e., the total number of derivatives contracts that have yet to be closed by an offsetting transaction or expiry-induced settlement.

#### 1h Funding

Funding rates mechanistically ensure the convergence of perp price on spot price.&#x20;

A positive funding rate means perp price is trading above spot price, in which case longs pay shorts.&#x20;

A negative funding rate means perp price is trading below spot price, in which case shorts pay longs.

#### Funding APR

Funding Annual Percentage Rate (APR) is the annual rate resulting from extrapolating the funding rate out to one year.&#x20;

## Risk Parameters&#x20;

#### Initial Margin

The minimum available balance required to open a position. Your initial margin requirement will be up to 10x less than the value of your trade, depending upon how much leverage you apply.&#x20;

#### Maintenance Margin

The minimum available balance you must maintain to avoid the risk of liquidation and ensure your position remains open.

#### Maximum Initial Leverage&#x20;

This is the maximum leverage at which you can establish a position in a given market.&#x20;

10x for SOL, BTC, ETH, ARB, APT

8x for BNB\
\
5x for TIA, JTO, PYTH

#### Maximum Maintenance Leverage

This is the maximum leverage you are afforded *after* establishing a position.&#x20;

SOL 33.33x\
BTC 33.33x\
ETH 33.33x\
APT 33.33x\
ARB 33.33x\
BNB 12x\
PYTH 10x\
TIA 10x \
JTO 10x

#### Liquidation Threshold

When your USDC equity dips below your margin maintenance level, your positions become subject to liquidations; your liquidation threshold is the price at which this process will be triggered.&#x20;

The liquidation price for all positions is visible in your trade modal after entry. To avoid the liquidation risk, you can top up your account with USDC when price encroaches on your liquidation threshold.&#x20;

The more account leverage you use, the more susceptible you are to liquidation.

#### Liquidation Buffer

The amount of capital protecting you from liquidation. When this hits 0, your account will be subject to liquidation. You can increase your liquidation buffer by topping up your account with USDC.

### Ready to get started?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=guide_asset\&utm_term=cta)


# Funding Rates

## What are Funding Rates?

Funding rates are a mechanism used in perpetual futures markets to help the price of the futures contract stay close to the underlying asset's spot price. Perpetual futures contracts, unlike traditional futures, do not have an expiration date, so these funding rates serve as a way to balance the market.

When the funding rate is positive, the perp trades at a higher price than its underlying asset. Conversely, a negative funding rate indicates the perp trading lower than its underlying asset.

Funding payments are determined by the funding rate. Longs pay shorts when the funding rate is positive, and shorts pay longs when the funding rate is negative. The result is a rubber-band effect that enforces a degree of parity between the price of a perp and spot price.

## How does Zeta calculate and pay out funding?

Check out the [Perpertual Funding System](/zeta-protocol/exchange-architecture/perpetual-funding-system) section of our docs for a more comprehensive explanation and examples.

### Ready to get started?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=guide_funding\&utm_term=cta)


# Trading Specifications

1 page with all the info you need to trade

***Disclaimer: Zeta Markets has ceased operating as of May 2025.***&#x20;

## Perpetual Futures

The following schema is used for Perps Contract specifications:

| Schema                                                          | Specification                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Contracts**                                                   | SOL/USD, BTC/USD, ETH/USD, APT/USD, ARB/USD, BNB/USD, PYTH/USD, TIA/USD, JTO/USD, BONK/USD, SEI/USD, JUP/USD, STRK/USD, WIF/USD, TNSR/USD, GMC/USD, POPCAT/USD, EIGEN/USD, DBR/USD, GOAT/USD, DRIFT/USD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <mark style="color:orange;">**Trading Fees (all pairs)**</mark> | <p><mark style="color:orange;"><strong>Taker Fees:</strong>  0.10%</mark></p><p><mark style="color:orange;"><strong>Maker fees:</strong> 0.02%</mark><br><mark style="color:orange;">See more in</mark> <a href="/pages/jeF4C1kNSPCnnhXvD97r"><mark style="color:orange;">Fee Tiers</mark></a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Maker Rebates**                                               | See [Maker Incentives Program](/rewards-programs/maker-rewards-program)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Leverage**                                                    | <p><strong>SOL / BTC / ETH: 2</strong>0x<br><strong>APT / ARB:</strong> 10x<br><strong>BNB</strong>: 8x<br><strong>PYTH / TIA / JTO / SEI / JUP / STRK / TNSR / GMC / POPCAT / EIGEN / DBR / GOAT / DRIFT:</strong> 5x<br><strong>BONK / WIF</strong>: 4x</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Initial Margin Requirements**                                 | <p><strong>SOL / BTC / ETH:</strong> 5% of oracle spot price</p><p><strong>APT / ARB :</strong> 10% of oracle spot price.<br><strong>BNB:</strong> 12.5% of oracle spot price.<br><strong>PYTH / TIA / JTO / SEI / JUP / STRK / TNSR / GMC / POPCAT / EIGEN / DBR / GOAT / DRIFT:</strong> 20% of oracle spot price.<br><strong>BONK / WIF</strong>: 25% of oracle spot price</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Maintenance Margin Requirements**                             | <p><strong>SOL / BTC / ETH / APT / ARB : 3</strong>% of oracle spot price.<br><strong>BNB:</strong> 8% of oracle spot price.<br><strong>PYTH / TIA / JTO / BONK / SEI / JUP / STRK / WIF / TNSR / GMC / POPCAT / EIGEN / DBR / GOAT / DRIFT:</strong> 10% of oracle spot price.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Minimum Lot Sizes**                                           | <p><strong>SOL</strong> 0.1 </p><p><strong>BTC</strong> 0.001 </p><p><strong>ETH</strong> 0.01 </p><p><strong>PYTH</strong> 1.0 </p><p><strong>ARB</strong> 1.0 </p><p><strong>TIA</strong> 0.1 </p><p><strong>BNB</strong> 0.01 </p><p><strong>APT</strong> 0.1<br><strong>JTO</strong> 0.1<br><strong>BONK</strong> 0.1<br><strong>SEI</strong> 1.0<br><strong>JUP</strong> 1.0<br><strong>STRK</strong> 1.0<br><strong>WIF</strong> 1.0<br><strong>TNSR</strong> 1.0<br><strong>GMC</strong> 0.1<br><strong>POPCAT</strong> 1<br><strong>EIGEN</strong> 0.1<br><strong>DBR</strong> 10.0<br><strong>GOAT</strong> 1.0<br><strong>DRIFT</strong> 1.0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Underlying Oracle Feed**                                      | Pyth: [SOL/USD](https://pyth.network/price-feeds/crypto-sol-usd?cluster=solana-mainnet-beta), [BTC/USD](https://pyth.network/price-feeds/crypto-btc-usd?cluster=solana-mainnet-beta), [ETH/USD](https://pyth.network/price-feeds/crypto-eth-usd?cluster=solana-mainnet-beta), [APT/USD](https://pyth.network/price-feeds/crypto-apt-usd?cluster=solana-mainnet-beta), [ARB/USD](https://pyth.network/price-feeds/crypto-arb-usd?cluster=solana-mainnet-beta), [BNB/USD](https://pyth.network/price-feeds/crypto-bnb-usd?cluster=solana-mainnet-beta), [PYTH/USD](https://pyth.network/price-feeds/crypto-pyth-usd?cluster=solana-mainnet-beta), [TIA/USD](https://pyth.network/price-feeds/crypto-tia-usd?cluster=solana-mainnet-beta), [JTO/USD](https://pyth.network/price-feeds/crypto-jitosol-usd), [BONK/USD](https://pyth.network/price-feeds/crypto-bonk-usd), [SEI/USD](https://pyth.network/price-feeds/crypto-sei-usd?cluster=solana-mainnet-beta), [JUP/USD](https://pyth.network/price-feeds/crypto-jup-usd?cluster=solana-mainnet-beta), [STRK/USD](https://pyth.network/price-feeds/crypto-strk-usd?cluster=solana-mainnet-beta), [WIF/USD](https://pyth.network/price-feeds/crypto-wif-usd?cluster=solana-mainnet-beta), [TNSR/USD](https://pyth.network/price-feeds/crypto-tnsr-usd), [GMC/USD](https://www.pyth.network/price-feeds/crypto-index-gmci30-usd), [POPCAT/USD](https://www.pyth.network/price-feeds/crypto-popcat-usd), [EIGEN/USD](https://www.pyth.network/price-feeds/crypto-eigen-usd), [DBR/USD](https://www.pyth.network/price-feeds/crypto-dbr-usd), [GOAT/USD](https://www.pyth.network/price-feeds/crypto-goat-usd?cluster=pythnet), [DRIFT/USD](https://www.pyth.network/price-feeds/crypto-drift-usd) |
| **Funding Rate Bounds**                                         | ±2% per day                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Multiplier**                                                  | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Multiplier Currency**                                         | Underlying (SOL, BTC, ETH, APT, ARB, ...)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Liquidation Rewards**                                         | <p>Percentage of maintenance margin at time of liquidation:</p><ul><li>30% to liquidator</li><li>35% to insurance fund</li><li>User keeps 35%</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

### Funding on Zeta

[Learn more](/zeta-protocol/exchange-architecture/perpetual-funding-system) about Perpetual Funding Rates.


# Fee Tiers

Zeta has implemented fee tiers, offering lower fees for high volume traders.

Based on their rolling 30-day volume, traders can now reduce Zeta's standard fee of 2 bps on maker trades and 10 bps on taker trades by up to 50%, as detailed in the following table.

In addition, traders are also eligible to fee tier qualification based on their gZEX holdings at the time of trade. Traders will be qualified based on either Volume or gZEX holdings, whichever gives them the higher fee tier. (e.g. holding 15,000 gZEX will qualify trader for fee tier 2 even if the trading volume is < $100,000)

*Note: gZEX staking fee tiers start from 10:00 UTC on 12 December 2024 (Trading Epoch 6)*

| Tier        | Volume (30d)   | gZEX Holding | Maker Fee | Taker Fee |
| ----------- | -------------- | ------------ | --------- | --------- |
| 0 (Default) | -              | -            | 2 bps     | 10bps     |
| 1           | ≥ $100,000     | ≥ 1,000      | 1.8 bps   | 9 bps     |
| 2           | ≥ $1,000,000   | ≥ 10,000     | 1.6 bps   | 8 bps     |
| 3           | ≥ $5,000,000   | ≥ 30,000     | 1.4 bps   | 7 bps     |
| 4           | ≥ $25,000,000  | ≥ 100,000    | 1.2 bps   | 6 bps     |
| VIP         | ≥ $100,000,000 | ≥ 500,000    | 1 bps     | 5 bps     |

Registered Market Makers have 0bps maker fee, as well as a 2bps rebate on all maker trades - find out more at [Maker Rewards Program](/rewards-programs/maker-rewards-program)


# Delisting Process

To enhance the trading experience and optimise for market activity, from Nov 2024 we will begin delisting markets that show consistently low trading volumes over a consecutive three-month period. This approach ensures that we maintain an engaging selection of tokens, reduce inactive listings, and allow market makers to concentrate their liquidity on the assets users actively trade. \
\
When a delisting occurs, any open perps positions in the asset will be force-settled at its mark price at the time of delisting, and user margin accounts will be updated accordingly. After this process is complete, no positions in the delisted asset will remain. \
\
We will notify users of any upcoming delistings one week in advance through UI notifications and announcements on our Telegram and Discord channels. We encourage users to close any positions in delisted assets and consider migrating the position to an alternative venue if they wish to maintain exposure to the delisted asset. <br>

| Asset    | Delisting Date         |
| -------- | ---------------------- |
| DYM-PERP | 20 November 2024 23:59 |
| BNB-PERP | 04 December 2024 23:59 |
| DBR-PERP | 19 December 2024 04:00 |


# Exchange Architecture

The innovative technical design choices that underpin Zeta

Historically in DeFi, exchanges have been limited by the underlying infrastructure. Blockchains have been too slow to facilitate the transaction volume required to create an experience similar to that of a centralized exchange.\
\
As a result, building orderbook style exchanges which both retail traders and professionals/institutions are familiar with has been next to impossible. This has resulted in DeFi trading experiences that diverge significantly from the centralized experience. Zeta changes this.

In order to build an experience that is inline with a centralized experience a key decision was picking a high performance blockchain. The Solana blockchain met our needs by providing:

* High Transactional Throughput: 50,000 per second.&#x20;
* Low Fees: Less than $0.1 in gas fees typically.&#x20;
* Fast Settlement Times: 400ms block times.

Solana does this all whilst maintaining necessary security and decentralization guarantees. As such we are able to build a decentralized exchange as performant as a centralized exchange.


# Margin Accounts

The margin account is the sole account that tracks all of a user's state across the exchange. There is one account, called a CrossMarginAccount, for all assets. That means you only have to deposit/withdraw once to have access to all markets.

This account stores all the necessary details for the user state bookkeeping including:

* Balance
* Open orders
* Positions
* Cost of trades
* Trading fees
* Funding payments

For a more detailed overview, have a look at the [SDK documentation](/build-with-zeta/sdks/typescript-sdk) which discusses the account structure in more depth.

A user margin account is atomically created on deposit of USDC to the platform. There is a one time cost of \~0.01 SOL, returned when an account is closed.


# Margin System

An overview of Zeta Protocol and the key components that will make derivatives trading on DeFi bulletproof. The following is a summary of how margin is calculated and treated by Zeta protocol.

### Margin System

A margin framework unlocks the world of under-collateralized trading - this is super desirable in the trading world as it allows for users to effectively apply leverage and use their capital in much more efficient way. \
\
In DeFi we have typically seen *over-collateralization*. This has emerged out of necessity; blockchains have typically been slow, often it takes minutes for a protocol to know the real state of the underlying asset price and take the actions required to keep the protocol safe and sufficiently collateralized. For an asset class as volatile as crypto, we know that these minutes can be precious. This has made it impossible to create an effective margin system. Until now.

### :gear: Zeta's Margining System:

Zeta solves these problems by leveraging Solana's 400ms block time. This allows us to update prices and monitor positions multiple times per second, enabling the implementation of a margining system which allows for an under-collateralized trading experience that rivals centralized exchanges.

The key elements that factor into our margin system are:

* [**Oracles**](/zeta-protocol/exchange-architecture/oracles)**:** High quality oracles with redundancy measures ensure that the platform has accurate pricing and downtime from network congestion is minimised.<br>
* [**Collateral Framework**](/zeta-protocol/exchange-architecture/margin-system/collateral-framework)**:** This is essential for managing the capital in the system. Under-collateralized trading is all about using capital efficiently. However, as always when trading more than you have there are more risks. The collateral framework is what ensures that this balance is maintained so that the exchange at large can continue functioning.<br>
* [**Liquidation Mechanism**](/zeta-protocol/exchange-architecture/margin-system/liquidations-and-insurance)**:** The last piece of the puzzle is a liquidation mechanism which is utilized to keep the platform from losing money. This 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.


# 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:

| Framework Element       | Specification                                                                                          |
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
| Account Balance (AB)    | <p>USDC deposited in account. </p><p>Changes on deposit, withdrawal, position close and settlement</p> |
| Unrealized PnL (UP)     | Profit and loss from existing open positions, including unpaid funding                                 |
| Initial Margin (IM)     | Margin level required to open new orders                                                               |
| Maintenance Margin (MM) | Margin level required to maintain positions before liquidation                                         |

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 - if this condition is violated users will (1) not be able to place an order, and (2) their existing open orders will be cancelled trustlessly. (3) Liquidators, when taking over a position must also pass this check:

$$
AB + UP - IM  +min(0, IPnL) > 0
$$

*where:*

* *AB = Account Balance*
* *UP = Unrealized PnL*
* *IM = Initial Margin x (Opening Orders + Positions)*
* *IPnL = instantaneous PnL from execution*

When a user places an order that closes an existing position the maintenance margin requirements (including open orders) are checked. This is done to ensure that the user has sufficient funds in their account to place an order and is not currently being liquidated.

$$
AB + UP - MM(O)  +min(0, IPnL) > 0
$$

*where:*

* *AB = Account Balance*
* *UP = Unrealized PnL*
* *MM (including open orders) = Maintenance Margin x (Opening Orders + Positions)*
* *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:

$$
AB + UP - MM > 0
$$

*where:*

* *AB = Account Balance*
* *UP = Unrealized PnL*
* *MM = Maintenance Margin x (Positions)*

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:

$$
AB + min(0, UPnL) - IM
$$

*where:*

* *UP = Unrealized PnL*
* *IM = Initial Margin x (Opening Orders + Positions)*

Orders that close a position are ***not*** charged margin.


# Liquidations & Insurance

An important component of a robust margining system is liquidation to ensure that one trader does not adversely impact other traders or the security of the platform.

#### Liquidation

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***:

$$
AB + UP - IM  +min(0, IPnL) > 0
$$

*where:*&#x20;

* *AB = Account Balance*
* *UP = Unrealised PnL*
* *IM = Initial Margin*
* *IPnL = instantaneous PnL from execution*

If a user fails the margin check, the liquidation process will begin:

* Step 1:&#x20;
  * 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 ***65% of the maintenance margin***, with 30% going to the liquidator and 35% going to the insurance fund.

Liquidation is a permissionless instruction, open to anyone. Check out our naive liquidator example [here ](https://github.com/zetamarkets/sdk/tree/main/examples/liquidator-example)that shows you how to check for positions at risk and liquidate their positions.&#x20;

**Note:** Liquidation is a risky endeavour and not guaranteed to be profitable.


# Insurance Fund

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

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:

$$
AB \* ((DP)/(DP+BA))
$$

*where:*

* *AB = Account Balance*
* *DP = Deposits To Platform*
* *BA = Bankruptcy Amount*


# Oracles

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 our on chain pricing is accurate and the Zeta platform security mechanisms can function as expected (margining system and liquidations).

Zeta uses two separate onchain oracles:

* [Pyth](https://pyth.network/) is the primary oracle. If a valid price exists that is sufficiently recent, we will use it without checking the secondary oracle.
* [Chainlink](https://chain.link/) is the secondary oracle, and it kicks in when the primary oracle's price is too stale. If we have a valid, recent price here then we use it.
* Additionally, if both oracles are stale, we check the average of the last prices from both, and use it if it's sufficiently recent and stable.


# Orderbook & Matching Engine

Zeta v2 utilises a fully on chain orderbook and matching engine with similar operations to the [Open Book](https://github.com/openbook-dex) DEX on Solana.

Depositing into Zeta for the first time requires the creation of a 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 of \~0.024 SOL).

**Orderbook constraints**

The 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 worst order (lowest bid or highest ask) placed on the orderbook will be booted off, and the corresponding order is cancelled for the user.


# Trigger orders

Not just TP/SL!

Zeta supports trigger orders which can be permissionlessly executed based on a set condition - either a price or a timestamp. You'll see these as "Take-profit/Stop-loss" on dex.zeta.markets, but you can make more complicated triggers yourself in the SDK too.

### The TriggerOrder account

When a trigger order is placed using the `place_trigger_order` instruction, a new `TriggerOrder` account is created. This account contains all necessary information about the order, and is deleted when the order is executed.&#x20;

<figure><img src="/files/CPDHx5kTSPdgxMTvYztf" alt=""><figcaption><p>The TriggerOrder account on chain</p></figcaption></figure>

The relevant `TriggerOrder` accounts for a given `CrossMarginAccount` can be found by checking the `trigger_order_bits` of the `CrossMarginAccount`. If a bit is 1, then the corresponding `TriggerOrder` account exists (see `utils.getTriggerOrder()` to see how the seeds work). One account can hold up to 128 triggers, as the bits value stored is a u128.

### What can you do with triggers?

Besides regular TP/SL, trigger orders allow you to set any price+direction or timestamp as the trigger. Just be careful with margining, as **margin requirements are not checked at the time you place a trigger, but only when it executes!** Think of it as simply placing an order in the future.

You can do anything that a regular PlaceOrder allows you to do, including different order types, reduceOnly and setting your own order price.

You can also edit trigger orders before they execute using the `edit_trigger_order` instruction.

### Executing a trigger

When either the price trigger or timestamp trigger is valid, a trigger order can be executed by calling the `execute_trigger_order` instruction. This is permissionless, so anyone can execute anyone's trigger orders! If the condition has not been met yet, a `TriggerOrderCannotBeExecuted` error will be returned.

As mentioned earlier, margin requirements are only checked when the trigger order executes. This is generally not an issue for the standard TP/SL offered on dex.zeta.markets as reduceOnly is set to true, but you might want to be careful if you're making your own triggers that increase your position.

TP/SL on dex.zeta.markets uses a FillOrKill order type for market, and Limit order type for limit, and sets order\_price to be 5% away from trigger\_price by default (you can edit this slippage in the Settings page). Therefore the slippage should be enough to cross the spread in volatile conditions.

### Trigger admin

There is extra control given to the `State.trigger_admin` account, which is set to our crank's wallet. This account has the power to delete active trigger orders, which it does in certain conditions:

* If a trigger order fails too many times (currently 300, which corresponds to approx 50 mins of failed execution)
* If a TP/SL trigger is left hanging after a user closes their position, to ensure frontend UX remains fluid.


# Trading Mechanism

Overview of the Zeta trading mechanism

Trading functions using an underlying central limit order book for each market / underlying asset.&#x20;

#### Placing Orders

On an insert order instruction, the public key for the underlying market for that particular product, as well as the price, size and side of the order must be passed in.

For more details about specific order types see [Order Types](/zeta-protocol/learn-how-to-trade-on-zeta/order-types).

**Tick sizes**

Orders can only be placed with a minimum tick size on insert. For orders which are below the minimum increment value, they will be rejected.

Minimum price fluctuation for all contracts - [see trading mechanism](/zeta-protocol/trading-specifications)

**Tick sizes**

Minimum trade lot size for all contracts - [see trading mechanism](/zeta-protocol/trading-specifications)


# Perpetual Funding System

Unlike dated futures, perps don’t have an expiry. In place of that, users are charged a funding rate based on their position and the orderbook on Zeta.

### How does Zeta calculate funding rates?

Over 24 hours, longs pay shorts based on the following formula:

$$
fundingRate = \frac{impactMidpoint}{oracle} - 1
$$

$$
payment = fundingRate \* oracle\*positionSize
$$

$$impactMidpoint$$ is the midpoint of the orderbook given $1000 worth of quotes on both the bid and ask side.

For example, let’s say you are long 100 lots of SOL-PERP and hold it for 24 hours. Over that time, the orderbook midpoint is $11.76 and the SOL oracle price is $12 (in reality these will fluctuate).

$$
fundingRate = \frac{11.76}{12} - 1 = -2%\ per\ day
$$

$$
payment = -2% \* 12 \* 100 = $24
$$

**A negative funding rate means that shorts pay longs.** Therefore your long position will be paid $24 per day as funding is negative.

### How is funding paid on Zeta?

Funding rates on Zeta are calculated on Zeta approximately every 10 seconds.

Rather than applying funding on a set timer, we apply it to your balance on any balance-sensitive operation (placeOrder, withdraw, liquidate, etc.), as well as every couple of minutes using our cranks.&#x20;

{% hint style="info" %}
At any point you can apply any unpaid funding to your account with our SDK's `utils.applyPerpFunding()` function.
{% endhint %}


# Mobile is LIVE !

Trade from anywhere, anytime with a mobile native trading experience

Zeta Markets now offers a mobile version for a convenient and powerful trading experience. Trade anytime and anywhere, with all essential features available right in your hand. Perfect for trading at home, the office, or at a cave rave, ensuring your trading never stops. Enjoy the full power of trading on the go with Zeta Markets mobile.

## **Mobile Native UX**

Our mobile web experience is designed to provide you with a full suite of trading features optimized for your device, ensuring efficient and effective trading without compromising on speed or functionality.

* **Trade Management:** Quickly start long or short positions, track your trades, view your overall position, and stay in control at all times.
* **Account Overview**: Stay on top of your trading game with a detailed account overview. Deposit and withdraw funds with just a few taps, and monitor key metrics to make informed decisions.

## Getting Started

Follow these simple steps:

1. **Open your crypto wallet app (Backpack, Phantom, Solflare, etc.)**
2. **Find the "Browse" or "Web" section in your wallet.**
3. **Type in this address**: [https://dex.zeta.markets](broken://spaces/Vk4go0WxIxUCk4gwcLFA)

![](/files/bWiksBZ27z00ymZYRtt9)

4. **Connect your wallet by following the prompts.**

![](/files/MvISrIejU7lmRJwLSiDX)

![](/files/sIvhgMMSSbpsSGNMA2aU)

5. **All set ✅ !**&#x20;

![](/files/tV7qQJYAnfGEisyBYQaF)

**Now you can trade your favorite cryptos with Zeta mobile on the go.**&#x20;

For any frequently asked questions about our mobile platform, please check out our [Broken mention](broken://pages/IItgqd3SsZsPXm60GdHD)or open a ticket on our Discord server.&#x20;

### **Happy Trading!** <br>


# Bridging Guide

How to bridge from (almost) any exchange or chain to Solana

Make sure you have a Solana Wallet! Check out our list of [compatible wallets here](https://app.gitbook.com/o/-M_F3TRxG_3x00hDzlKH/s/-M_F3hE1LuwHTNXyKNX3/~/diff/~/revisions/wwSTAqcbruy3CnBL0Mt4/bridging-to-solana/compatible-wallets)​. Once you have a Solana wallet, check out some of our guides to get started.

***Note that Zeta is USDC margin only so you will need your final asset to be USDC.***

You can source your USDC from any major exchange including:

* ​[OKX](/zeta-protocol/bridging-guide/from-exchanges)​
* ​[Kucoin](/zeta-protocol/bridging-guide/from-exchanges)​
* ​[Binance](/zeta-protocol/bridging-guide/from-exchanges)​
* ​[Coinbase](/zeta-protocol/bridging-guide/from-exchanges)​

Or from other chains where you hold USDC:​

* ​[Ethereum](/zeta-protocol/bridging-guide/from-other-chains)​
* ​[Polygon](/zeta-protocol/bridging-guide/from-other-chains)
* Using another exchange or chain? Most of the guides will work for **any** exchange / chain - if they don't or you are having trouble,[ join us on Discord](https://discord.gg/SacGBFKNzQ) and we'll help you get started.

#### Ready to get started? <a href="#ready-to-get-started" id="ready-to-get-started"></a>

​[Start trading now!](https://dex.zeta.markets/?utm_source=gitbook\&utm_campaign=bridging_guide\&utm_term=cta)​


# From Exchanges

<details>

<summary>Send SOL from Binance to Solana</summary>

[https://www.youtube.com/watch?v=0sF1dMKTRS](https://www.youtube.com/watch?v=0sF1dMKTRSM)

</details>

<details>

<summary>Send SOL from Kucoin to Solana</summary>

<https://www.youtube.com/watch?v=YmlVfcmNgV8>

</details>

<details>

<summary>Send SOL from OKX to Solana</summary>

<https://www.youtube.com/watch?v=9KClAu1FMkM>

</details>

<details>

<summary>Send SOL from Coinbase to Solana</summary>

</details>


# From Other Chains

<details>

<summary>Bridge from Ethereum to Solana</summary>

<https://www.youtube.com/watch?v=BaiBPEfjexA>

</details>

<details>

<summary>Bridge from Polygon to Solana</summary>

<https://www.youtube.com/watch?v=QioFAT8aZho>

</details>


# $ZEX

$ZEX is the token issued by [Zeta Foundation](https://zeta-foundation.gitbook.io/zeta-foundation) is used on the Zeta Markets protocol, driving protocol growth and participation. As of May 2025 ZEX and the Zeta Markets Protocol has been discontinued.<br>


# $ZEX Airdrop

### <mark style="background-color:yellow;">PLEASE NOTE: the Airdrop has already concluded.</mark>


# Principles

The principals behind the $ZEX airdrop

## Zeta's Airdrop Principles

The $ZEX airdrop is designed to reward **genuine users** of the protocol, with **additional incentives** for those who demonstrate a long-term commitment to the protocol.

Z-Score has been the foundation for measuring trading activity and allocating base incentives. \
\
Further adjustments such as OG and Season 1 Boosts, Min & Max Criteria & Platform activity have been implemented to reward authentic usage patterns and help ensure that sybils and professional farmers are not disproportionately rewarded.

### Airdrop Bonuses

Two additional mechanisms have been designed to reward users who are aligned with the Zeta Protocol for the long term:

#### The 7-Day Bonus

The[ 7-Day Bonus](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations#id-7-day-bonus) unlocks a portion of the user's allocation linearly over seven days, rewarding patience and long-term behaviour.&#x20;

#### The Staking Airdrop

The [Staking Airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop) is designed to reward $ZEX stakers for their commitment to protocol governance.

### Trading Rewards

The snapshot for the initial airdrop of $ZEX was taken on 7th June at 00:00 UTC.&#x20;

All Z-Score earned since then has contributed to the first epoch of [our Trading Rewards program](https://docs.zeta.markets/rewards-programs/trading-rewards-program), with 8M $ZEX in rewards up for grabs.

For full details, please see [Trading Rewards](https://docs.zeta.markets/rewards-programs/trading-rewards-program)<br>


# Allocations

A breakdown of how the $ZEX airdrop was allocated

* [OG Allocation](#og-allocation)
* [Season 1 Allocation](#season-1-allocation)
* [Season 2 Allocation](#season-2-allocation)
* [Community Airdrop](#community-allocation)
* [7-Day Bonus](#id-7-day-bonus)

### Airdrop Allocations

When [checking your airdrop eligibility](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/check-zex-allocation), all users will see their airdrop allocation divided into the following categories.

### OG Allocation

Rewards OGs/early supporters of Zeta who were using the protocol before the start of Season 1 of Z-Score. \
\
Allocations are based on the volume that the user traded on Zeta's Perps product in this period. Seeing as these are extremely early supporters of Zeta this volume was rewarded significantly more than volume in any other time period.

### Season 1 Allocation

The rewards allocated to a user for their trading activity over the course of Season 1 of Z-Score. There was a slight boost allocated to Season 1 traders&#x20;

### Season 2 Allocation

The rewards allocated to a user for their trading activity over the course of Season 2 of Z-Score.

### Community Allocation

This allocation was given to Zeta users who participated in the community competition that involved early / key supporters of Zeta. Please see [Community Competition](https://docs.zeta.markets/rewards-programs/trading-rewards-program/ended-trading-campaigns-and-boosts/season-2-finished/community-airdrop-finished) for details.\
\
User allocations were determined based on their trading contributions to their community during the competition. Minimum and maximum thresholds were also applied to the community airdrop to ensure all qualified traders received a meaningful distribution.

### 7-Day Bonus

This bonus is unlocked linearly over the week following TGE. It can be claimed at any time during this 7-day period for a discount but can only be claimed in full at the end of the 7 days. The maximum claimable value of the 7-Day Bonus is equal to the sum of all the other allocations.

<br>


# Guide to checking & claiming your $ZEX

### <mark style="background-color:yellow;">PLEASE NOTE: the Airdrop has already concluded.</mark>

* [Check Eligibility](#step-1-check-eligibility)
* [Choose your claim option](#step-2-choose-your-claim-option)
  * [Diamond Hand Claim](#option-1-diamond-hand-claim) - maximizes your bonuses!
  * [Immediate Claim](#option-2-immediate-claim)
* [Stake your $ZEX](#step-3-staking-airdrop)
* [Trading Rewards](#step-4-start-qualifying-for-genesis-epoch-rewards)

### Step 1: **Check Eligibility**

Firstly, you’ll need to check your eligibility for the airdrop.

* **Connect Your Wallet:** Head over to [token.zeta.markets](https://token.zeta.markets/) and connect your wallet (***please ensure you have the correct link***)
* **Check Eligibility:** Use our eligibility checker to see if you’re eligible for $ZEX

<figure><img src="/files/gfFk2Pf4ruzaOkEXo9m0" alt=""><figcaption><p>Connect your wallet and check your eligibility</p></figcaption></figure>

### Step 2: Choose Your Claim Option

<figure><img src="/files/CM22jHbmhYMje1WtyeLm" alt=""><figcaption><p>Choose to Diamond Hand or Imemediate Claim your $ZEX</p></figcaption></figure>

### Option 1: Diamond Hand Claim

This option provides the greatest overall rewards for long-term believers of Zeta Markets who want to dive right in to staking, and in future, governance.&#x20;

<figure><img src="/files/EyoCKPj4RjsZSBCMMFLV" alt=""><figcaption><p>Diamond Hand Claim - Step 1</p></figcaption></figure>

1. **Select Diamond Hand Claim:** On the claim page, click the Diamond Hand Claim
2. **Review Your Allocation:** Check out your full token allocation, including the 7-Day Bonus.
3. **Choose Your Staking Period:** Decide how long you want to stake your tokens – anywhere from 1 month to 4 years.

<figure><img src="/files/kBFGBjponfqZcL89fnbi" alt=""><figcaption><p>Diamond Hand Claim - Step 2</p></figcaption></figure>

4. **Confirm and Stake:**&#x20;

Once you're set, confirm your claim and stake your tokens in one go, this gets you:

* A seat at the governance table
* Eligibility for the [staking airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop).
* Boosted rewards from staking &  governance participation (coming soon)
* A higher average gZEX for the first epoch, boosting your [staking airdrop allocation](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop)

<figure><img src="/files/KylodjLhwKHjwMxBbq3n" alt=""><figcaption><p>You've got Diamond Hands!</p></figcaption></figure>

### Option 2: Immediate Claim

The immediate claim option provides the choice to users who would like to claim now, or before the full 7 days bonus vesting, without receiving maximum bonus rewards.

<figure><img src="/files/DA2A45b1yCk0ltWSvV5B" alt=""><figcaption><p>Immediate Claim - Step 1</p></figcaption></figure>

1. **Select Immediate Claim:** On the claim page, opt for Immediate Claim.
2. **Review Your Allocation:** You’ll see your Base Allocation and Community Airdrop amounts. If you’re within the 7-day post-TGE window, you’ll also see any unlocked portion of the 7-Day Bonus.
3. **Claim Your Tokens:** Grab the tokens that are available.
4. **Stake to get more $ZEX:** After claiming, you can choose to stake your tokens to qualify for the [staking airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop) and earn boosted incentives

### Step 3: Staking Airdrop

Staking your tokens within the Genesis Epoch makes you eligible for the [staking airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop), which allocates 2% of the token supply based on your average gZEX score over the epoch.

<figure><img src="/files/ZhJYGOMgg6nyFILsPruK" alt=""><figcaption><p>Staking your $ZEX</p></figcaption></figure>

**Tips to Maximize Your Staking Airdrop:**

* Stake early: the sooner you stake, the higher your average gZEX
* Stake more: the more tokens you stake, the better the rewards
* Stake longer: longer commitments mean a bigger boost to your gZEX

### **Step 4: Start qualifying for Trading Rewards**

Once you have decided on your options around claim and staking, you can start trading to earn ongoing epoch-based rewards. All trading volume after the snapshot qualifies for the Genesis Epoch Rewards (rewarded at the end of the Genesis Epoch, 28 days after TGE). \
\
We have also announced long term epoch-based rewards for our Ambassador and Creator Programs.


# Check Your $ZEX Allocation

All information related to checking your $ZEX allocation

### Checking Your $ZEX Allocation

1. Head to <https://token.zeta.markets/>
2. Connect your trading wallet
3. See your [allocation breakdown](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations)
4. To claim your allocation, please see [Claim Your $ZEX Allocation](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/claim-your-zex)

### Questions?

For all questions, please see the [detailed FAQ here](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/zex-faq)

### Guide

You can also check out our [checker & claiming guide here](/rewards-programs/usdzex/usdzex-airdrop/zex-guide)


# Claim Your $ZEX Allocation

All information related to claiming your $ZEX allocation

* [Claiming Your $ZEX Allocation](#claiming-your-usdzex-allocation)
* [Diamond Hand Claim](#diamond-hand-claim)
* [Immediate Claim & 7-Day Bonus](#immediate-claim-and-7-day-bonus)
* [Staking Airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop)

### Claiming Your $ZEX Allocation

1. Head to [https://token.zeta.markets/](https://token.zeta.markets) - please verify that you are at the correct link and beware of scammers!
2. Connect Your Trading Wallet
3. Choose [Immediate Claim](#immediate-claim-and-7-day-bonus) or [Diamond Hand Claim](#diamond-hand-claim) - see details below

[You can check out the various claim & staking guides here](/rewards-programs/usdzex/usdzex-airdrop/zex-guide)

### Diamond Hand Claim

The Diamond Hand Claim is designed for users who are long-term aligned with Zeta.&#x20;

By opting for a Diamond Hand Clai&#x6D;***, users can claim all of their allocation categories in full at TGE and stake them in one action***. Staking your airdrop from the outset offers several benefits:

* Qualification for the [Staking Airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop)
* Staking your airdrop earlier means your average gZEX over the first epoch will be higher, increasing your potential staking airdrop rewards.
* Immediate participation in governance and access to boosted incentives as soon as they are implemented.

### Immediate Claim & 7-Day Bonus

The Immediate Claim allows users to claim their airdrop at any time. Users can claim their allocations in full immediately from TGE, along with any portion of the [7-Day Bonus](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations#id-7-day-bonus) that has already unlocked.

As the [7-Day Bonus](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations#id-7-day-bonus) continues to unlock, a user opting for an Immediate Claim can claim a larger allocation until the maximum allocation is reached at the end of the 7-day period.

#### Example

User A is eligible for 1000 $ZEX from OG, Season 1, Season 2 and the Community Allocation and therefore a 7-Day Bonus of 1000 $ZEX.

#### Scenario 1 - Claim Immediately At TGE

* If User A claims immediately at TGE, they can claim 1000 $ZEX but can claim none of the 7-Day Bonus.
* Total claimable amount is 1000 $ZEX

#### Scenario 2 - Claim After 4 Days

* If User A waits for 4 days before claiming, they can claim all of their allocation of 1000 $ZEX & approximately 4/7 of the 7-Day Bonus, 571 $ZEX&#x20;
* Their total claimable amount is now 1571 $ZEX

#### Scenario 3 - Claim after 7 Days

* Since the 7-day period is complete, User A can claim the full 1000 $ZEX from their allocations and the full 1000 $ZEX from their 7-Day Bonus Allocation
* Their total claimable amount is now 2000 $ZEX

### Staking Airdrop

***For full details please see*** [***Staking Airdrop***](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop)

The staking airdrop (**2% of supply**) rewards token holders that indicate their commitment to Zeta’s long-term success and governance by staking their tokens within the first epoch after TGE, ending 25th July at 09:59 UTC.\
\
The staking airdrop will be allocated in proportion to a user’s average governance score, gZEX, over the epoch. The longer a user commits to staking their tokens and the more tokens they lock, the larger their gZEX will be.

#### Example

For example, if my average gZEX over the first epoch is 100 and the total average gZEX is 10,000, I would receive 1% of the [Staking Airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop).

#### Staking Airdrop Distribution

The staking airdrop will be distributed on 25th July, at the end of the Genesis Epoch. The Staking Airdrop will be distributed as gZEX staked for 90 days. Once a user begins vesting their gZEX, it will convert to liquid ZEX over 90 days.

#### Staking Airdrop Allocation

A user's average gZEX will be calculated by sampling gZEX randomly every hour over the course of the epoch. Based on a staker’s average gZEX over the epoch, they will receive a proportional share of the staking airdrop.

<br>


# Staking Airdrop

All information related to staking $ZEX

### <mark style="background-color:yellow;">PLEASE NOTE: the Staking Airdrop has already concluded.</mark>

### Staking $ZEX and the Staking Airdrop

The staking airdrop (**2% of supply**) rewards token holders that indicate their commitment to Zeta’s long-term success and governance by staking their tokens within the first epoch after TGE, ending 25th July at 09:59 UTC.

### Staking Airdrop

The staking airdrop will be allocated in proportion to a user’s average governance score, gZEX, over the epoch. The longer a user commits to staking their tokens and the more tokens they lock, the larger their gZEX will be. The staking airdrop will occur 28 days after TGE and will be in the form of ZEX staked as gZEX for 90 days.\
\
The airdrop is calculated according to a users average gZEX over the 28 day epoch. This will be sampled daily, if a user stakes later in the epoch they will register a gZEX of 0 for the earlier days during which they had no gZEX and as such will earn a lower share of the airdrop

You may refer to the calculation formula used below:

$$
score\_i=\dfrac{(\sum\_{h=0}^{28\times24}gZEX\_{h,i})}{28\times24}
$$

$$
stakedZEX\_i=20,000,000\times{\dfrac{score\_i}{\sum\_{i}^{n}scorei}}
$$

`Score_i` is used to calculate staker *i*’s share of the staking airdrop, `gZEX_h_i` refers to a snapshot of gZEX at each hour for staker *i,* and finally `stakedZEX` is the amount of stakedZEX allocated to staker *i.*<br>

*Note: Stakers require a minimum ZEX allocation of 0.001 ZEX to be eligible for the airdrop.*

### gZEX

gZEX is a governance score allocated to a user based on their staking activity. Principally the more tokens a user stakes and the longer a user stakes their tokens for the higher their governance score will be. It is calculated using the following formula:

$$usersgZEX = (tokensLocked)\*(daysRemaining/1460)^{1.5}$$

### Why Staking?

In the short term, staking helps establish our governance mechanisms and aligns key users with the protocol by rewarding their governance participation with boosted incentives. Governance will play an increasingly important role in Zeta’s roadmap as we [migrate to Zeta X](/zeta-x/zeta-x-litepaper) and transition to our own Layer2, which will introduce additional parameters requiring governance, such as transaction fees and validator rewards, in addition to existing elements such as market listings and incentive emissions.

<br>


# Airdrop FAQ

Frequently Asked Questions for the airdrop of $ZEX

### <mark style="background-color:yellow;">PLEASE NOTE: the Airdrop has already concluded.</mark>

* [General](#general-questions)
* [Diamond Hand Claim & 7-Day Bonus](#diamond-hand-claim-and-7-day-bonus)
* [Checker & Allocations](#checker-and-allocations)
* [Claiming $ZEX](#claiming-usdzex)
* [Airdrop Bonuses](#airdrop-bonuses)
* [The Genesis Epoch](#genesis-epoch)

### General Questions

<details>

<summary>Official Checker &#x26; Claim Link</summary>

The checker & claim page are both available at: <https://token.zeta.markets>

Claim only available 27th June at 10:00 UTC.

</details>

<details>

<summary>Contract Address For $ZEX</summary>

Contract Address: ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo\
\
Solscan: <https://solscan.io/token/ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo>

</details>

<details>

<summary>How many users were eligible for the airdrop?</summary>

Approximately 80k users qualified for the airdrop.

</details>

<details>

<summary>Initial supply of $ZEX</summary>

Expected to be \~15% of which 8% is airdrop and the rest Treasury for Incentives:\
\
\- Genesis epoch and subsequent epochs from [Trading Rewards Program](/rewards-programs/trading-rewards-program)\
\- [Ambassador Program](https://blog.zeta.markets/blog/ambassador-program-genesis-epoch)\
\- [Creator Program](https://blog.zeta.markets/blog/creators-grant-genesis-epoch)\
\- MMs & Exchanges

Note that all investors & team have a 1 year cliff and 3 year vesting too - [see Tokenomics from the Zeta Foundation here](https://zeta-foundation.gitbook.io/zeta-foundation)

</details>

<details>

<summary>Are there guides to help with checking &#x26; claiming $ZEX?</summary>

Yes! Please check out our [guide to checking & claiming your $ZEX here](/rewards-programs/usdzex/usdzex-airdrop/zex-guide)

</details>

<details>

<summary>How do i know if i am eligible for the airdrop?</summary>

You can determine if you are eligible for the airdrop by connecting your wallet address used for trading on Zeta with the eligibility checker at <https://token.zeta.markets>\
\
Step by step instructions for checking allocations will also be made clear on the app. &#x20;

</details>

<details>

<summary>When was the snapshot taken?</summary>

The snapshot was taken on 7th June at 00:00 UTC. \
\
All Z-Score acquired after the snapshot and before the eligibility checker, will contribute to your Z-Score and $ZEX reward allocation for the [Genesis Epoch of Trading Rewards](https://docs.zeta.markets/rewards-programs/trading-rewards-program).

</details>

<details>

<summary>How is the airdrop distributed, linear or tiered?</summary>

Please refer to the [Principles of the airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-principles) for detailed information around the airdrop distribution.

</details>

<details>

<summary>Is there a deadline by which users need to claim?</summary>

Users can claim their airdrop until Wednesday, September 25, 2024 at 09:45 UTC; any unclaimed tokens will be returned to the community via incentives & campaigns.

</details>

<details>

<summary>What happens to unclaimed tokens?</summary>

Any unclaimed tokens after the 90 day claim period ending Wednesday, September 25, 2024 at 09:45 UTC will be returned to the community via incentives & campaigns.

</details>

<details>

<summary>Where can I see team wallets for Treasury / other?</summary>

Available at TGE.

</details>

<details>

<summary>What happens to the Zeta Cards?</summary>

The Zeta Cards were minted to provide users utility via Z-Score boosts and fun during each specific season of Z-Score (Season 1, and Season 2). \
\
Now that Season 2 has ended, Zeta Cards no longer have any utility.\
\
Any unburned Z-Cards will serve as a memento of the Zeta Markets pre-TGE era but will no longer be usable on the platform.

</details>

<details>

<summary>What if I closed my Zeta account? </summary>

This won't impact your airdrop eligibility but there may be edge cases for specific campaigns - if an account was closed while a campaign was ongoing, you may be ineligible for that campaign.

</details>

<details>

<summary>Why was my wallet flagged as Sybil?</summary>

We worked with [Allium](https://allium.so), a top-tier blockchain data firm who previously worked with Jupiter & Jito, and identified users who created many accounts and or displayed suspicious activity patterns.\
\
We won’t be revealing exact methodology here but if you feel this was done incorrectly, please open a ticket on Discord.

</details>

<details>

<summary>What happens to any additional Z-score earned after the snapshot but before the eligibility checker was released?</summary>

All Z-Score that is acquired by a user after snapshot and before the eligibility checker, will contribute to the $ZEX reward allocation for the Genesis Epoch - [you can see your current Z-Score here!](https://dex.zeta.markets/z-score/)\
\
Please note that a new methodology is being used for Z-Score for Trading Rewards, so your Z-score will be calculated slightly differently to before.

For [full details see Trading Rewards](https://docs.zeta.markets/rewards-programs/trading-rewards-program)

</details>

### Diamond Hand Claim & 7-Day Bonus

<details>

<summary>What Are The Diamond Hand Claim &#x26; 7-Day Bonus?</summary>

**7-Day Bonus**\
\
This bonus is rewarded linearly over the week following TGE. It can be claimed at any time during this 7-day period. The maximum claimable value of the 7-Day Bonus is equal to the sum of all other allocations. \
\
**Diamond Hand Claim**\
\
By opting for a Diamond Hand Claim, users can claim [all allocations](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations) in full at TGE and then stake them in one action - this includes the [7-Day Bonus](#what-is-the-7-day-bonus)!

</details>

<details>

<summary>What is the Diamond Hand Claim?</summary>

By opting for a Diamond Hand Claim, users can claim all allocation categories in full at TGE and then stake them in one action - no need to wait for the 7-Day Bonus!

Staking your airdrop from the outset offers several benefits:

* Qualification for the [Staking Airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop)
* Staking your airdrop earlier means your average gZEX over the first epoch will be higher, increasing your staking airdrop allocation
* Immediate participation in governance and access to boosted incentives as soon as they are implemented

</details>

<details>

<summary>What is the 7-Day Bonus?</summary>

This bonus is rewarded linearly over the week following TGE. It can be claimed at any time during this 7-day period. The maximum claimable value of the 7-Day Bonus is equal to the sum of [all other allocations](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations).&#x20;

</details>

### Airdrop Bonuses

<details>

<summary>What Are The Diamond Hand Claim &#x26; 7-Day Bonus?</summary>

**Diamond Hand Claim**\
\
By opting for a Diamond Hand Claim, users can [claim all allocation categories](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations) in full at TGE and then stake them in one action - no need to wait for the 7-Day Bonus!\
\
**7-Day Bonus**\
\
This bonus is unlocked linearly over the week following TGE. It can be claimed at any time during this 7-day period. The maximum claimable value of the 7-Day Bonus is equal to the sum of [all other allocations](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations).

</details>

<details>

<summary>What is the Staking Airdrop?</summary>

The staking airdrop (2% of supply) rewards token holders that indicate their commitment to Zeta’s long-term success and governance by staking their tokens within the first epoch (28 days) after TGE.&#x20;

The staking airdrop will be allocated in proportion to a user’s average governance score, gZEX, over the epoch. The longer a user commits to staking their tokens and the more tokens they lock, the larger their gZEX will be.\
\
For full details please see [Staking $ZEX](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop)

</details>

### Checker & Allocations

<details>

<summary>Where can I check my allocation?</summary>

You can determine if you are eligible for the airdrop by connecting your wallet address used for trading on Zeta with the eligibility checker at <https://token.zeta.markets>\
\
Instructions will also appear on the app.

</details>

<details>

<summary>How do I know my current allocation?</summary>

A user can see their $ZEX allocation based on their Z-Score by connecting their wallet with the [Eligibility Checker](https://token.zeta.markets). The final $ZEX allocation is based on their Z-Score, with certain multipliers applied to users that started trading on Zeta earlier, as well as an activity multiplier, rewarding more regular users of the exchange.\
\
For full details please see the [Principals](/rewards-programs/usdzex/usdzex-airdrop/zex-principles) section.

</details>

<details>

<summary>Can I see a breakdown of my token allocation?</summary>

A user can see the breakdown of their token allocation by various components. For full details, please refer to [Allocations](/rewards-programs/usdzex/usdzex-airdrop/zex-allocations).&#x20;

</details>

<details>

<summary>What can I do if I think my allocation is wrong?</summary>

Please [open a ticket on Discord](https://discord.com/invite/SacGBFKNzQ) and follow the process outlined by the team.

</details>

<details>

<summary>What if I’m ineligible?</summary>

Don’t worry! For users who did not qualify for the $ZEX TGE Airdrop, there are still many rewards available in the future - [notably Trading Rewards](https://docs.zeta.markets/rewards-programs/trading-rewards-program) are live now with 6M $ZEX up for grabs.\
\
52.5% of token supply has been allocated to platform incentives and community treasury funding multi-year Creator and Ambassador Programs. \
\
We also have an active Referral Program that for Genesis Epoch will provide 15% in referred fees and 15% in referred Z-Score to you. This means that if you start trading on Zeta Markets now and participate in the Referral or one of the Grant Programs, you may be eligible for rewards as soon as the end of Genesis Epoch.

</details>

<details>

<summary>What if I buy $ZEX on the open market and stake it - am I eligible for the staking airdrop?</summary>

Yes! You can buy $ZEX and stake it just like any other holder of $ZEX.

</details>

### Claiming $ZEX

<details>

<summary>Where can I claim my $ZEX?</summary>

The checker & claim page are both available at: <https://token.zeta.markets>

</details>

<details>

<summary>When can I claim my $ZEX?</summary>

27th June, 2024 at 10:00 UTC at [token.zeta.markets](https://token.zeta.markets)

</details>

<details>

<summary>What are the options for claiming my $ZEX?</summary>

You can choose to do any of the following:

* [Diamond Hand Claim](#what-is-the-diamond-hand-claim)
* [Immediate Claim](#what-is-the-immediate-claim)

</details>

<details>

<summary>What is the Immediate Claim?</summary>

The Immediate Claim allows users to claim their airdrop at any time. Users can claim all their allocations in full immediately from TGE, along with any portion of the 7-Day Bonus that has already unlocked.

As the 7-Day Bonus continues to unlock, a user opting for an Immediate Claim can claim a larger allocation until the maximum allocation is reached at the end of the 7-day period.

Once a user has claimed their allocation, they may then stake their tokens.

</details>

<details>

<summary>Do I lose out on the staking airdrop if I don’t instant claim and wait for the 7d bonus?</summary>

The earlier & longer you stake for, as well as the more you stake, the better your staking airdrop will be. \
\
The best option to solve for this is to [Diamond Hand Claim](#what-is-the-diamond-hand-claim) where you can claim all allocations immediately and stake all in one go without needing to wait for the 7d bonus.

</details>

<details>

<summary>How do I maximize my staking bonus?</summary>

tl;dr stake early, stake more & stake for longer!

[The staking airdrop](/rewards-programs/usdzex/usdzex-airdrop/zex-guide/staking-airdrop) will be allocated in proportion to a user’s average governance score, gZEX, over the epoch. The earlier & longer a user commits to staking their tokens and the more tokens they lock, the larger their gZEX will be.

A user's average govZ will be calculated by sampling gZEX randomly every hour over the course of the epoch. Based on a staker’s average gZEX over the epoch, they will receive a proportional share of the staking airdrop.

For example, if my average gZEX over the first epoch is 100 and the total average gZEX is 10,000, I would receive 1% of the Staking Airdrop.

</details>

### Genesis Epoch

For full details, please refer to [Trading Rewards](https://docs.zeta.markets/rewards-programs/trading-rewards-program)

<details>

<summary>What is the Genesis epoch?</summary>

Zeta Markets will roll out trading rewards, grant programs and governance cycles, each lasting 28 days. The Genesis epoch is the first of these, and started once the airdrop snapshot was taken. \
\
It started at the snapshot on 7th June and will end 25th July at 09:59 UTC. \
\
At the end of the Genesis epoch, rewards from trading & any other programs will be rewarded - all from the UI.\
\
For full details see here: [Trading Rewards](https://docs.zeta.markets/rewards-programs/trading-rewards-program)

</details>

<details>

<summary>What are the dates of the Genesis Epoch?</summary>

The Genesis Epoch began on June 7th at 00:00 UTC and will end July 25th at 09:59 UTC.

</details>

<details>

<summary>What is the purpose of the Genesis epoch?</summary>

The Genesis epoch serves as the first of many cycles of growth for Zeta Markets with the goal of creating positive momentum towards the goal of building the best trading platform and onboarding traders all over the world onchain.

Zeta’s trading rewards program aims to incentivize trading on the protocol to stimulate platform growth. The rewards are distributed in the form of $ZEX. They are distributed to the traders based on their Z-Scores at the end of each epoch.

</details>

<details>

<summary>What rewards are available during the Genesis epoch?</summary>

1. Trading Rewards: This will be from trading as well as referral activity
2. Referral Rewards
3. Ambassador Grants
4. Creator Grants

For full details, please refer to [Trading Rewards](https://docs.zeta.markets/rewards-programs/trading-rewards-program)

</details>


# Staking

All information related to staking $ZEX

***Disclaimer: Zeta Markets has ceased operating as of May 2025.***&#x20;

## Staking

$ZEX’s staking framework establishes a foundation for governance through a vote-escrow model. Staking also rewards those users that are most committed to the protocol's governance and long-term growth through boosting mechanisms.

## Governance

Zeta's governance framework builds on the innovative vote-escrow model pioneered by Curve on Ethereum by introducing 2 new concepts. Firstly stakers are exponentially rewarded for the duration of their lock - therefore more heavily allocating power to those who are committed for longer. Secondly we introduce the ability for stakers to vest and unlock their tokens gradually - providing users more liquidity and limiting the supply shock on the ecosystem caused by mass unlocks.

To enable this, our tokenomics will feature 2 components:

* **$ZEX**: This is the governance token of Zeta. It is a transferable SPL token (Solana Program Library, i.e., Solana’s standard for fungible tokens), which is distributed to users via airdrops and incentives for using the protocol.
* **gZEX**: The governance score gained from staking $ZEX based on duration and amount of stake. This is a non-transferrable score across accounts. gZEX represents the long-term commitment of a user and, as such, provides proportional governance rights and boosted incentives.

## Calculating gZEX

Users will be able to stake $ZEX for a predefined period of time (up to 4 years) to receive gZEX. The amount of gZEX received for staking $ZEX will be determined by the amount of $ZEX token locked and the staking duration, according to the following formula:

$$
usergZEX = (tokensLocked)\*(daysRemaining/1460) ^ {1.5}
$$

<figure><img src="/files/8gDKIQ3ikjsOaYT12ySl" alt=""><figcaption><p>Exponential relationship between gZEX and time (epochs) locked</p></figcaption></figure>

## Managing Staked $ZEX

Staked $ZEX has two distinct states - **locked** and **vesting** - allowing users to manage their governance score (gZEX) and their benefits:

* **Locked state**: In this state, your gZEX and the associated governance benefits remain constant.
* **Vesting state**: Vesting unlocks staked $ZEX into liquid $ZEX over a linear unlock period. Your gZEX score also linearly decays.

***Example:** Let’s use Staking Account 1 (**SA1**) to explain these states. SA1 has staked 1000 $ZEX for 300 days to gain \~100 gZEX.*

## Locked State

Within the locked state, there are two main actions:

1. Increase your additional number of staked tokens and/or the staking duration into the same staking account. **This is only achievable in a locked state.**

***Example:** SA1 has staked 1000 $ZEX with a staking duration of 300 days. Say if they wish to stake an additional 100 $ZEX but with a staking duration of 320 days to SA1, the entire account will then have a staking duration of 320 days.* \
\
*This means the total $ZEX staked will now be 1100. Furthermore, their gZEX will also increase by \~20.*

**NOTE:** If you wish to stake more $ZEX for a shorter duration, this is achievable by creating a new staking account.

2. Vest (unlock) your tokens and convert it into $ZEX.&#x20;

***Example**: SA1 has a staking duration of 300 days. They decide to start vesting, and now SA1 is in the state of vesting, with a vesting duration of 300 days - equal to the staking duration in the locked state.*

## Vesting State

During the vesting state, your gZEX will decrease over the vesting period as it converts into $ZEX, which can be withdrawn to your wallet. In this state, your $ZEX is vested **proportionally** per day (which is 1 vest epoch), which can be **withdrawn to your wallet**.

***Example:** SA1 has staked 1000 $ZEX with vesting duration of 300 days. This means that SA1 will be able to withdraw 3.33 ZEX / Day over the next 300 days, as it unlocks on a daily basis.*

$$
AmountOfStakedZEX / Vesting Period = DailyAmountOfVestedZEX
$$

Your ZEX will be fully vested (unlocked) when the vesting duration reaches 0.

Clicking on the \<Lock> button will stop the vesting process, whereby the remainder of the vesting duration will be the new staking duration.

***Example:** SA1 has a staking duration of 300 days and after 30 days of vesting decides to re-lock their account. This means they are now locked with a staking duration of 270 days.*

## Boosting

Boosting represents another critical benefit of staking $ZEX. By holding gZEX traders will be able to access additional incentives, amplifying their rewards based on their total gZEX. The objective of boosting is to distribute greater incentives to traders who are also signalling long term commitment to the protocol and participating in governance via staking.

A user’s share of these additional incentives will be determined based on a user boost score, calculated as follows:

$$
userBoostScore = sqrt(score∗gZEX)
$$

Where `score` above refers to the users score in the incentive program at large - for example their Z-Score.

## Fee Tiers

From Epoch 6 stakers are also eligible to fee tier qualification based on their gZEX holdings at the time of trade. For more information on fee tiers for stakers check out [Fee Tiers](/zeta-protocol/trading-specifications/fee-tiers).


# Staking $ZEX: Step-by-Step Guide

{% embed url="<https://drive.google.com/file/d/11z_uN-8LT5noiYN8yB9gD6KuNcA1Uci3/view?usp=sharing>" %}


# Trading Rewards Program

Earn $ZEX by trading on Zeta

***Disclaimer: Zeta Markets has ceased operating as of May 2025 and the token has ceased emissions.***<br>

Zeta’s trading rewards program aims to incentivize trading on the protocol to stimulate platform growth. The rewards are distributed in the form of $ZEX token. They are distributed to the traders based on their total epoch Z-Scores at the end of each epoch.

### Z-Score

Z-Score is the scoring system used to determine trading rewards allocation on Zeta. Users can earn Z-Score by trading on Zeta. Z-Scores are updated in real-time as trades take place.

Starting from Trading Epoch 6, the Z-Score earned from a trade is calculated as follows:

<table><thead><tr><th width="333">Order Type</th><th>$ Volume</th><th>Z-Score</th></tr></thead><tbody><tr><td>Maker</td><td>5</td><td>1</td></tr><tr><td>Taker</td><td>1</td><td>1</td></tr></tbody></table>

*Note: Maker volume for Market Makers eligible for Maker Rewards Program will not be eligible for Z-Score*

### Epoch Schedules

Rewards are distributed to traders based on their total Z-Scores earned in epochs. Each epoch (except the Genesis Epoch) lasts 28 days. Epochs start at 10:00:00 UTC of the starting date, and ends at 09:59:59 UTC on the 28th day.

The $ZEX rewards pool for each epoch will be announced before the epoch begins.

| Epoch   | Starting Date     |
| ------- | ----------------- |
| Genesis | 07 June 2024      |
| 1       | 25 July 2024      |
| 2       | 22 August 2024    |
| 3       | 19 September 2024 |
| 4       | 17 October 2024   |
| 5       | 14 November 2024  |
| 6       | 12 December 2024  |
| 7       | 09 January 2025   |
| 8       | 06 February 2025  |
| 9       | 06 March 2025     |

### Reward Distribution Formula

In each epoch, traders’ rewards will be calculated as follows:

$$
r=R \times \dfrac{zscore}{\sum\_{n}zscore\_n}
$$

where `R` is the total rewards pool allocated for the epoch in $ZEX, and `r` refers to the rewards allocated to a specific trader.

Traders will not be able to see their rewards before an epoch concludes. As rewards are in the form of $ZEX tokens, traders will be able to claim them in full, once it is available for claiming.

Rewards are calculated once the epoch ends. After which, a small window of time (1-2 days) may be required to finalize the rewards, before it becomes available for claiming.


# Z-Score Active Boosts

While users can earn Z-Score, as described in the [previous page](/rewards-programs/trading-rewards-program), there are ways to boost the amount of Z-Score earned through various methods. These boosts and campaigns are designed to stimulate platform growth and reward active and loyal Zeta traders.

Boosts are multiplication factors used for traders to get more Z-Scores as trades take place on Zeta. This ensures that only users who contributes to the growth of the platform are eligible for rewards.

It is important to note that when there are multiple active boosts, they are additive and do not stack with each other.

You may find the live boosts and their descriptions in the following pages.


# Z-Loot

To make trading on Zeta both fun and rewarding, we introduce Z-Loot - a chance to multiply your Z-Score as you trade.

## How it works

Users have a chance to earn bonus Z-Score upon eligible trades. Eligible trades are defined as:

* **Taker** **trades** - achievable with both limit and market orders, which are applicable to all taker trades across the order form, TP/SL and closing orders.
* **Have a minimum of $100** in trade value.

The bonus reward is determined from a tiered system whereby **the lower the chance, the higher the bonus**. This is as follows:

* 1.25x Multiplier: 10% Chance
* 5x Multiplier: 1% Chance
* 100x: Multiplier: <0.01% Chance

This bonus multiplier is applied upon the order’s trade volume and **does not stack** with active boosts or other ongoing campaign boosts.

After the trade is deemed eligible and is “drawn” for a bonus, the bonus is applied to that winning trade retroactively.

## Example

For example, user A places a taker trade to buy 1 SOL, paying $1.50 net fees and they win a 5x multiplier Z-Loot. The net fees is $1.50 and win a 4x boost, so therefore the additional Z-Score earned is 6000 (1500\*4).

## FAQ

<details>

<summary><strong>When does the Z-Loot campaign run till?</strong></summary>

This will run till further notice.

</details>

<details>

<summary><strong>Does the multiplier increase my actual position size of the trade as well?</strong></summary>

No, the bonus also does not increase position size, but only for Z-Score earned.

</details>

<details>

<summary><strong>How do I know whether I won a Z-Loot on a trade?</strong></summary>

You are able to view this in your trade history where all trades that have won a Z-Loot will be tagged with a badge.&#x20;

Also, the total amount of bonus Z-Score earned from the Z-Loot campaign will update accordingly, which can be found on the campaign tracker on the Z-Score page.

</details>

<details>

<summary><strong>Is there a way to increase my chances of winning Z-Loot?</strong></summary>

Conceptually, the more often you trade, the higher chance you have of multiplying your Z-Score!

</details>

<details>

<summary>What happens to the Z-Loot earned post Snapshot?</summary>

All Z-Loot earned post snapshot will be credited to your Genesis Epoch Z-Score, based on the new Z-Score mechanism, with the same multiplier factor.

</details>


# Stakers' Boosted Trading Rewards

Earn more trading rewards by Staking on Zeta

In recognition of long term Zeta Trader's commitment to the platform by staking their ZEX. ZEX stakers are eligible for boosted trading rewards starting from **trading epoch 4 (17 Oct 2024).**

### How does it work

Similar to standard trading rewards, the stakers' boosted rewards will be compiled and distributed based on the same [Trading Rewards Program](/rewards-programs/trading-rewards-program#epoch-schedules).

Stakers will have to place trades within an epoch, to be eligible for the boosted rewards, after the epoch. Once an epoch ends, the rewards will be allocated and distributed based on the following formula

$$
r\_i = \dfrac{{\sqrt{\sum\_{h=0}^{672} gZEX\_{h,i} \times{ZScore\_{{i}}}}}}{{\sum\_{n}\sqrt{\sum\_{h=0}^{672} gZEX\_{h,n}\times{ZScore\_n}}}} \times totalEpochReward
$$

where:&#x20;

* $$i$$ refers to any individual staker
* $$r\_i$$ is the staker's trading reward for $$i$$
* *h* is the hour of the day
* *n* is the total number of stakers in the epoch
* $$gZEX$$ is the hourly snapshot of total gZEX credited to the user(s)
* $$ZScore$$ is the total amount of Z-Score earned by the user(s) within the epoch while staking, that is eligble for the Staker's Trading Rewards
* $$totalEpochReward$$ is the total amount of stakers' trading rewards given out during the epoch

In summary, a staker's reward allocation is proportionate to $$\sqrt{gZEX\_{hourlyAvg} \times ZScore}$$.

### Rewards Pool

The stakers' boosted trading rewards is distributed from a separate rewards pool, that is separated from the main trading's rewards pool. This is an exclusive pool of rewards, dedicated to ZEX stakers.


# $BERA Listing (Live)

From 07/02 13:00 UTC to 11/02 23:59 UTC, all trades in the $BERA market are subject to a 50% trading fee off.

<figure><img src="/files/d8aNi9Tily0Dk3ae8lfv" alt=""><figcaption></figcaption></figure>


# Ended Trading Campaigns and Boosts


# Jupiter x Zeta (Finished)

Ended 24/12/2023 - Z-Score distributed in January.

<figure><img src="/files/cc8TFgjZdacWoUs7pQKa" alt=""><figcaption><p>Zeta x Jupiter</p></figcaption></figure>

## Jupiter Start: Educate

We’re excited to be partnering with Jupiter on their Jupiter Start initiative and introducing their users to trading - with a grand total of 10M Z-Score to be distributed to the Jupiter community!\
\
Here is all the critical information you need to get started.\
\
Ready to start trading?\
\
[**Start Trading Now!**](https://dex.zeta.markets/trade/SOL-PERP?utm_source=docs\&utm_medium=jupiter-start)<br>

1. **What are the dates of the competition?**

The competition starts at 15:00 UTC on the 19/12/2023 and ends on 22/12/2023.

2. **Who is eligible to participate?**

All wallets that have traded on Jupiter before the start date of the competition are eligible to participate!

3. **What do I get for winning the competition?**

A total of 10 million Z-Score will be distributed to the top 500 traders on the Jupiter exclusive leaderboard, ranked by Z-Score - you can see the [leaderboard here](https://dex.zeta.markets/leaderboard)

4. **What is Z-Score?**

Z-Score is the first step towards the launch of the Zeta token. \
\
To learn more about Z-Score, see [here](https://docs.zeta.markets/z-score/introducing-z-score)

5. **How do I participate in the competition and earn Z-Score?**

Participants need to deposit USDC & trade on Zeta to earn Z-Score. To earn Z-Score, [see the mechanics here](https://docs.zeta.markets/z-score/z-score-season-1), the top 500 traders will be rewarded. Essentially:

* $1 in taker volume = 1 Z-Score
* Your $ PnL Rank

6. **How do I win?**

The leaderboard is ranked by Z-Score earned from trading activities; the higher your Z-Score, the higher your rank will be on the leaderboard!

7. **Will the Jupiter Leaderboard consider any bonuses or multipliers?**

Yes. All existing bonuses from campaigns or NFT burns will be included. Note that some of these bonuses are only applied retroactively.

8. **How will the 10M Z-Score be distributed to the top 500?**

The distribution will follow a specific curve/mechanism to reward higher-performing participants with more Z-Score:

* Tier 1 (Top 1-20%): 4,000,000 Z-Score
* Tier 2 (21-40%): 2,500,000 Z-Score
* Tier 3 (41-60%): 1,500,000 Z-Score
* Tier 4 (61-80%): 1,200,000 Z-Score
* Tier 5 (81-100%): 800,000 Z-Score


# Season 1 (Finished)


# Z-Score Season 1

Ended 31/12/2023.

## Trade size

For season 1, we're keeping things simple - the more volume you trade, the more your Z-Score goes up. Specifically, **every $1 in taker volume increases your Z-Score by 1.**

## Trade well

While you can absolutely build your Z-Score through volume alone - we feel that traders who crush their PnL should get a little something extra. The traders who sit at the top of the leaderboard based on $ PnL will receive a score multiplier on volume traded within the last 24 hrs. The higher your rank, the larger the multiplier.

Only those ranked within the top 100 on the $ PnL leaderboard are eligible for a score multiplier. The multiplier values range from 1.01 to 2.00, increasing by increments of 0.01 for each place that traders move up the leaderboard from 100th to 1st, as seen below.

| $ PnL Rank | Multiplier |
| ---------- | ---------- |
| 1          | 2.00       |
| 2          | 1.99       |
| 3          | 1.98       |
| ...        | ...        |
| 98         | 1.03       |
| 99         | 1.02       |
| 100        | 1.01       |

### Example

In the example below, there are two traders who have traded $15K and $25K, respectively, in the last 24 hrs. While Trader B traded almost double the volume of Trader A, Trader B is much further down the leaderboard based on their $ PnL.

Consequently, when taking score multipliers into account for $ PnL performance, Trader A actually has the *higher* incremental Z-Score for that day.

<table><thead><tr><th width="130">Trader</th><th width="105.33333333333331" align="center">24hr Vol</th><th width="141" align="center">Base Z-Score</th><th width="127" align="center">$ PnL Rank</th><th width="115" align="center">Multiplier</th><th>Adj. Z-Score</th></tr></thead><tbody><tr><td>Trader A</td><td align="center">$15,000</td><td align="center">15,000</td><td align="center">1</td><td align="center">2.00</td><td>30,000</td></tr><tr><td>Trader B</td><td align="center">$25,000</td><td align="center">25,000</td><td align="center">98</td><td align="center">1.03</td><td>25,750</td></tr></tbody></table>

## A note on wash trading

Don't try and game the system. If caught wash trading, your Z-Score will be set to 0.

### Bonus Weeks & Zeta Cards (Up to a 6x Boost!)

If you participate in a NFT partner week or a bonus week on a given asset, you can receive up to a 6x boost your Z-Score (including the PnL multiplier outlined above). \
\
Here is the breakdown of how bonuses are calculated:

#### (base\_z\_score \* base\_z\_multiplier \* (nft\_mutlipler)) + (base\_z\_score \* ad\_hoc\_multiplier)&#x20;

Where \
\
Base Z-Score = Your Z-Score exclusive of any multiplier\
Base Z Multiplier = Your PnL multiplier\
NFT Multiplier = [Activation of a Zeta Card NFT](#user-content-fn-1)[^1]\
Ad Hoc Multiplier = 2x Boost Weeks on a given asset OR for holding a particular NFT in your wallet ([see NFT partners!](/rewards-programs/trading-rewards-program/ended-trading-campaigns-and-boosts/season-1-finished/z-score-season-1/nft-community-partners))

### Ready to start earning Z-Score?

[Get started trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=zscore_s1\&utm_term=cta)

[^1]:


# NFT Community Partners

If you want to go fast go alone, if you want to go far go together

## TLDR

* Zeta is partnering with the Mad Lads, Tensorians, and Banx NFT collections for Season 1 of Z-Score.
* Holders from these NFT collections will receive special benefits during the season to boost their Z-Score earning power. These include Z-Pass cNFT airdrops and a designated "Community Week".
* Proxy NFTs will be sent to holders so that they can trade using hot wallets and be included in community week snapshots without having to move their grails from their Ledgers.
* At the end of the season, the collection whose traders earn the most Z-Score will be crowned Season 1 champs and split a prize pool of 1M Z-Score.

## Introduction

For Season 1 of Z-Score, we're got an absolutely stacked lineup of NFT communities who we are excited to be partnering with. \
\
These communities contain members who are known for their deep expertise in DeFi and NFTfi, as well as their skill in trading. Consequently, we believe these individuals are exactly who we need to kick-off Z-Score with a bang!\
\
Season 1 partners include [Tensorians](https://www.tensor.trade/trade/tensorians), [Banx](https://www.tensor.trade/trade/banx) (Delayed to Season 2), and [Mad Lads](https://www.tensor.trade/trade/madlads).

<figure><img src="/files/Qsah9ckrQRO2YnVKEGOi" alt=""><figcaption></figcaption></figure>

## Benefits

### 1️⃣ Z-Pass Airdrop

#### Current Tensorian, Banx, and Mad Lad Holders

All Tensorian, Banx, and Mad Lad NFT holders that are included in our snapshot will be airdropped Z-Pass cNFTs. Holders will receive a Z-Pass for every NFT they hold in a collection, up to a max of 4. Once these passes go live on Zeta, they can be used at any time during Season 1.\
\
Z-Passes can be burned to receive a 2x boost to your Z-Score for the proceeding 7 days. To learn more about how Z-Pass works and when it will be activated, [click here](/rewards-programs/trading-rewards-program/ended-trading-campaigns-and-boosts/season-1-finished/s1-zeta-cards).<br>

<figure><img src="/files/iry9bcLtbT8qtQAULLIK" alt=""><figcaption></figcaption></figure>

#### Mad Wars Veterans

As an extra benefit and show of our appreciation to the Lads who pushed boundaries with us, we will be airdropping 6 Z-Pass cNFTs to Mad Lad holders that traded during the Mad Wars - one for every week of the season. This ensures that these special traders stay loaded and boosted all season long!

### 2️⃣ Community Week

In addition to receiving Z-Pass cNFTs for boosting, each community will have its own "Community Week" where holders of that particular collection will receive a 2x boost on Z-Score generated during the week.

{% hint style="warning" %}
You do not need to be included in our snapshot for the Z-Pass cNFT airdrop to participate in the "Community Week" promotions.

All you need to do is make sure to hold one of these NFTs during their respective promoted weeks and you will be eligible for the Z-Score boost.
{% endhint %}

#### Season 1 Schedule

All weeks begin at 00:00 UTC and end at 23:59 UTC

| Community                                    | Start           | End             |
| -------------------------------------------- | --------------- | --------------- |
| Mad Lads                                     | 13 Nov 2023     | 17 Nov 2023     |
| Tensorians                                   | 27 Nov 2023     | 01 Dec 2023     |
| Banx (DELAYED) - will be a part of Season 2. | ~~11 Dec 2023~~ | ~~15 Dec 2023~~ |

#### Tracking

To ensure that traders are holding their NFT(s) all throughout the week, we'll be taking periodic snapshots. In order to qualify for the 2x boost, traders must be in 4 out of 5 holder snapshots.

{% hint style="warning" %}
To allow holders to leave their grails in cold storage, we will airdrop "proxy NFTs" to all holder wallets. If your NFT is in a cold wallet, transfer your proxy NFT to your hot, trading wallet, and this will ensure you are included in all snapshots.&#x20;
{% endhint %}

### 3️⃣ Intra-season Competition

Finally, tying the previous two benefits together, is our intra-season NFT community competition!\
\
We'll be tracking the performance of NFT holder wallets all season long. The community which racks up the most Z-Score by season's end will win a pool of **1M Z-Score**, split proportionally among traders from the winning collection! :trophy:


# S1 Zeta Cards

Send your Z-Score into overdrive

Introducing Zeta Cards, a tool for maximizing your Z-Score on Zeta.

Zeta Cards leverage compression on Solana to provide an innovative 'first in DeFi' incentive program that is **only possible on Solana**.

## Z-Pass: Purple

<figure><img src="/files/Xuc5GGhYATh24Pn5yMZ0" alt="" width="375"><figcaption><p>Z-Pass: Purple</p></figcaption></figure>

Z-Pass: Purple is designed to provide traders with a short term 2x boost to the Z-Score earned for trading on Zeta.

## **How to Activate Your Benefits**

1. **Burn the NFT**: To activate your 2x Z-Score boost, burn your Z-Pass: Purple NFT. This can be done using most popular wallets or directly from Zeta's trading interface.
2. **Trade**: During the next 7 days, all taker trades you execute will earn you double the Z-Score points.&#x20;

Once burned, the NFT will be destroyed and a 7-day timer will initiate immediately. Your benefits become active within the same hour you burn the NFT.&#x20;

Importantly, this benefit stacks well with any other boost you may be receiving (e.g. the boost for your position on the leaderboard).

{% hint style="info" %}
Don't bother burning multiple cards within a 7-day period. Benefits from cards do not stack with each other; a second burn simply resets the timer.
{% endhint %}

## Who received a Z-Pass: Purple Card?

There are :four: different ways to acquire a Z-Pass in Season 1 :point\_down:

### 1. Solana Breakpoint '23

The Zeta team will be on-site at the [Breakpoint](https://solana.com/breakpoint) conference in Amsterdam.&#x20;

If you missed us there, let us know in our [discord](https://discord.gg/ux8F2QyK6q).

### 2. Holding the NFT of a Season 1 Partner

In the first season of Z-Score, we're coming out hot, having partnered up with several of the most goated NFT communities in web3.

What do I need to do to claim my Z-Pass? Nothing. We've already airdropped cards to all [Mad Lad](https://www.tensor.trade/trade/madlads), [Tensorian](https://www.tensor.trade/trade/tensorians), or [Banx](https://www.tensor.trade/trade/banx) NFT holders.

Those who participated in the recent Mad Wars trading competition have also be rewarded with a sweetener.

### 3. Promotional Campaigns

We will periodically be giving out Z-Passes for users that engage with Zeta. Trade on Zeta to get  access to get direct access to the team on telegram.

If you're not already, be sure to follow and turn on notifications on X, you never know when the next drop might be :eyes:

### 4. Secondary Markets

Missed out on all of the opportunities above? No worries! Z-Passes are fully transferrable and can be acquired on secondary marketplaces like [Tensor](https://www.tensor.trade/trade/zetacards) and [Magic Eden](https://magiceden.io/marketplace/zetacards).

### Ready to burn?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=zeta_cards\&utm_term=cta)


# Season 2 (Finished)


# Z-Score Season 2

For Season 2, we're spicing things up.

#### How To Earn Z-Score In Season 2 <a href="#how-to-earn-z-score-in-season-2" id="how-to-earn-z-score-in-season-2"></a>

Just like in Season 1, the more volume you trade, the more your Z-Score goes up. However in Season 2 **both Maker & Taker volume** counts towards your Z-Score!

<table><thead><tr><th width="622">Order Type</th><th>$ Volume</th><th>Z-Score</th></tr></thead><tbody><tr><td>Maker</td><td>5</td><td>1</td></tr><tr><td>Taker</td><td>1</td><td>1</td></tr></tbody></table>

Note that for Maker Z-Score, any professional market makers on the platform are excluded.

#### New season, same PnL multiplier <a href="#new-season-same-pnl-multiplier" id="new-season-same-pnl-multiplier"></a>

Just like in Season 1, traders who sit at the top of the leaderboard based on $ PnL will receive a score multiplier on volume traded within the last 24 hrs. The higher your rank, the larger the multiplier.

Only those ranked within the top 100 on the $ PnL leaderboard are eligible for a score multiplier. The multiplier values range from 1.01 to 2.00, increasing by increments of 0.01 for each place that traders move up the leaderboard from 100th to 1st, as seen below.

| $ PnL Rank | Multiplier |
| ---------- | ---------- |
| 1          | 2.00       |
| 2          | 1.99       |
| 3          | 1.98       |
| ...        | ...        |
| 98         | 1.03       |
| 99         | 1.02       |
| 100        | 1.01       |

#### Example <a href="#example" id="example"></a>

In the example below, there are two traders who have traded $15K and $25K, respectively, in the last 24 hrs. While Trader B traded almost double the volume of Trader A, Trader B is much further down the leaderboard based on their $ PnL.

Consequently, when taking score multipliers into account for $ PnL performance, Trader A actually has the *higher* incremental Z-Score for that day.

| Trader   | 24hr Vol | Base Z-Score | $ PnL Rank | Multiplier | Adj. Z-Score |
| -------- | -------- | ------------ | ---------- | ---------- | ------------ |
| Trader A | $15,000  | 15,000       | 1          | 2.00       | 30,000       |
| Trader B | $25,000  | 25,000       | 98         | 1.03       | 25,750       |

### A note on wash trading <a href="#a-note-on-wash-trading" id="a-note-on-wash-trading"></a>

Don't try and game the system. If caught wash trading, your Z-Score will be set to 0.


# Bitcoin Halving (Finished)

From 17/04 15:00 UTC to 21/04 23:59 UTC, all trades for all assets are subject to a 4x boost.

Bonus will be applied retroactively post campaign.

<figure><img src="/files/AN8oaCOq9vvsLExEZUes" alt=""><figcaption></figcaption></figure>


# $WIF Listing (Finished)

From 01/05 12:00 UTC to 05/05 23:59 UTC, all trades in the $WIF market are subject to a 2x Z-Score boost.

Bonus will be applied retroactively post campaign.

<figure><img src="/files/V3UwGXA8kxt196B8zx5J" alt=""><figcaption></figcaption></figure>


# $RNDR Listing (Finished)

From 22/05 12:00 UTC to 26/05 23:59 UTC, all trades in the $RNDR market are subject to a 2x Z-Score boost.

Bonus will be applied retroactively post campaign.

<figure><img src="/files/GP8Yw7Raddggz5uLqJXJ" alt=""><figcaption></figcaption></figure>


# $TNSR Listing (Finished)

From 10/06 14:00 UTC to 15/06 23:59 UTC, all trades in the $TNSR market are subject to a 50% trading fee reduction.

<figure><img src="/files/Zc3mZ3MS3RVx3Wkoxh2x" alt=""><figcaption></figcaption></figure>


# Pyth Stakers (Finished)

Users who are actively [staking > 1000 Pyth](https://staking.pyth.network/) are subject to a 10% boost to their Z-Score across all trades.

Bonus is applied at a \~weekly cadence.

<figure><img src="/files/kJsDTLJkmhN2y1py60VG" alt=""><figcaption></figcaption></figure>


# Backpack Boost (Finished)

Users who are using [Backpack wallet](https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof) are subject to a 10% boost to their Z-Score across all trades.

Bonus is applied at a \~weekly cadence.

<figure><img src="/files/tOBo2WC6nbPUYDERnElV" alt=""><figcaption></figcaption></figure>


# AssetDash Elements (Finished)

[AssetDash Elements NFT holders](https://www.tensor.trade/trade/assetdash_elements) are subject to a 10% boost to their Z-Score across all trades.

Bonus is applied at a \~weekly cadence.

<figure><img src="/files/RjySjjvQ7zWwU4kpirK7" alt=""><figcaption></figcaption></figure>


# S2 Zeta Cards (Finished)

Z-Pass taken to the next level.

As pioneers in bringing DeFi and NFTS together, we've decided to step up our game and take Zeta Cards to another level in Season 2 of Z-Score.

This season, we'll be introducing the concept of rarity, where eligible users will have to (free) mint their Z-Pass to kick things off.

## Z-Pass Season 2 Collection

The Z-Pass Season 2 collection is a 10K collection comprised of 5 different Zeta Explorer types, each corresponding to a different rarity level and boost benefits when used on Zeta during Season 2 of Z-Score.&#x20;

<figure><img src="/files/dPQfJPbugECqtbA23BiB" alt=""><figcaption></figcaption></figure>

### Traits and Rarity

The core traits that impact Zeta boost benefits are the ***Z-Score multiplier*** and ***boost duration*** associated with a given Z-Pass. The longer the duration and the higher the multiplier, the rarer and more valuable a Z-Pass is.

#### Association between rarity, colors, and multipliers:

| Color  | Rarity Level  | Multiplier |
| ------ | ------------- | ---------- |
| Pink   | Common (C)    | 1.25x      |
| Blue   | Uncommon (U)  | 1.50x      |
| Bronze | Rare (R)      | 1.75x      |
| Silver | Legendary (L) | 2.00x      |
| Gold   | Mythic (M)    | 3.00x      |

#### Trait Distribution

|        | 1.25x (C) | 1.50x (U) | 1.75x (R) | 2.00x (L) | 3.00x (M) |
| ------ | --------- | --------- | --------- | --------- | --------- |
| 1 Day  | 29.90%    | 12.00%    | -         | -         | -         |
| 3 Days | 29.90%    | 12.00%    | 1.50%     | -         | -         |
| 5 Days | -         | 12.00%    | 1.50%     | 0.50%     | -         |
| 7 Days | -         | -         | -         | 0.50%     | 0.20%     |

## How to Get a Z-Pass for Season 2

### 1. Mint

On January 17th, Zeta will be launching the Z-Pass Season 2 collection from the [Tensor](https://www.tensor.trade/) launchpad :rocket:

#### Allowlists

The mint will be broken into three tiers:

* Tier 1
  * Users who burned a Z-Pass during Season 1
* Tier 2
  * Users who purchased and are still holding a Season 1 Z-Pass (and didn't burn a Z-Pass)
* Tier 3
  * Users who traded on Zeta during Season 1 (and didn't burn a Z-Pass)
  * Users who actively trade on dapps in the Solana ecosystem
  * Partner communities
    * Season 1 Reruns
      * Mad Lads
      * Tensorians
      * Banx
    * Season 2
      * $BONK Holders
      * SMB Gen 2 and Gen 3 Holders

Check which tier you fall into [here](https://create.tensor.trade/claim/zetacards_s2)!

#### Logistics

* Tier 1 Mint Window
  * Start: January 17, 3:00 pm UTC
  * End: January 17, 11:00 pm UTC
* Tier 2 Mint Window
  * Start: January 17, 11:00 pm UTC
  * End: January 18, 7:00 am UTC
* Tier 3 Mint Window
  * Start: January 18, 7:00 am UTC
  * End: January 18, 3:00 pm UTC

Each wallet will be able to mint one Z-Pass and minting will be done on a first come, first serve basis.

5K NFTs will be publicly minted on mint day, while the other 5K will be held back and used to provide additional rewards to, and promotions for, traders throughout Season 2.

### 2. Secondary Markets

Missed out on the mint? No worries! Z-Passes are fully transferrable and can be acquired on secondary marketplaces like Tensor.

## How to Activate your Benefits

1. **Burn the NFT**: To activate your Z-Score boost, burn your Z-Pass S2. This can be done using most popular wallets or directly from Zeta's trading interface.
2. **Trade**: During the days you are boosted (duration listed on the card), all trades you execute and Z-Score points you earn will be increased by the multiplier on your card

Once burned, the NFT will be destroyed and a timer will initiate immediately. Your benefits become active within the same hour you burn the NFT.&#x20;

Importantly, this benefit stacks well with any other boost you may be receiving (e.g. the boost for your position on the leaderboard).

### Ready to burn?

Burn will be activated on the UI shortly after the mint ends.\
\
Note that minting via Solflare may not work!

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=zeta_cards\&utm_term=cta)


# Community Airdrop (Finished)

Zeta Community Airdrop

*Note: $Z has been renamed to $ZEX*

The Zeta Community Airdrop is designed to reward members of our strategic partner communities who are also traders on Zeta with a bonus allocation to their airdrop.

Battle for $Z

<figure><img src="https://docs.zeta.markets/~gitbook/image?url=https%3A%2F%2F4096095864-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M_F3hE1LuwHTNXyKNX3%252Fuploads%252F317AAZKqddoBG0qExXhS%252FBlog_Community%2520airdrop.png%3Falt%3Dmedia%26token%3Df329d6cd-9048-4823-8b64-1876f7705694&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=1a9dab7d807cf5839986d1c812973f9ea060cc313ec9a9ca6f5d27331340f28c" alt=""><figcaption></figcaption></figure>

#### Key Links <a href="#key-links" id="key-links"></a>

* Enter the competition: [dex.zeta.markets/competition](https://dex.zeta.markets/competition)
* [How It Works](#how-it-works)
* [Community Allocations](#community-allocations)
* [Eligibility Criteria](#eligibility-criteria)
* [Bonus Allocation](#bonus-allocation)
* [FAQ](#faq)

#### How It Works <a href="#how-it-works" id="how-it-works"></a>

* Its a competition - join here > [dex.zeta.markets/competition](https://dex.zeta.markets/competition)
* The competition starts May 8th at 12:00 UTC and ends May 21st at 23:59 UTC.
* Every eligible community has been awarded a specific allocation of $Z, with a total of 1% up for grabs.
  * 0.8% has been divided amongst the communities (see [Community Allocations](#community-allocations) below for details)
  * 0.2% has been reserved as a bonus allocation to the top 3 communities. See [Bonus Allocation](#bonus-allocation) below for details.
* You must meet [certain eligibility criteria](#eligibility-criteria) to join a community.
* Community members can join one (***yes only one***) community of their choice and earn Z-Score. The more Z-Score earned, the higher the allocation.
* No Z-Score = No allocation - you have been warned!

#### Community Allocations <a href="#community-allocations" id="community-allocations"></a>

A total of 1% of $Z will be distributed to the following communities. 0.8% will be distributed directly to traders, proportional to their Z-Score. 0.2% is reserved for the top 3 communities - see [Bonus Allocation](#bonus-allocation) below.

Eligible Communities

<figure><img src="https://docs.zeta.markets/~gitbook/image?url=https%3A%2F%2F4096095864-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M_F3hE1LuwHTNXyKNX3%252Fuploads%252FekX2CMyfdLcJ66ceSCev%252F2%2520-%2520twitter%2520%281%29.png%3Falt%3Dmedia%26token%3Dffce142c-1018-48bb-88c9-b273c7e81407&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=da1da4591cd3bad464ccd7c9f169c1059f6af4ae2cd70792894ba8f8af4ae54c" alt=""><figcaption></figcaption></figure>

#### Eligibility Criteria <a href="#eligibility-criteria" id="eligibility-criteria"></a>

The following graphic describes the eligibility criteria. Additionally note that no Z-Score = no allocation. Eligibility will be checked at the end of the competition.

<figure><img src="https://docs.zeta.markets/~gitbook/image?url=https%3A%2F%2F4096095864-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M_F3hE1LuwHTNXyKNX3%252Fuploads%252FOqNXKgu5QQVW2EPqBr9O%252F2%2520-%2520twitter.png%3Falt%3Dmedia%26token%3D455553d0-5a8e-476a-9ef9-964a2263184e&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=f754952be19e3ec349dbac1fc51b7457261365adbfed3ac66b25a8bd2d1eebc9" alt=""><figcaption></figcaption></figure>

#### Bonus Allocation <a href="#bonus-allocation" id="bonus-allocation"></a>

The top 3 communities, ranked by total Z-Score earned, are eligible for a bonus allocation. The bonus allocation has been split as follows.

<figure><img src="https://docs.zeta.markets/~gitbook/image?url=https%3A%2F%2F4096095864-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M_F3hE1LuwHTNXyKNX3%252Fuploads%252Fq35lgXtdZ2ME7KOxayZQ%252FCOMMUNITYALLOC.png%3Falt%3Dmedia%26token%3D957b381e-6ee1-4ed0-b527-0d02858a9d7a&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=47c1c52d11669a2dac814a15757311f85c9f876574ac249afe5a24769818f25c" alt=""><figcaption></figcaption></figure>

The bonus allocation will be split amongst all participants of the winning communities based on their Z-Score.

<details>

<summary>Get Started!</summary>

Head to [dex.zeta.markets/competition](https://dex.zeta.markets/competition) to get started!

</details>

#### FAQ <a href="#faq" id="faq"></a>

<details>

<summary>What communities are eligible and what are the criteria for eligibility?</summary>

See [Community Allocations](#community-allocations) & [Eligibility Criteria](#eligibility-criteria)

</details>

<details>

<summary>Where can I see how much a community has been allocated?</summary>

See [Community Allocations](#community-allocations)

</details>

<details>

<summary>Can I join more than one community?</summary>

No. You can only sign up to one community per wallet. So if you have one wallet that is eligible for multiple communities, you must choose!

</details>

<details>

<summary>Is more Z-Score helpful?</summary>

Yes! More Z-Score means more $Z. The top 3 communities will also be receiving a bonus allocation of 0.2% - see [Bonus Allocation](#bonus-allocation)

</details>

<details>

<summary>What are the bonus allocations for the top 3 communities?</summary>

See [Bonus Allocation](#bonus-allocation) above

</details>

<details>

<summary>When does the competition end?</summary>

The competition starts May 8th at 12:00 UTC and ends on 21th May at 23:59 UTC.

</details>

<details>

<summary>What if I’m not eligible today but I fulfill criteria to become eligible during the competition?</summary>

The eligibility snapshot will be taken at the end of the competition.

</details>

<details>

<summary>Do I need to trade with the same wallet which grants me the eligibility?</summary>

Yes. If you really think this is impossible but want to participate, please [open a ticket on Discord](https://docs.zeta.markets/~/changes/R54eqdjuKLVOBkiYmsfG/zeta-protocol/official-links) and we'll see what we can do.

</details>

<details>

<summary>What if I’ve been trading on Zeta already - does my Z-Score count towards the competition?</summary>

No! But the Z-Score you earn during the competition will add to any Z-Score you’ve already accumulated during Seasons 1 and 2.

For the competition, all participants start at 0 Z-Score.

</details>

[<br>](https://docs.zeta.markets/~/changes/R54eqdjuKLVOBkiYmsfG/z-score/introducing-z-score)


# $POPCAT Listing (Finished)

From 09/09 12:00 UTC to 13/09 23:59 UTC, all trades in the $POPCAT market are subject to a 50% trading fee off


# Referral Z-Score Boost (Finished)

As part of the Referral Program, a referral user enjoys 10% boost to their z-score in the first 28 days of their trading. You may refer to the the [referrals page](/rewards-programs/referrals-program) for more details

### Bonus:

To celebrate $Z TGE, there is a bonus 5% Z-Score boost during the Genesis Epoch. This bonus will end 28 days after TGE. This boost applies to all referred users who were referred during or before the Genesis Epoch.&#x20;

If you are referred after the TGE, you will enjoy the 5% bonus until the end of the Genesis Epoch, and thereafter, you will continue to enjoy the 10% Z-Score reward for the remaining of the 28 days.


# $EIGEN Listing (Finished)

From 07/10 12:00 UTC to 11/10 23:59 UTC, all trades in the $EIGEN market are subject to a 50% trading fee off

<figure><img src="/files/Z3ta78QtrkIoFAhCLiu8" alt=""><figcaption></figcaption></figure>


# $DBR Listing (Finished)

From 23/10 12:00 UTC to 27/10 23:59 UTC, all trades in the $DRB (deBridge) market are subject to a 50% trading fee off.

<figure><img src="/files/SK78cusi0E38uLroKvaw" alt=""><figcaption></figcaption></figure>


# $GOAT Listing (Finished)

From 06/11 12:00 UTC to 10/11 23:59 UTC, all trades in the $GOAT market are subject to a 50% trading fee off.

<figure><img src="/files/Ko6afmcXUzxFupJlUq49" alt=""><figcaption></figcaption></figure>


# $DRIFT Listing (Live)

From 14/11 12:00 UTC to 18/11 23:59 UTC, all trades in the $DRIFT market are subject to a 50% trading fee off.

<figure><img src="/files/Q1qPNlfHViGXpJi2AMXQ" alt=""><figcaption></figcaption></figure>


# $PNUT Listing (Finished)

From 19/12 12:00 UTC to 23/12 23:59 UTC, all trades in the $PNUT market are subject to a 50% trading fee off.

<figure><img src="/files/lyKgUsYuicEtl57cv3DB" alt=""><figcaption></figcaption></figure>


# $PENGU Listing (Finished)

From 16/01 12:00 UTC to 20/01 23:59 UTC, all trades in the $PENGU market are subject to a 50% trading fee off.

<figure><img src="/files/Mj8Xmslq3FyV63h8cT71" alt=""><figcaption></figcaption></figure>


# $TRUMP Listing (Finished)

From 20/01 12:00 UTC to 26/01 23:59 UTC, all trades in the $PENGU market are subject to a 50% trading fee off.

<figure><img src="/files/r03iQOXHebjYNJKWS6mO" alt=""><figcaption></figcaption></figure>


# Final Epoch

The Zeta Markets protocol will cease operating. The final epoch of operation will last from 3rd April till the 1st of May.

**Timeline:**

* 9th April 04:00 UTC: All markets excluding SOL, BTC, ETH and JUP will be halted and user positions for the halted markets will be settled according to the oracle price.
* 17th April 04:00 UTC: SOL, BTC, ETH and JUP markets will move to reduce-only mode.
* 1st May 04:00 UTC: All remaining markets will be halted and user positions will be settled based on oracle price. From this point onwards trading on Zeta Markets will be disabled.

**Rewards:**

* Taker rewards for final epoch: 750K ZEX
* Staker Rewards: 250K ZEX

To learn more about what happens to ZEX and your staked tokens [read the Bullet FAQs](https://docs.bullet.xyz/faqs/frequently-asked-questions).<br>

**Settlements on 9th April 04:00 UTC**

| Asset    | Settlement Price (Pyth Oracle) |
| -------- | ------------------------------ |
| APT      | $4.309070                      |
| ARB      | $0.264018                      |
| BERA     | $3.300540                      |
| PYTH     | $0.113570                      |
| TIA      | $2.261780                      |
| JTO      | $1.552480                      |
| ONEMBONK | $9.410000                      |
| SEI      | $0.136942                      |
| STRK     | $0.117004                      |
| WIF      | $0.319336                      |
| TNSR     | $0.112501                      |
| POPCAT   | $0.125779                      |
| EIGEN    | $0.707968                      |
| GOAT     | $0.038326                      |
| DRIFT    | $0.425472                      |
| PNUT     | $0.121976                      |
| PENGU    | $0.003905                      |
| TRUMP    | $7.352900                      |

**Settlements on 1 May 04:00 UTC**

| Asset | Settlement Price (Pyth Oracle) |
| ----- | ------------------------------ |
| SOL   | $148.725                       |
| BTC   | $94790.55                      |
| ETH   | $1808.22                       |
| JUP   | $0.469091                      |


# Maker Rewards Program

Trading rewards given out to traders providing deep, tight and reliable liquidity.

***Disclaimer: Zeta Markets has ceased operating as of May 2025***

{% hint style="info" %}
**Quickstart**

:snake:[Python SDK](/build-with-zeta/sdks/python-sdk) , [Typescript SDK](/build-with-zeta/sdks/typescript-sdk)

:robot:[Example MM Code](https://zetamarkets-py.readthedocs.io/en/latest/examples/market_maker.html) *(simple quoting on Zeta using the Binance midpoint)*

:moneybag:[Trading Fees](/zeta-protocol/trading-specifications/fee-tiers) *(0bps base maker fee and -2bps maker rebate)*

:bar\_chart:[Rewards Program Dashboard](https://mm-dash.zeta.markets/) *(select epoch of interest and click "zoom to data")*
{% endhint %}

Zeta's maker rewards program aims to bring significantly improved liquidity to the platform and grow the number of algorithmic traders and market makers (MM) integrated into the platform. For their services, Zeta is giving out a significant 2.7% portion of its token as rewards over the coming year.

## Rewards

### Maker Liquidity Rewards

#### Rewards Schedule

Rewards will be distributed at the end of each epoch (28 days). For the liquidity bootstrapping phase in the first 3 months (epochs 1-3) rewards are boosted by 50% to 0.3% of network to incentivize early adopters.

| Epoch | Starting Date | Rewards    |
| ----- | ------------- | ---------- |
| 1     | 04/03/2024    | **0.3%\*** |
| 2     | 01/04/2024    | **0.3%\*** |
| 3     | 29/04/2024    | **0.3%\*** |
| 4     | 27/05/2024    | **0.2%\*** |
| 5     | 24/06/2024    | **0.2%\*** |
| 6     | 22/07/2024    | 0.2%       |
| 7     | 22/08/2024    | 0.2%       |
| 8     | 19/09/2024    | 0.2%       |
| 9     | 17/10/2024    | 0.2%       |
| 10    | 14/11/2024    | 0.2%       |
| 11    | 12/12/2024    | 0.2%       |
| 12    | 09/01/2025    | 0.2%       |
| 13    | 06/02/2025    | 0.15%      |
| 14    | 06/03/2025    | 0.15%      |
| 14+   | 03/04/2025    | TBD        |

*\*Rewards allocated in Epochs 1-4 will be distributed linearly starting 4 weeks after the TGE (for the purposes of the Maker Rewards Program TGE shall mean the date that Zeta tokens first become available for acquisition on a decentralized or centralized cryptocurrency exchange). Tokens earned during Epoch 1 will be made available for delivery one epoch after the TGE. Tokens earned in subsequent Epochs (Epoch 2-4) will be released on a rolling basis, 4 weeks apart from each other.*

#### Market Weightings (k)

Each market will have it’s own rewards pool that is weighted differently. The starting weights will look as follows. Subsequent weights will be decided by governance vote.

| Market        | k (% allocation of total rewards pool)            |
| ------------- | ------------------------------------------------- |
| SOL-PERP      | 25%                                               |
| BTC-PERP      | 10%                                               |
| ETH-PERP      | 10%                                               |
| Other markets | Evenly distributed across remaining markets (55%) |

### Maker Rebates

Participants in this program will be given a considerable 2bps rebate on all their maker trades. This is intentioned to allow market makers to quote tightly and maintain profitability whilst minimising the concern of being traded against at the top of the book.

The full breakdown of exchange fees can be found under [Fee Tiers](/zeta-protocol/trading-specifications/fee-tiers).

## Eligibility Requirements

Uptime and scoring will only be credited for liquidity that is within the maximum spread range, as well as greater than the minimum depth threshold.

### Maximum Spread per Market

No score will be generated for orders that are above a given market’s max spread. Here spread is calculated as the distance from an order to the midpoint of the orderbook i.e. $$spread=abs(price-midpoint)/midpoint$$.&#x20;

| Market        | Spread (from midpoint) | Equivalent Bid-Ask Spread |
| ------------- | ---------------------- | ------------------------- |
| SOL-PERP      | 30bps                  | 60bps                     |
| BTC-PERP      | 30bps                  | 60bps                     |
| ETH-PERP      | 30bps                  | 60bps                     |
| Other markets | 40bps                  | 80bps                     |

### Minimum Aggregate Depth per Market

The minimum depth of liquidity on both the bid and the ask. E.g. 10k on the bid and 5k on the ask for SOL will count as 5k liquidity, which is just within the minimum depth requirement.

The minimum order size is also set at $500 to protect against lots of small, spammy orders.

| Market        | Min Depth (Bid and Ask) | Min Order Size |
| ------------- | ----------------------- | -------------- |
| SOL-PERP      | $5000                   | $500           |
| BTC-PERP      | $5000                   | $500           |
| ETH-PERP      | $5000                   | $500           |
| Other markets | $1000                   | $500           |

### Minimum Uptime per Market

Market makers must meet a minimum uptime of 80% over the epoch to be eligible for rewards for that market.

### Minimum Volume Share per Market

Market makers must meet a minimum volume share of 1% of maker volume on that market to be eligible.

## Scoring Methodology

Rewards per market i are given as the share of Q-score across all MMs on the given market, multiplied by the [market weighting k](#market-weightings-k):

$$
R\_i=k\_i\frac{Q\_i}{\sum{Q\_i}{}}
$$

The Q-score is a wholistic measure of liquidity that incorporates cumulative uptime, depth/spread and volume over the epoch.

{% hint style="info" %}
Liquidity snapshots of the orderbook are taken on randomized minutely intervals i.e. 40320 samples per 28-day epoch.
{% endhint %}

$$
Q\_i = D\_i^{0.2} \* Uptime\_i^5\*MakerVolume\_i^{0.8}
$$

Here, the depth/spread term D is defined as the following ratio. In simple terms it incentivises depth linearly, and spread quadratically.

$$
D\_i = \sum\_{n=1}^{40320}D\_{min,n}
$$

$$
D\_{min}= \min\left(\frac{BidDepth\_1}{Spread\_1^2} + \frac{BidDepth\_2}{Spread\_2^2} ..., \frac{AskDepth\_1}{Spread\_1^2} + \frac{AskDepth\_2}{Spread\_2^2} ...\right)
$$

Uptime is then simply the proportion of samples in which the MM has non-zero liquidity within the required range:

$$
Uptime\_i = \frac{1}{40320}\sum\_{n=1}^{40320} Count(D\_{min,n} > 0)
$$

## Notice Regarding Access to the Zeta Protocol

By accessing or using the Zeta Interface and/or the Protocols, you acknowledge, understand, and agree to the following conditions:

1. You are not an Excluded Person, as defined in the [Terms and Conditions](https://docs.zeta.markets/legal/terms-and-conditions). This includes any individual or entity residing, located, incorporated, or having a registered office in the United States or any other Excluded Jurisdiction.
2. You do not and will not access or use the Zeta Interface and/or the Protocols from an Excluded Jurisdiction.
3. You do not and will not use a VPN or any other privacy or anonymization tools to circumvent, or attempt to circumvent, any restrictions applicable to the Zeta Interface and/or the Protocols.

If you do not agree to these terms, please do not use the Zeta Interface and/or the Protocols.

## Registration

If you're interested in participating in this program, we are whitelisting early partners before opening it up to a wider audience. Please register some brief details in the form below and we will reach out:

{% embed url="<https://t1yl57gu6df.typeform.com/to/qg9KYy78>" %}


# Referrals Program

Referral links are now LIVE on Zeta!

***Disclaimer: Zeta Markets has ceased operating as of May 2025***

Refer your friends to Zeta & get juicy rewards.&#x20;

## How It Works

In short, everybody wins. Whether you're an avid trader on Zeta, one of our [ambassadors](https://blog.zeta.markets/blog/introducing-the-z-fight-club) or [creators](https://blog.zeta.markets/blog/introducing-zeta-s-creators-grant), or someone who has just stepped into the Zeta ecosystem, this program offers something for each of you.

Staying true to our vibe, we've made it a breeze to use. Here's how it works.

**For Affiliates**

As an affiliate, for each new friend you introduce to trading on Zeta:

* **Earn 10% of their trading fees**:
  * This means you get a direct share of the fees generated from your friends’ trades permanently.

**For Referred Users**

* Get a **10% Z-Score boost for 28 days**.
  * This means you can claim 10% more rewards in your four weeks (28 days) of trading.

### How To Get Started

Ready to enjoy the boost?

* **Step 1:** to start referring your friends, head to [dex.zeta.markets](http://dex.zeta.markets), navigate to the **Rewards** section and generate your unique affiliate link.
* **Step 2:** share your unique link everywhere to onboard more users on Zeta and maximize your rewards!
* **Step 3**: head back to the Rewards section to claim your benefits.

#### FAQ

<details>

<summary>When does the Z-Score Boost get applied?</summary>

The boost should be applied \~hourly to your Z-Score if you've been referred!

</details>

<details>

<summary>How do I claim my rewards?</summary>

Only the rewards from the 10% of trading fees generated by your referrals need to be actively claimed. Once claimed, the rewards ($USDC) will be credited to your margin account. You can claim on the Rewards tab.

Your 10% Z-Score boost for referrals is applied automatically.

</details>

<details>

<summary>Is there a limit to how many users I can refer?</summary>

No - the more the better!

</details>

<details>

<summary>I was referred way before TGE, will I receive any rewards?</summary>

For referred users who joined before the TGE date, you will continue to enjoy the rewards. Your rewards will only end 28 days after TGE. You are also eligible for the Genesis [Epoch Bonus.](https://app.gitbook.com/o/-M_F3TRxG_3x00hDzlKH/s/-M_F3hE1LuwHTNXyKNX3/~/changes/964/rewards-programs/trading-rewards-program/z-score-active-boosts/referral-z-score-boost)

</details>


# Genesis Epoch Referral Boost (Finished)

As part of the celebration of kicking off the trading epochs, we are upsizing the referral Rewards!

Till the end of the Genesis Epoch, both affiliates and referrals get a 50% boost to their rewards:

**Affiliates** **will earn 15% of the referral traders' trading fees.**

**Referrals will earn 15% bonus Z-Score on their trades.**

This applies to all traders eligible for the referral rewards during the Genesis Epoch.


# Breakpoint Referral Boost

In celebration of Breakpoint 2024, we are upsizing the referral Rewards!

From 19 Sep to 16 Oct (Trading Epoch 3), affiliates get a 2X boost to their rewards:

**Affiliates** **will earn 20% of the referral traders' trading fees**&#x20;

This applies to all traders eligible for the referral rewards during Epoch 3.


# Content & Community Programs

***Disclaimer: Zeta Markets has ceased operating as of May 2025***<br>

Help grow Zeta community through content creation and community referral programs, and win rewards.


# Creators Program

### New Programming

ZM Creators! The Creators Grant program was rebuilt to Zeta Creators Program. We got a new name, MORE rewards, and new eligibility criteria.

Here’s an overview of changes to keep everyone in the loop:

|                                                 | Old Program                                                            | New Program                                                                                                                                                      |
| ----------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Program Name                                    | Creators Grant                                                         | Zeta Creators Program                                                                                                                                            |
| Creator Rewards                                 | $ZEX pool                                                              | <p>1️⃣ $ZEX pool<br><br>2️⃣ Multiplier on $ZEX rewards earned by trading on Zeta (for a 30-day period after each round)<br><br>3️⃣ Zeta Creator Discord role</p> |
| Referral Rewards                                | 20% cut from referral’s trading fees                                   | 20% cut from referral’s trading fe                                                                                                                               |
| Rewards Distribution                            | Ad-hoc                                                                 | 2 weeks after the last day of each program round                                                                                                                 |
| Creator Eligibility                             | Minimum 2,000-20,000 followers/subscribers/members on social platforms | Minimum 1,000 followers/subscribers/members on social platforms                                                                                                  |
| Minimum content pieces to earn creator rewards  | 5                                                                      | 5                                                                                                                                                                |
| Minimum content pieces to earn referral rewards | 0                                                                      | 0                                                                                                                                                                |
| Communication Channels                          | Telegram                                                               | Telegram, Discord                                                                                                                                                |

### November Round Mechanics

The November Round of the Zeta Creators Program starts on November 25, 2024. To help you content ideation, here are some exciting topics for November we recommend creators can build content around:

* Zeta X and testnet rollout
* $ZEX staking rewards
* Comparison with other DEXs

The $ZEX reward pool will get boosted **up to 100,000 $ZEX** based on the number of Zeta Creators Porgram participants and content submissions at the end of the November round. This means the more creators participate and publish content on Zeta, the higher the $ZEX reward pool goes until it hits the 100,000 $ZEX cap.

November Round will last until December 25, 2024. Submissions will be through a [**submission form**](https://forms.gle/S9eoBLXQrAwc8rHK9) and requires creators to provide links to the content they created and as well as other relevant information like Discord handle.

If you know a creator, refer them to join the program + reap the rewards. Creators you refer should add your Discord or Telegram handle in the submission form for identification purposes.

### How to become a Zeta Creator

1. Join the Zeta [Creators Program Telegram group](https://t.me/ZetaMarkets_Creators_Grant).
2. Join the [Zeta Discord server](https://discord.com/invite/Xn9HCJaDZd).
3. Create content.
4. [Fill and submit the Zeta Creators Program form](https://forms.gle/S9eoBLXQrAwc8rHK9) on or before December 25, 2024, 17:00 UTC.

### How to Generate a Referral Link

To benefit from creator boosted referral rewards you need to create your own unique referral link - this let's us know it was your content that referred a user to trade on Zeta. To generate your link follow these 3 simple steps:

1. &#x20;Head to [dex.zeta.markets](http://dex.zeta.markets/), navigate to the **Rewards** section then to **Affiliate Rewards** and click **"Let's Go"** to generate your unique Referral link.\
   *Tip: You can personalize your link to match your Discord, Twitter, or any other handle.*
2. Share your unique link everywhere to onboard more users on Zeta and maximize your rewards!
3. Head back to the **Rewards** section to claim your benefits.

For more information on the referrals program [visit our docs.](https://docs.zeta.markets/rewards-programs/referrals-program)

### Resources

* <https://docs.zeta.markets/zeta-x/zeta-x-litepaper>
* <https://blog.zeta.markets/blog/zeta-x-roadmap>
* <https://docs.zeta.markets/rewards-programs/usdzex/staking>
* <https://docs.zeta.markets/rewards-programs/trading-rewards-program>
* More resources available when you join the Zeta Discord Server

👉 Head to Zeta [Creators Program Telegram group](https://t.me/ZetaMarkets_Creators_Grant) now, start creating content, and earn rewards with Zeta today!


# Community Referral Program

Ready to Grow the Zeta Discord Community and Earn Rewards?\
Join the Zeta Community Referral Program, a monthly contest where your invites can earn you amazing rewards!&#x20;

### How It Works

1. **Get Your Unique Link**\
   Head to the ⁠**invite-links** channel in the [Zeta Discord](https://discord.gg/Xn9HCJaDZd), follow the simple instructions, and grab your personal invite link.
2. **Share with Friends**\
   Invite friends, connections, and fellow Web3 enthusiasts to join the Zeta Discord.
3. **Earn Rewards**\
   For your invites to count, new members must:\
   \- Stay active in the community for at least 7 days.\
   \- Reach a specific message count.
4. **Climb the Leaderboard**\
   Leaderboards reset every month, giving everyone a fresh shot at competing for rewards.

### What’s in It for You?

💰 **Top 10 Members**: Share the prize pool, with the **#1 spot** earning the largest rewards!\
🎁 **Ranks 11-20**: Enjoy a special reward designed to enhance your Zeta experience.

### Let’s Build Together

This isn’t just a contest; it’s a chance to build a vibrant, connected, and fun community. Together, we’ll focus on building relationships, sharing experiences, and diving deeper into the exciting world of Zeta.&#x20;

### Important Dates & Prizes

* **First Prize Pool**: November 23rd - November 30th
* **Full Program Launch**: Starting December 1st with a monthly prize pool

👉 Head to ⁠**invite-links** in the [Zeta Discord](https://discord.gg/Xn9HCJaDZd) now, start inviting friends, and make your mark on the Zeta community today!


# SDKs

***Disclaimer: Zeta Markets has ceased operating as of May 2025***\
\
Zeta has two available SDKs written in [Python ](/build-with-zeta/sdks/python-sdk)and [Typescript](/build-with-zeta/sdks/typescript-sdk).


# Python SDK

See full details at https\://zetamarkets-py.readthedocs.io/en/latest/reference/zetamarkets\_py.html

### Installation

To use Zeta, first install it using pip:

```
$ pip install zetamarkets_py
```

### Setting up a Solana wallet

Please follow the [Solana wallet creation docs](https://docs.solana.com/wallet-guide/file-system-wallet) to set up a wallet if you don’t already have one locally. By default the SDK will look for the wallet at *\~/.config/solana/id.json*

### Getting started

The easiest way to get started is to follow the [code examples](https://zetamarkets-py.readthedocs.io/en/latest/examples.html) in order. These walk you through the basics of placing orders, checking balances and streaming market data, all the way to building a simple trading bot.

### Links

* [Github](https://github.com/zetamarkets/zetamarkets-py)
* [Technical Docs](https://pypi.org/project/zetamarkets-py/)
* [PyPI Package](https://pypi.org/project/zetamarkets-py/)

### Ready to start trading?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=python_sdk\&utm_term=cta)


# Market Making Bot

Show quotes on both sides of the orderbook to profit from trading activity

### Overview

The Python SDK also provides a simple MM box example: <https://github.com/zetamarkets/zetamarkets-py/blob/master/examples/market\\_maker.py>

This bot provides liquidity to Zeta DEX by issuing bid and ask quotes for a given asset. It monitors mark prices from Binance, using them to inform where it should be quoting. The bot won't hedge its position elsewhere, but a good starting place is using [ccxt](https://github.com/ccxt/ccxt) to hedge on your second favourite exchange :blush:

If things are going well and you want to scale it up, reach out to us about our [Maker Rewards Program](/rewards-programs/maker-rewards-program)!

### Setup

* Install the Python SDK using the instructions in [Python SDK](/build-with-zeta/sdks/python-sdk) to run pip and set up a wallet.
* Run `python examples/market_maker.py`. Note that the following configuration options are available via extra command line arguments:
  * -n: Network, defaults to mainnet
  * -u: RPC url, defaults to solana's public RPC
  * -c, Commitment level, defaults to Confirmed
  * -a: Asset, defaults to SOL
  * -s: Lot size, defaults to 0.1
  * -e: Edge, defaults 20
  * -o: Offset, defaults to 0


# Typescript SDK

We've open sourced our SDK for Devnet and Mainnet. Our SDK is a typescript library that can be used to interact with our Zeta program smart contract.

This page will go over the basics - loading up everything, seeing exchange state, placing/cancelling orders as well as some advanced functionality such as callbacks and events. For extra information, check out:

* Additional examples on [Gitbook](/build-with-zeta/sdks/typescript-sdk/examples) or [Github](https://github.com/zetamarkets/sdk/tree/main/examples)
* The code on [Github](https://github.com/zetamarkets/sdk)
* Release information on [npmjs](https://www.npmjs.com/package/@zetamarkets/sdk)

### Install

```bash
npm install @zetamarkets/sdk
```

### Devnet variables

| Key          |                      Value                      |
| ------------ | :---------------------------------------------: |
| NETWORK\_URL |         <https://api.devnet.solana.com>         |
| PROGRAM\_ID  |   BG3oRikW8d16YjUEmX3ZxHm9SiJzrGtMhsSR8aCw1Cd7  |
| SERVER\_URL  | <https://dex-devnet-webserver-ecs.zeta.markets> |

### Mainnet variables

| Key          |                    Value                    |
| ------------ | :-----------------------------------------: |
| NETWORK\_URL |    <https://api.mainnet-beta.solana.com>    |
| PROGRAM\_ID  | ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD |

PROGRAM\_ID is subject to change based on redeployments.

Native numbers are represented with BN to the precision of 6 d.p as u64 integers in the smart contract code.

They will need to be divided by 10^6 to get the decimal value.

Use our helper functions in `src/utils.ts` to convert.

```ts
// Asset that we wish to trade on
let asset = constants.Asset.BTC;

// A variable of type BN (big number)
let balance: BN = client.account.balance;

// If you had deposited $10,000 USDC
balance.toNumber(); // == 10_000_000_000

// Convert decimal number to native fixed point.
utils.convertDecimalToNativeInteger(10_000); // == 10_000_000_000;

// Convert native integer to decimal.
utils.convertNativeIntegerToDecimal(balance.toNumber()); // == 10_000

// Convert native BN to decimal.
utils.convertNativeBNToDecimal(balance); // == 10_000
```

#### Setting up a wallet

Before we start writing any code, we need a fresh Solana wallet - skip this if you already have your own wallet.

```sh
# Generate new keypair at ./bot-key.json
solana-keygen new -o bot-key.json

# View new pubkey address
solana-keygen pubkey bot-key.json

# Put private key into .env file used by script
# (Make sure you are in the same directory as where you are running the script.)
echo private_key=`cat bot-key.json` >> .env
```

#### .env file

At this point there will be .env file with your freshly created private key. Open it up with your favourite text editor and add the following two lines:

```sh
network_url=https://api.devnet.solana.com
server_url=https://dex-devnet-webserver-ecs.zeta.markets
```

Note that the default Solana RPC will probably rate-limit you. Now's a good time to find a better one - for starters check out Runnode, Alchemy or RPCPool.

#### Basic setup boilerplate

Now that you're set up, we can start loading the Zeta exchange! Start with the following code, which will set up all necessary connections, airdrop you some SOL + USDC (devnet only) and load the exchange.

```ts
// Loads the local .env file into `process.env`.
require("dotenv").config();

import { Connection, Keypair } from "@solana/web3.js";
import {
  CrossClient,
  Exchange,
  Network,
  Wallet,
  utils,
  types,
  assets,
  Decimal,
  constants,
} from "@zetamarkets/sdk";
import fetch from "node-fetch";

const NETWORK_URL = process.env["network_url"]!;
const SERVER_URL = process.env["server_url"];

// Loads the private key in .env
const privateKey = Keypair.fromSecretKey(
  new Uint8Array(JSON.parse(Buffer.from(process.env.private_key).toString()))
);
const wallet = new Wallet(privateKey);

// Starts a solana web3 connection to an RPC endpoint
const connection = new Connection(networkUrl, utils.defaultCommitment());

// Airdrop some SOL to your wallet
await connection.requestAirdrop(wallet.publicKey, 100000000);

// USDC faucet - Mint $10,000 USDC (Note USDC is fake on devnet)
await fetch(`${SERVER_URL}/faucet/USDC`, {
  method: "post",
  body: JSON.stringify({
    key: wallet.publicKey.toString(),
    amount: 10_000,
  }),
  headers: { "Content-Type": "application/json" },
});

const loadExchangeConfig = types.defaultLoadExchangeConfig(
  Network.DEVNET,
  connection,
  utils.defaultCommitment(),
  0, // ThrottleMs - increase if you are running into rate limit issues on startup.
  true // LoadFromStore - whether you wish to load market addresses from the static storage (faster) or fetch everything from the chain (slower)
);

// Loads the SDK exchange singleton. This can take a few seconds...
await Exchange.load(
  loadExchangeConfig,
  undefined // Callback - See below for more details.
);
```

#### User margin accounts

A user's state is represented by a `CrossMarginAccount` in the Zeta program. This is one account for all assets.

It stores all the state related to a user's balance, open orders and positions.

Creation is baked into the `deposit` function if you don't have one already.

```ts
// Load the user SDK cross-margin client.
// Note that this client is active for the same assets you passed into Exchange.load() earlier
const client = await CrossClient.load(
  connection,
  wallet, // Use the loaded wallet.
  utils.defaultCommitment(),
  undefined // Callback - See below for more details.
);

// This will create a CrossMarginAccount on first deposit.
await client.deposit(utils.convertDecimalToNativeInteger(10_000));
```

Structure

```ts
// client.account

export interface CrossMarginAccount {
  authority: PublicKey; // Wallet publickey.
  delegatedPubkey: PublicKey; // A public key that can perform trading functions on your behalf, set with the editDelegatedPubkey instruction
  balance: anchor.BN; // Balance - doesn't take into account unrealized pnl.
  subaccountIndex: number; // Users can have multiple CrossMarginAccounts, separated by this index
  nonce: number; // Margin account PDA nonce.
  forceCancelFlag: boolean; // If you are underwater, liquidators can cancel your open orders in consecutive transactions
  accountType: any; // Specific flag for whitelisted market maker accounts
  openOrdersNonces: Array<number>; // Open orders account PDA nonce, per asset
  openOrdersNoncesPadding: Array<number>;
  rebalanceAmount: anchor.BN; // Any balance to be changed in the next market crank
  lastFundingDeltas: Array<AnchorDecimal>; // The last funding rate delta applied to this account, per asset
  lastFundingDeltasPadding: Array<AnchorDecimal>;
  productLedgers: Array<ProductLedger>; // Vector of your positions and open order state, per asset
  productLedgersPadding: Array<ProductLedger>;
  padding: Array<number>;
}
```

The details are abstracted away into `client.getOrders(asset)` and `client.getPositions(asset)` in the SDK.

#### Basic script setup to place a trade and view positions

For examples sake, we want to see the orderbook for SOL perps

```ts
const asset = constants.Asset.SOL;

// Orderbook updates automatically using websockets
console.log(Exchange.getOrderbook(asset));

// You can also forcefully poll the orderbook account for an update, although websockets should be sufficient
Exchange.getPerpMarket(asset).forceFetchOrderbook();
```

<pre class="language-ts"><code class="lang-ts"><strong>`{
</strong>  bids: [
    { price: 17.71, size: 23 },
    { price: 16.58, size: 309 },
    { price: 15.71, size: 251 },
    { price: 15.52, size: 8 }
  ],
  asks: [ { price: 19.53, size: 23 } ]
}`
</code></pre>

#### Placing an order.

Placing an order on a new market will create an `OpenOrders` account. This is handled by the SDK.

* The minimum price is $0.0001.
* The minimum trade tick size is 0.001.

```ts
// We need to convert price to the native spl token amount (6.dp)
// utils.convertDecimalToNativeInteger(18) == (18*10^6)
const orderPrice = utils.convertDecimalToNativeInteger(18);

// We need to convert to our native option lot size.
// utils.convertDecimalToNativeLotSize(1) == (1*10^3)
const orderLots = utils.convertDecimalToNativeLotSize(1);

// Underlying asset that we are trading on, eg SOL or BTC
const asset = constants.Asset.SOL;

// Place a bid order.
await client.placeOrder(asset, orderPrice, orderLots, types.Side.BID);
```

#### See client order.

Now that our order is placed we should see it on the orderbook. Either check in the SDK or navigate to <https://devnet.zeta.markets/> to see it visually.

```ts
await client.updateState();
console.log(client.getOrders(asset));

// `client.getOrders` is a list of orders in market index order.
`
[
  {
    marketIndex: 137,
    market: PublicKey {
      _bn: <BN: 94cce37bd47128c757766685f012cac541a534ba9ed59e6bf05cd004eae1ae5>
    },    // This is the market address represented as a PublicKey
    price: 18,
    size: 1,
    side: 0, // 0 for bids, 1 for asks
    orderId: <BN: 7a1200fffffffffffdfdc2>, // This is used to cancel.
    owner: PublicKey {
      _bn: <BN: 153d79e2816b07fb2388abb9bd6feb64a481f422c5ff390ad8346eb70f09111d>
    }
  }
]
`

// See our new order on the orderbook.
console.log(Exchange.getOrderbook(asset));
`
{
  bids: [
    { price: 18, size: 1 }, // This is our order
    { price: 17.99, size: 23 },
    { price: 16.58, size: 309 },
    { price: 15.71, size: 251 },
    { price: 15.52, size: 8 }
  ],
  asks: [ { price: 19.53, size: 23 } ]
}
`
```

#### Place bid order in cross to get a position

Let's trade! Instead of just placing a resting order, send a bid order with a higher price to cross the orderbook and execute a trade.

```ts
// Place an order in cross with offers to get a position.
await client.placeOrder(
  asset,
  utils.convertDecimalToNativeInteger(10),
  orderLots,
  types.Side.BID
);

// View our position
await client.updateState();
console.log(client.getPositions(asset));

// `client.getPositions` is a list of crossMarginAccount positions
`
[
  {
    marketIndex: 137,
    market: PublicKey {
      _bn: <BN: 94cce37bd47128c757766685f012cac541a534ba9ed59e6bf05cd004eae1ae5>
    },
    position: 1,
    costOfTrades: 19.53 // 6 d.p, so $19.53
  }
]
`
```

We have a position of 1, with cost of trades 9530000 / 10^6 = $19.53.

#### Cancel order.

```ts
// We only have one order at the moment.
let order = client.getOrders(asset)[0];
await client.cancelOrder(asset, order.orderId, order.side);
```

#### Cancel all orders.

```ts
// Optionally can pass in the asset here but we'll choose not to
await client.cancelAllOrders();
```

See `src/cross-client.ts` for full functionality.

#### Check market mark price

This is the price that we receive from on-chain Oracles.

```ts
console.log(Exchange.getMarkPrice(asset));
`8.202024`;
```

#### Calculate user margin account state

At any point you can view your account state without having to dig through the account definitions yourself, using the `riskCalculator`.

```ts
let marginAccountState = Exchange.riskCalculator.getCrossMarginAccountState(
  client.account
);
console.log(marginAccountState);

// These values have all been normalized (converted from 6 dp fixed point integer to decimal)
`
{
  balance: 10000,                            // Deposited $10,000
  initialMargin: 8.202024,                   // Initial margin, from the 1 open order
  initialMarginSkipConcession: 8.202024,     // Initial margin, from the 1 open order (if skipping concession)          
  maintenanceMargin: 8.202024,               // Maintenance margin, from the 1 position
  unrealizedPnl: -1.3279759999999996,        // Unrealized pnl, marked to mark price
  unpaidFunding: 0.013,                      // Funding payments that haven't been applied to the balance yet
  availableBalanceInitial: 9990.483,         // Equity available for trading
  availableBalanceMaintenance: 9990.483,
  availableBalanceWithdrawable: 9990.483
}
`
```

#### Priority Fees

Additional priority fees can be set to maximise your transaction's chance of success. The units are microlamports per Compute Unit.

```ts
// Exchange.load() needs to be called first

// update priority fee amount
fee = 500;
Exchange.updatePriorityFee(fee);

// turn off priority fees
Exchange.updatePriorityFee(0);

// turn on automatic priority fee polling
// this uses the getRecentPrioritizationFees RPC method
Exchange.toggleAutoPriorityFee();
```

#### Versioned Transactions

Can't fit all the instructions you want into a single transaction? Try using Address Lookup Tables (ALTs)! By setting `lutAccs = utils.getZetaLutArr()` when calling `utils.processTransaction`, you'll utilise features from Solana's Versioned Transactions to drastically minimise the accounts you pass in, increasing how many instructions you can sandwich together.

A full Versioned Transactions example is available in the examples subpage.

### Zeta market data

Zeta market data is available through `Exchange.getZetaGroupMarkets(asset)`, which simplifies the data in `Exchange.getZetaGroup(asset)` to be more easily understood.

Markets are indexed, and due to a legacy with options+futures, perps are index 137.

```ts
// Whole zeta group markets object
let zetaGroupMarkets = Exchange.getZetaGroupMarkets(asset);

// Grab the perp market for the asset we care about
let market = Exchange.getPerpMarket(asset);

// Ensure you have polled to see latest state.
let orderbook = market.orderbook;
```

See `src/markets.ts` to see full functionality.

### Viewing perp funding information

Perp markets have a unique mechanic - funding rates ([Gitbook](https://docs.zeta.markets/zeta-protocol/zeta-infrastructure/perpetual-funding-system)). These values are stored in the Pricing account.

```ts
// Get the whole pricing account
// This stores all perp info for all assets
let pricing = Exchange.pricing;

// Funding rate (per day) is stored as decimal without multipliers
// ie if funding is 5% daily, pricing stores 0.05
let fundingRate = Decimal.fromAnchorDecimal(
  pricing.latestFundingRates[assets.assetToIndex(asset)]
).toNumber();

// 'Impact' midpoint used to calculate the funding rate
let midpoint = pricing.latestMidpoints[[assets.assetToIndex(asset)]].toNumber();
```

### Viewing oracle price

The `Exchange` object creates an oracle subscription to any assets (eg SOL/USD or BTC/USD) on load. You can access the latest oracle prices like so:

```ts
// Get the available price feeds.
Exchange.oracle.getAvailablePriceFeeds();

// Get the price of a given feed.
let price = Exchange.oracle.getPrice(constants.Asset.SOL);
```

See callbacks to update state live.

### Callbacks and state tracking

Due to the number of changing states in the Zeta program, the SDK makes use of Solana websockets for users to receive callbacks when accounts are **polled and/or changed.**

There are two categories of callbacks, one relating to user state and the other to non-user based state (program state).

The callback function is passed in either

* `Exchange.load` - for non user events.
* `CrossClient.load` - for user events.

You can see these `EventType` in `src/events.ts`.

**NOTE: Some callbacks are done on poll so don't always reflect a change in state.**

| Event              |     Type     |                                                                                     Meaning                                                                                     |                                                  Change |
| ------------------ | :----------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------: |
| EXCHANGE           |    Program   |                                                                             Exchange polling update                                                                             |                                        Exchange polling |
| PRICING            |    Program   |                                                                      When pricing is updated (mark prices)                                                                      | <p>Exchange's pricing or<br>Exchange.riskCalculator</p> |
| ORDERBOOK          |    Program   |                                                                          When an orderbook poll occurs.                                                                         |                                        Exchange.markets |
| ORACLE             |  Pyth oracle |                                                                                Pyth price update.                                                                               |                                         Exchange.oracle |
| CLOCK              | Solana clock |                                                                           Solana clock account change.                                                                          |                                 Exchange.clockTimestamp |
| TRADEV3            |     User     |                                                                               On user trade event.                                                                              |                                          client.account |
| ORDERCOMPLETEEVENT |     User     |                                                                     User order is fully filled or cancelled.                                                                    |                                          client.account |
| USER               |     User     | <p>When the user's crossMarginAccount<br>changes, which can occur on<br>inserts, cancels, trades, withdrawals,<br>deposits, settlement, liquidation,<br>force cancellations</p> |                                          client.account |

These callbacks should eliminate the need to poll for most accounts, unless you need certainty on the state, in which case there are polling functions available in `Exchange` and `CrossClient`.

```ts
// Generic callback function to pass into `Exchange.load` or `CrossClient.load`.
async function callback(asset: assets.Asset, eventType: events.EventType, data: any) {
  switch (eventType) {
    case events.EventType.CLOCK:
      // ... Handle via Exchange.clockTimestamp
    case events.EventType.<SomeOtherEvent>:
      break;
  }
}
```

`asset` in each callback can potentially be `null` if the callback applies to all assets, such as clock callbacks which are common.

#### Event data

The function definition of a callback is `(asset: assets.Asset, event: EventType, data: any) => void`

Only `ORACLE` and `ORDERBOOK` events have data in them.

ORACLE:

```ts
export interface OraclePrice {
  asset: assets.Asset; // The feed's asset eg SOL or BTC.
  price: number; // i.e. 1000.23
  lastUpdatedTime: number; // Seconds since Linux epoch
  lastUpdatedSlot: bigint; // Blockchain slot, from Pyth
}
```

ORDERBOOK:

```ts
export interface OrderbookEvent {
  marketIndex: number; // The market index that was updated.
}
```

After receiving an orderbook update, you can assume `Exchange.getOrderbook(asset)` is the latest state.

### Native polling in SDK

There is polling natively built into the SDK `Exchange` and `CrossClient` objects since state relies quite heavily on websockets.

This was to ensure that:

1. SDK program state would correct itself on websocket issues.
2. There was a mechanism for users to poll state on some defined interval (and get a callback when it happened, see below).

#### Exchange polling

`Exchange` has a default poll interval of `constants.DEFAULT_EXCHANGE_POLL_INTERVAL` (set to 30 seconds).

You can change this via setting `Exchange.pollInterval`.

This will poll `Pricing` and zeta `State` accounts.

#### Client polling and throttle

`CrossClient` has a default poll interval of `constants.DEFAULT_CLIENT_POLL_INTERVAL` (set to 20 seconds).

You can change this via `client.setPollInterval()`.

This is *almost* how often the SDK will call `await client.updateState()`, which is the manual way of polling user state.

There is a timer that on default fires every 2 seconds, checking the last poll timestamp. If time greater than client.pollInterval has elapsed or there is a pending update, it will poll.

Pending update refers to a margin account websocket change callback. (The SDK subscribes to user `CrossMarginAccount` on `CrossClient.load`.)

This will do multiple things (`client.updateState()`):

1. Fetch user margin account (`client.account`).
2. Update user orders (this will poll the market orderbook for each market that the user has a non zero position or open orders in - `client.getOrders(asset)`).
3. Update user positions (`client.getPositions(asset)`).

This timer can be modified via `client.setPolling(intervalSeconds)`.

Tying into this, the motivation behind this complexity is that if a user is asynchronously placing and cancelling orders across multiple markets, you may receive multiple margin account callbacks across consecutive slots.

If each call back polls relevant markets for the latest user order state (2 polls per market), you can easily hit rate limits.

If `throttle` is set to `true`, in `CrossClient.load`, then this timer allows users to batch client polling to the next timer interval (i.e. optimistically, 5 consecutive slot updates will only trigger 1 poll).

Alternatively, `throttle` can be set to `false`, and `client.updateState` will be called on every margin account change and ensure you have the latest state at all times.

#### Shutting down

When you want to shut down or restart the client, call this to disconnect the respective websockets.

```ts
// Close exchange object.
await Exchange.close();

// Close client object.
await client.close();
```

### Ready to start trading?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=ts_sdk\&utm_term=cta)


# Examples

Additional code examples, available in the [SDK repository on Github](https://github.com/zetamarkets/sdk/tree/main/examples).

* [Basic](/build-with-zeta/sdks/typescript-sdk/examples/basic-example): Loading exchange, placing orders and viewing state.
* [Cranking](/build-with-zeta/sdks/typescript-sdk/examples/cranking): Common crank instructions that keep our exchange moving.
* [Liquidator](/build-with-zeta/sdks/typescript-sdk/examples/liquidator): Secure the Zeta platform from over-bankrupt accounts.
* [Subscription](/build-with-zeta/sdks/typescript-sdk/examples/subscription): Get automatically notified about any margin account changes.&#x20;
* [Versioned Transactions](/build-with-zeta/sdks/typescript-sdk/examples/versioned-transactions): Fit more instructions into a single transaction with Solana's new features.


# Basic example

Loading exchange, placing orders and viewing state

***Github repository:*** [***https://github.com/zetamarkets/sdk/tree/main/examples/basic***](https://github.com/zetamarkets/sdk/tree/main/examples/basic)

Our first example summarises what the [overview](/build-with-zeta/sdks/typescript-sdk) page discussed:

* Loading an Exchange and Client object
* Viewing the state of the exchange, orderbooks and any orders
* Placing basic orders and cancelling them

<details>

<summary>Code</summary>

```typescript
require("dotenv").config();

import {
  Wallet,
  CrossClient,
  Exchange,
  Network,
  utils,
  types,
  assets,
  events,
  constants,
} from "@zetamarkets/sdk";
import { PublicKey, Connection, Keypair } from "@solana/web3.js";
import fetch from "node-fetch";

const NETWORK_URL = process.env["network_url"]!;
const SERVER_URL = process.env["server_url"];
const STARTING_BALANCE = 5_000;

async function exchangeCallback(
  asset: constants.Asset,
  _eventType: events.EventType,
  _data: any
) {
  console.log(`[ExchangeCallback] Asset=${assets.assetToName(asset)}`);
}

async function clientCallback(
  asset: constants.Asset,
  _eventType: events.EventType,
  _data: any
) {
  console.log(`[ClientCallback] Asset=${assets.assetToName(asset)}`);
}

async function main() {
  // Generate a new keypair for wallet otherwise load from a private key.
  const userKey = Keypair.generate();

  // Loads the private key in .env
  // const userKey = Keypair.fromSecretKey(
  //   new Uint8Array(JSON.parse(Buffer.from(process.env.private_key!).toString()))
  // );

  const wallet = new Wallet(userKey);

  // Create a solana web3 connection to devnet.
  const connection: Connection = new Connection(NETWORK_URL, "confirmed");

  // Airdropping SOL.
  await connection.requestAirdrop(wallet.publicKey, 100_000_000);

  const loadExchangeConfig = types.defaultLoadExchangeConfig(
    Network.DEVNET,
    connection,
    utils.defaultCommitment(),
    0,
    true
  );

  await fetch(`${SERVER_URL}/faucet/USDC`, {
    method: "post",
    body: JSON.stringify({
      key: wallet.publicKey.toString(),
      amount: 10_000,
    }),
    headers: { "Content-Type": "application/json" },
  });

  await Exchange.load(
    loadExchangeConfig
    // , wallet
    // , exchangeCallback
  );

  Exchange.getAllSubExchanges().forEach(async (se) => {
    await se.updatePerpSerumMarketIfNeeded(0);
  });

  const client = await CrossClient.load(
    connection,
    wallet,
    undefined
    // , clientCallback
  );

  let tradingAsset = constants.Asset.APT;

  await client.deposit(utils.convertDecimalToNativeInteger(STARTING_BALANCE));

  utils.displayState();

  // Show current orderbook for a market.
  console.log(`${tradingAsset} Market orderbook:`);
  console.log(Exchange.getOrderbook(tradingAsset));

  // Place bid orders
  await client.placeOrder(
    tradingAsset,
    utils.convertDecimalToNativeInteger(0.1),
    utils.convertDecimalToNativeLotSize(2),
    types.Side.BID,
    { tifOptions: {}, orderType: types.OrderType.LIMIT } // Extra optional parameters
  );

  // Allow orderbook to update (it uses a websocket subscription)
  await utils.sleep(1000);

  // See our order in the orderbook.
  console.log(`${tradingAsset} Market orderbook after our order:`);
  console.log(Exchange.getOrderbook(tradingAsset));

  // See our positions
  await client.updateState();
  console.log(
    `${tradingAsset} positions: ${client.getPositions(tradingAsset)}`
  );

  // Check mark prices for the product.
  console.log(
    `${tradingAsset} Mark price: ${Exchange.getMarkPrice(tradingAsset)}`
  );

  // Calculate user account state.
  let accountState = client.getAccountState();
  console.log(`${tradingAsset} Account state:`, accountState);
}

main().catch(console.error.bind(console));
```

</details>


# Cranking

Common crank instructions that keep our exchange moving

***Github repository:*** [***https://github.com/zetamarkets/sdk/tree/main/examples/cranking***](https://github.com/zetamarkets/sdk/tree/main/examples/cranking)

There are multiple permissionless instructions that "crank", keeping the zeta platform in an up to date state. This example runs all the necessary instructions.

1. **Crank event queue:** Process maker fill events to ensure that user margin accounts are in the correct state after trades occur.
2. **Update pricing**: Recalculate mark prices and greeks for our products on an expiry basis. This will also update perp funding rates.
3. **Rebalance insurance vault**: Moves funds collected from fees between margin accounts and the insurance vault (which is used to ensure platform security).
4. **Apply perp funding**: Periodically apply any unpaid funding to all margin accounts holding perp positions.
5. **Prune expired TIF orders**: When an order of TIF expires it must be pruned to get deleted. This happens automatically if a counterparty tries to trade against it however.

<details>

<summary>Code</summary>

```typescript
require("dotenv").config();

import {
  Wallet,
  Exchange,
  Network,
  utils,
  programTypes,
  constants,
  Market,
  assets,
  types,
} from "@zetamarkets/sdk";
import { PublicKey, Connection, Keypair } from "@solana/web3.js";

let network: Network;
switch (process.env["network"]) {
  case "localnet":
    network = Network.LOCALNET;
    break;
  case "devnet":
    network = Network.DEVNET;
    break;
  case "mainnet":
    network = Network.MAINNET;
    break;
  default:
    throw Error("Unsupported network type!");
}

const NETWORK_URL = process.env["network_url"]!;
const MAX_ACCOUNTS_TO_FETCH = 99;
let crankingMarkets = new Array(constants.ACTIVE_MARKETS - 1).fill(false);
console.log(NETWORK_URL);
const assetList = [constants.Asset.BTC];

export async function sleep(ms: number) {
  await new Promise((resolve) => setTimeout(resolve, ms, undefined));
}

async function main() {
  // Generate a new keypair for wallet otherwise load from a private key.
  const userKey = Keypair.generate();
  const wallet = new Wallet(userKey);

  // Load from private_key stored in .env file.
  // const privateKey = Keypair.fromSecretKey(
  //   new Uint8Array(JSON.parse(Buffer.from(process.env.private_key).toString()))
  // );
  // const wallet = new Wallet(privateKey);

  // Create a solana web3 connection to devnet.
  const connection = new Connection(NETWORK_URL, "confirmed");

  // Airdropping SOL.
  // Only able to be done on localnet/devnet.
  if (network != Network.MAINNET) {
    await connection.requestAirdrop(wallet.publicKey, 100000000);
  }

  const loadExchangeConfig = types.defaultLoadExchangeConfig(
    network,
    connection,
    utils.defaultCommitment(),
    0, // ThrottleMs - increase if you are running into rate limit issues on startup.
    true
  );

  // We load the exchange with a valid wallet containing SOL to call permissionless zeta functions.
  await Exchange.load(loadExchangeConfig, wallet);

  // Display state of zeta markets
  setInterval(
    async function () {
      utils.displayState();
    },
    process.env.DISPLAY_STATE_INTERVAL
      ? parseInt(process.env.DISPLAY_STATE_INTERVAL)
      : 30000
  );

  /**
   * Cranks the serum dex event queue for each zeta market. This will process trades that consist of maker fills.
   * All other events are atomically processed at time of call such as taker fills and cancels.
   * Functionality here will keep track of markets that are currently being cranked, markets that have empty event queues
   * as well as allowing specification of whether only live markets are being cranked.
   * This will flush event queues completely upon call.
   * This function will poll all market event queues asynchronously so is quite expensive in terms of RPC requests per second.
   * Use crankExchangeThrottle if you are running into rate limit issues.
   */
  setInterval(
    async function () {
      assetList.map(async (asset) => {
        await utils.crankMarket(asset);
      });
    },
    process.env.CRANK_EXCHANGE_INTERVAL
      ? parseInt(process.env.CRANK_EXCHANGE_INTERVAL)
      : 5000
  );

  // Update pricing on live markets
  setInterval(
    async function () {
      await updatePricing();
    },
    process.env.UPDATE_PRICING_INTERVAL
      ? parseInt(process.env.UPDATE_PRICING_INTERVAL)
      : 5000
  );

  // Apply funding to any users holding perp positions
  setInterval(
    async function () {
      await applyFunding();
    }.bind(this),
    process.env.APPLY_FUNDING_INTERVAL
      ? parseInt(process.env.APPLY_FUNDING_INTERVAL)
      : 120_000
  );

  setInterval(
    async function () {
      await pruneExpiredTIFOrders();
    }.bind(this),
    process.env.PRUNE_EXPIRED_TIF_INTERVAL
      ? parseInt(process.env.PRUNE_EXPIRED_TIF_INTERVAL)
      : 60000
  );

  // Rebalance zeta vault and insurance fund
  setInterval(
    async function () {
      await rebalanceInsuranceVault();
    }.bind(this),
    process.env.REBALANCE_INSURANCE_VAULT_INTERVAL
      ? parseInt(process.env.REBALANCE_INSURANCE_VAULT_INTERVAL)
      : 20000
  );
}

/**
 * This calls zeta's permissionless update pricing function through the Exchange object.
 * Cranks zeta's on-chain pricing ensuring all our greeks and theos are up-to-date.
 */
async function updatePricing() {
  // Get relevant expiry indices.

  await Promise.all(
    assetList.map(async (asset) => {
      try {
        console.log(`[${assets.assetToName(asset)}] Update pricing`);
        await Exchange.updatePricing(asset);
      } catch (e) {
        console.error(
          `[${assets.assetToName(asset)}] Update pricing failed. ${e}`
        );
      }
    })
  );
}

async function applyFunding() {
  let marginAccPubkeys = [];
  try {
    marginAccPubkeys = await utils.getAllProgramAccountAddresses(
      types.ProgramAccountType.MarginAccount
    );
  } catch (e) {
    throw Error("Account address fetch error on applyFunding()!");
  }
  for (
    let i = 0;
    i < marginAccPubkeys.length;
    i += constants.MAX_FUNDING_ACCOUNTS
  ) {
    // Grab set of margin accounts
    let marginAccounts = [];
    try {
      marginAccounts =
        await Exchange.program.account.marginAccount.fetchMultiple(
          marginAccPubkeys.slice(i, i + constants.MAX_FUNDING_ACCOUNTS)
        );
    } catch (e) {
      throw Error("Account data fetch error on applyFunding()!");
    }

    // In that set: Check if any have non-zero perp positions
    // If they do, apply funding on them
    let fundingAccounts = new Map<constants.Asset, PublicKey[]>();
    for (var asset of Exchange.assets) {
      fundingAccounts.set(asset, []);
    }

    for (let j = 0; j < marginAccounts.length; j++) {
      if (marginAccounts[j].perpProductLedger.position.size != 0) {
        fundingAccounts
          .get(assets.fromProgramAsset(marginAccounts[j].asset))
          .push(marginAccPubkeys[i + j]);
      }
    }

    // This will automatically break into multiple txs if there are too many
    for (var asset of Exchange.assets) {
      await utils.applyPerpFunding(asset, fundingAccounts.get(asset));
    }
  }
}

async function pruneExpiredTIFOrders() {
  let subExchanges = Exchange.getAllSubExchanges();

  try {
    await Promise.all(
      subExchanges.map((se) => {
        return utils.pruneExpiredTIFOrders(se.asset);
      })
    );
    console.log("Pruned expired TIF orders.");
  } catch (e) {
    console.log("Failed to prune expired TIF orders.", `Error=${e}`);
  }
}

/**
 * Rebalances the zeta vault and the insurance vault to ensure consistent platform security.
 * Checks all margin accounts for non-zero rebalance amounts and rebalances them all.
 */
async function rebalanceInsuranceVault() {
  let marginAccPubkeys: PublicKey[];
  try {
    marginAccPubkeys = await utils.getAllProgramAccountAddresses(
      types.ProgramAccountType.MarginAccount
    );
  } catch (e) {
    console.log(
      "rebalanceInsuranceVault account address fetch error",
      `Error=${e}`
    );
  }

  for (let i = 0; i < marginAccPubkeys.length; i += MAX_ACCOUNTS_TO_FETCH) {
    let marginAccs: any[];
    try {
      marginAccs = await Exchange.program.account.marginAccount.fetchMultiple(
        marginAccPubkeys.slice(i, i + MAX_ACCOUNTS_TO_FETCH)
      );
    } catch (e) {
      console.log(
        "rebalanceInsuranceVault margin account fetch error",
        `Error=${e}`
      );
    }

    let remainingAccounts: any[] = new Array();
    for (let j = 0; j < marginAccs.length; j++) {
      if (marginAccs[j].rebalanceAmount.toNumber() != 0) {
        remainingAccounts.push({
          pubkey: marginAccPubkeys[i + j],
          isSigner: false,
          isWritable: true,
        });
      }
    }
    console.log(
      `[REBALANCE INSURANCE VAULT] for ${remainingAccounts.length} accounts.`
    );
    try {
      await Exchange.rebalanceInsuranceVault(remainingAccounts);
    } catch (e) {
      console.log(
        "rebalanceInsuranceVault vault error on transaction",
        `Error=${e}`
      );
    }
  }
}

main().catch(console.error.bind(console));
```

</details>


# Liquidator

Secure the Zeta platform from over-bankrupt accounts

***Github repository:*** [***https://github.com/zetamarkets/sdk/tree/main/examples/liquidator-example***](https://github.com/zetamarkets/sdk/tree/main/examples/liquidator-example)

#### Performing liquidations is a risky endeavour, and is not guaranteed to be profitable. Those performing liquidations should be advised that their capital is not guaranteed to be safe and should only risk what they are willing to lose. This software is unaudited / untested and should solely serve as an example for interacting with the Zeta DEX.

How the liquidation process works on Zeta DEX:

1. An underwater account goes below maintenance margin, and is able to be liquidated.
2. Liquidators must cancel all open orders for that account before performing liquidations.
3. Liquidations occur at mark price +/- a liquidation reward for shorts/longs. This reward is for liquidators can be found under [Liquidation Rewards](/zeta-protocol/trading-specifications#perpetual-futures).
4. Liquidators can send in liquidation instructions and proceed to liquidate positions one at a time for a certain party. At each liquidation instruction the smart contract code checks that the user is still below their maintenance margin requirement (partial liquidations).

Unlike the other examples, there are a few separate files. They're pasted below, but it's probably easier to clone our [Github repository](https://github.com/zetamarkets/sdk/tree/cleanup-readme/examples/liquidator-example) instead.

<details>

<summary>Code (liquidator.ts)</summary>

```typescript
require("dotenv").config();
import {
  CrossClient,
  Exchange,
  Network,
  utils,
  types,
  assets,
  programTypes,
  constants,
} from "@zetamarkets/sdk";
import { PublicKey, Connection, Keypair } from "@solana/web3.js";
import { Wallet } from "@zetamarkets/anchor";
import {
  cancelAllActiveOrders,
  findAccountsAtRisk,
  findLiquidatableAccounts,
  liquidateAccounts,
} from "./liquidator-utils";
import * as anchor from "@zetamarkets/anchor";

import { airdropUsdc } from "./utils";

let client: CrossClient;
let scanning: boolean = false;

// Function that will do a few things sequentially.
// 1. Get all margin accounts for the program.
// 2. Cancel all active orders for accounts at risk. (This is required to liquidate an account)
// 3. Naively liquidate all margin accounts at risk up to your own margin account available balance limit.
export async function scanMarginAccounts() {
  // Just early exit if previous scan is still running.
  if (scanning) {
    return;
  }
  console.log(`Scanning margin accounts...`);
  scanning = true;
  let marginAccounts: anchor.ProgramAccount[] =
    await Exchange.program.account.crossMarginAccount.all();

  console.log(`${marginAccounts.length} margin accounts.`);

  let accountsAtRisk = await findAccountsAtRisk(marginAccounts);
  if (accountsAtRisk.length == 0) {
    console.log("No accounts at risk.");
    scanning = false;
    return;
  }

  // We need to cancel all orders on accounts that are at risk
  // before we are able to liquidate them.
  await cancelAllActiveOrders(client, accountsAtRisk);

  // Liquidate the accounts that are under water exclusive of initial
  // margin as cancelling active orders reduces initial margin to 0.
  let liquidatableAccounts: anchor.ProgramAccount[] =
    await findLiquidatableAccounts(accountsAtRisk);

  await liquidateAccounts(client, liquidatableAccounts);

  // Display the latest client state.
  await client.updateState();
  let clientMarginAccountState =
    Exchange.riskCalculator.getCrossMarginAccountState(client.account);
  console.log(
    `Client margin account state: ${JSON.stringify(clientMarginAccountState)}`
  );
  scanning = false;
}

async function main() {
  let connection: Connection = new Connection(process.env.connection, {
    commitment: "confirmed",
    disableRetryOnRateLimit: true,
  });

  // Starting balance for USDC to airdrop.
  const startingBalance = 10_000;

  // Set the network for the SDK to use.
  const network = Network.DEVNET;

  // Load user wallet.
  const keypair = Keypair.generate();

  // You can load from your local keypair as well.
  /*
  const keypair = Keypair.fromSecretKey(
    new Uint8Array(JSON.parse(Buffer.from(process.env.private_key!).toString()))
  );
  */

  const wallet = new Wallet(keypair);
  // Add some solana and airdrop some fake USDC.
  if (network == Network.DEVNET) {
    // Airdrop 1 SOL.
    await connection.requestAirdrop(wallet.publicKey, 1_000_000_000);
    await airdropUsdc(wallet.publicKey, startingBalance);
  }

  const loadExchangeConfig = types.defaultLoadExchangeConfig(
    network,
    connection,
    utils.defaultCommitment(),
    0, // Increase if you are getting rate limited on startup.
    true
  );

  // Load the SDK Exchange object.
  await Exchange.load(
    loadExchangeConfig,
    new types.DummyWallet() // Normal clients don't need to use a real wallet for exchange loading.
  );

  client = await CrossClient.load(
    connection,
    wallet,
    utils.defaultCommitment()
  );

  // The deposit function for client will initialize a margin account for you
  // atomically in the same transaction if you haven't created one already.
  await client.deposit(utils.convertDecimalToNativeInteger(startingBalance));

  setInterval(
    async () => {
      try {
        await scanMarginAccounts();
      } catch (e) {
        console.log(`Scan margin account error: ${e}`);
      }
    },
    process.env.check_interval_ms
      ? parseInt(process.env.check_interval_ms)
      : 5000
  );
}

main().catch(console.error.bind(console));
```

</details>

<details>

<summary>Code (liquidator-utils.ts)</summary>

```typescript
import * as anchor from "@zetamarkets/anchor";
import {
  constants,
  CrossClient,
  Exchange,
  programTypes,
  assets,
} from "@zetamarkets/sdk";

export async function findAccountsAtRisk(
  accounts: anchor.ProgramAccount[]
): Promise<anchor.ProgramAccount[]> {
  let accountsAtRisk: anchor.ProgramAccount[] = [];
  await Promise.all(
    accounts.map((account: anchor.ProgramAccount) => {
      if (account.account == null) {
        return;
      }
      let marginAccountState =
        Exchange.riskCalculator.getCrossMarginAccountState(
          account.account as programTypes.CrossMarginAccount
        );
      if (marginAccountState.availableBalanceInitial >= 0) {
        return;
      }
      console.log(
        `[ACCOUNT_AT_RISK] [ACCOUNT]: ${account.publicKey.toString()} [BALANCE]: ${
          marginAccountState.balance
        } [INITIAL] ${marginAccountState.initialMarginTotal} [MAINTENANCE]: ${
          marginAccountState.maintenanceMarginTotal
        } [UNREALIZED PNL] ${
          marginAccountState.unrealizedPnlTotal
        } [AVAILABLE BALANCE INITIAL] ${
          marginAccountState.availableBalanceInitial
        } [AVAILABLE BALANCE MAINTENANCE] ${
          marginAccountState.availableBalanceMaintenance
        }`
      );
      accountsAtRisk.push(account);
    })
  );
  return accountsAtRisk;
}

export async function findLiquidatableAccounts(
  accounts: anchor.ProgramAccount[]
): Promise<anchor.ProgramAccount[]> {
  let liquidatableAccounts: anchor.ProgramAccount[] = [];
  await Promise.all(
    accounts.map((account: anchor.ProgramAccount) => {
      if (account.account == null) {
        return;
      }

      let marginAccountState =
        Exchange.riskCalculator.getCrossMarginAccountState(
          account.account as programTypes.CrossMarginAccount
        );

      // We assume the accounts passed in have had their open orders cancelled.
      // Therefore can just use availableBalanceLiquidation which assumes 0 open orders.
      if (marginAccountState.availableBalanceMaintenance >= 0) {
        return;
      }
      console.log(
        `[LIQUIDATABLE ACCOUNT] [ACCOUNT] ${account.publicKey.toString()} [BALANCE] ${
          marginAccountState.balance
        } [AVAILABLE BALANCE MAINTENANCE] ${
          marginAccountState.availableBalanceMaintenance
        }`
      );
      liquidatableAccounts.push(account);
    })
  );
  return liquidatableAccounts;
}

export async function cancelAllActiveOrders(
  client: CrossClient,
  accountsAtRisk: anchor.ProgramAccount[]
) {
  await Promise.all(
    accountsAtRisk.map(async (programAccount) => {
      let marginAccount =
        programAccount.account as programTypes.CrossMarginAccount;
      // If they have any active orders, we can cancel.

      for (var asset of Exchange.assets) {
        let position =
          marginAccount.productLedgers[assets.assetToIndex(asset)].orderState;
        if (
          position.openingOrders[0].toNumber() != 0 ||
          position.openingOrders[1].toNumber() != 0 ||
          position.closingOrders.toNumber() != 0
        ) {
          console.log("[FORCE_CANCEL] " + programAccount.publicKey.toString());
          try {
            await client.forceCancelOrders(asset, programAccount.publicKey);
          } catch (e) {
            console.log(e);
          }
        }
      }
    })
  );
}

// Naively liquidates all accounts up to initial margin requirement limits.
export async function liquidateAccounts(
  client: CrossClient,
  accounts: anchor.ProgramAccount[]
) {
  for (var i = 0; i < accounts.length; i++) {
    const liquidateeMarginAccount = accounts[i]
      .account as programTypes.CrossMarginAccount;
    const liquidateeKey = accounts[i].publicKey;

    // If an account is underwater then we can liquidate any position
    for (var asset of Exchange.assets) {
      const position =
        liquidateeMarginAccount.productLedgers[
          assets.assetToIndex(asset)
        ].position.size.toNumber();

      if (position == 0) {
        continue;
      }

      // Get latest state for your margin account.
      await client.updateState();
      let clientState = Exchange.riskCalculator.getCrossMarginAccountState(
        client.account
      );

      let marginConstrainedSize = calculateMaxLiquidationNativeSize(
        asset,
        clientState.availableBalanceInitial,
        position > 0
      );

      const size = Math.min(marginConstrainedSize, Math.abs(position));
      const side = position > 0 ? "Bid" : "Ask";

      console.log(
        "[LIQUIDATE] " +
          liquidateeKey.toString() +
          " [SIDE] " +
          side +
          " [AMOUNT] " +
          size +
          " [MAX CAPACITY WITH MARGIN] " +
          marginConstrainedSize +
          " [AVAILABLE SIZE] " +
          Math.abs(position)
      );
      try {
        let txId = await client.liquidate(asset, liquidateeKey, size);
        console.log(`TX ID: ${txId}`);
      } catch (e) {
        console.log(e);
      }
    }
  }
}

/**
 * @param availableBalance  Available balance for the liquidator.
 * @param marketIndex       The market index of the position to be liquidated.
 * @param long              Whether the liquidatee is long or short.
 * @returns native lot size given liquidator available balance.
 */
export function calculateMaxLiquidationNativeSize(
  asset: constants.Asset,
  availableMargin: number,
  long: boolean
): number {
  // Initial margin requirement per contract in decimals.
  // We use this so you are not at margin requirement limits after liquidation.

  let marginRequirements =
    Exchange.riskCalculator.getPerpMarginRequirements(asset);

  let initialMarginRequirement = long
    ? marginRequirements.initialLong
    : marginRequirements.initialShort;

  console.log(asset, availableMargin, initialMarginRequirement);

  return parseInt(
    (
      (availableMargin / initialMarginRequirement) *
      Math.pow(10, constants.POSITION_PRECISION)
    ).toFixed(0)
  );
}
```

</details>

<details>

<summary>Code (utils.ts)</summary>

```typescript
import { PublicKey } from "@solana/web3.js";
import fetch from "node-fetch";

export async function airdropUsdc(publicKey: PublicKey, amount: number) {
  const body = {
    key: publicKey.toString(),
    amount,
  };
  await fetch(`${process.env.server_url}/faucet/USDC`, {
    method: "post",
    body: JSON.stringify(body),
    headers: { "Content-Type": "application/json" },
  });
}
```

</details>


# Subscription

Get automatically notified about any margin account changes

***Github repository:*** [***https://github.com/zetamarkets/sdk/tree/main/examples/subscription***](https://github.com/zetamarkets/sdk/tree/main/examples/subscription)

Subscribing to changes to onchain is easy using `subscription.subscribeProgramAccounts`. In this example we subscribe to any SOL margin account changes, but you can subscribe to any account types you wish to track.

<details>

<summary>Code</summary>

```typescript
require("dotenv").config();

import {
  Exchange,
  Network,
  utils,
  types,
  programTypes,
  subscription,
  constants,
} from "@zetamarkets/sdk";

import { PublicKey, Connection } from "@solana/web3.js";

const NETWORK_URL = process.env["network_url"]!;

let network: Network;

switch (process.env["network"]) {
  case "localnet":
    network = Network.LOCALNET;
    break;
  case "devnet":
    network = Network.DEVNET;
    break;
  case "mainnet":
    network = Network.MAINNET;
    break;
  default:
    throw Error("Unsupported network type!");
}

async function main() {
  // Create a solana web3 connection to devnet.
  const connection = new Connection(NETWORK_URL, "confirmed");

  const loadExchangeConfig = types.defaultLoadExchangeConfig(
    network,
    connection,
    utils.defaultCommitment(),
    0, // ThrottleMs - increase if you are running into rate limit issues on startup.
    true
  );

  await Exchange.load(
    loadExchangeConfig,
    // Exchange wallet can be ignored for normal clients.
    undefined
  );

  subscription.subscribeProgramAccounts<programTypes.CrossMarginAccount>(
    types.ProgramAccountType.CrossMarginAccount,
    async (
      data: subscription.AccountSubscriptionData<programTypes.CrossMarginAccount>
    ) => {
      // Here you can filter for only accounts you care about (such as your own)
      console.log(data);
    }
  );

  await utils.sleep(100_000);

  // Close to end the websockets.
  // await Exchange.close();
}

main().catch(console.error.bind(console));
```

</details>


# Versioned Transactions

Fit more instructions into a single transaction with Solana's new features

***Github repository:*** [***https://github.com/zetamarkets/sdk/tree/main/examples/versioned-txes***](https://github.com/zetamarkets/sdk/tree/main/examples/versioned-txes)

Advanced Solana features help you get more out of your code. This example uses Address Lookup Tables (ALTs), a feature of Solana's new Versioned Transactions, to stack multiple placeOrder instructions into a single transaction. Sandwiching instructions is quite limited without ALTs as you'll quickly run into resource and account limits.

<details>

<summary>Code</summary>

```typescript
require("dotenv").config();

import {
  Wallet,
  CrossClient,
  Exchange,
  Network,
  utils,
  types,
  assets,
  constants,
} from "@zetamarkets/sdk";
import { PublicKey, Connection, Keypair, Transaction } from "@solana/web3.js";
import fetch from "node-fetch";

const NETWORK_URL = process.env["network_url"]!;
const SERVER_URL = process.env["server_url"];
const STARTING_BALANCE = 10_000;
const ASSETS = [constants.Asset.SOL, constants.Asset.ARB, constants.Asset.APT];
const USER_KEY = Keypair.generate();
const WALLET = new Wallet(USER_KEY);
const CONNECTION: Connection = new Connection(NETWORK_URL, "confirmed");

const MAX_SINGLE_MARKET_PLACE_ORDER_IXS = 6;
const MAX_ALL_PERP_MARKET_PLACE_ORDER_IXS = 6;

async function main() {
  // Airdropping SOL.
  await CONNECTION.requestAirdrop(WALLET.publicKey, 1_000_000_000);

  await fetch(`${SERVER_URL}/faucet/USDC`, {
    method: "post",
    body: JSON.stringify({
      key: WALLET.publicKey.toString(),
      amount: 10_000,
    }),
    headers: { "Content-Type": "application/json" },
  });

  const loadExchangeConfig = types.defaultLoadExchangeConfig(
    Network.DEVNET,
    CONNECTION,
    utils.defaultCommitment(),
    0, // ThrottleMs - increase if you are running into rate limit issues on startup.
    true
  );

  await Exchange.load(loadExchangeConfig);

  const client = await CrossClient.load(
    CONNECTION,
    WALLET,
    undefined,
    undefined,
    undefined,
    undefined,
    true
  );

  console.log("client loaded:", client.publicKey.toBase58());

  await client.deposit(utils.convertDecimalToNativeInteger(STARTING_BALANCE));

  await utils.sleep(500);

  console.log(
    `User margin acc balance: ${
      Exchange.riskCalculator.getCrossMarginAccountState(client.account!)
        .balance
    }`
  );

  await Promise.all(
    ASSETS.map(async (asset) => {
      return client.initializeOpenOrdersAccount(asset);
    })
  );

  await Promise.all(
    ASSETS.map(async (asset) => {
      let singleMarketTx = new Transaction();
      for (let i = 0; i < MAX_SINGLE_MARKET_PLACE_ORDER_IXS; i++) {
        singleMarketTx.add(
          client.createPlacePerpOrderInstruction(
            asset,
            utils.convertDecimalToNativeInteger((i + 1) / 100),
            utils.convertDecimalToNativeLotSize(1),
            types.Side.BID
          )
        );
      }

      await utils.processTransaction(
        client.provider,
        singleMarketTx,
        undefined,
        undefined,
        undefined,
        utils.getZetaLutArr()
      );
    })
  );

  await utils.sleep(2000);

  ASSETS.forEach((asset) => {
    console.log(
      `client has ${client.getOrders(asset).length} orders on ${asset}`
    );
  });

  await client.cancelAllMarketOrders();
  let multiMarketTx = new Transaction();

  for (let i = 0; i < MAX_ALL_PERP_MARKET_PLACE_ORDER_IXS; i++) {
    multiMarketTx.add(
      client.createPlacePerpOrderInstruction(
        ASSETS[0],
        utils.convertDecimalToNativeInteger((i + 1) / 100),
        utils.convertDecimalToNativeLotSize(0.01),
        types.Side.BID
      )
    );
  }

  await utils.processTransaction(
    client.provider,
    multiMarketTx,
    undefined,
    undefined,
    undefined,
    utils.getZetaLutArr()
  );

  await utils.sleep(2000);

  ASSETS.forEach((asset) => {
    console.log(
      `client has ${client.getOrders(asset).length} orders on ${asset}`
    );
  });

  await Exchange.close();
  await client.close();
}

main().catch(console.error.bind(console));
```

</details>


# REST Data API

Grab public data via the API, such as trades and stats. Trading via REST is not supported at the moment.

Reference and testing available on Scalar: <https://zetamarkets.apidocumentation.com/reference>

Missing something? Send us a message and we can add it!


# Program ABI

This is Zeta's cross-program integration ecosystem - fully open-sourced.

The objective of this page is to give a brief overview of the Zeta Cross Program Invocation (CPI) interface. For a more detailed view please refer to the[ Github Repository](https://github.com/zetamarkets/zeta-abi).

### Cross Program Invocations

#### Instructions

The instructions currently supported are as follows:

The instructions currently supported are as follows:

* `initialize_cross_margin_account` - create and initialize a user's margin account
* `initialize_cross_margin_account_manager` - create and initialize a user's margin account manager
* `initialize_open_orders_v3` - create and initialize user's open orders account
* `deposit_v2` - deposit USDC collateral into the margin account
* `withdraw_v2` - withdraw USDC collateral from the margin account
* `place_perp_order_v3` - place a perp order of (price, size, side) on the relevant market
* `cancel_order_xxx` - collection of order cancellation functions, by orderId, clientOrderId, market, etc
* `close_open_orders` - close open orders account
* `liquidate_v2` - trigger liquidation

#### Accounts

The accounts and relevant data that is currently supported (non-exhaustive):

* `State` - contains global parameters relating to all markets
  * Fee percentages
  * Admin pubkeys
  * Platform limits
  * Halt state
* `Pricing` - global mark prices, pricing params and funding information
  * Mark Prices
  * Funding rates
  * Perp and margin params
* `CrossMarginAccount` - individual user margin accounts
  * Balance
  * Positions
  * Orders

For a more detailed view please refer to the [Github Repository](https://github.com/zetamarkets/zeta-abi).

### Ready to start trading?

[Start trading now!](https://dex.zeta.markets?utm_source=gitbook\&utm_campaign=Program_ABI\&utm_term=cta)


# Brand Assets

Official brand assets that can we be used for partnerships and media.


# Brand Book

## Introduction to ZETA

Zeta Markets is building the best crypto perpetuals exchange, powered by Solana, the blockchain leading crypto mass adoption.

**Tagline:**

> *Trading At The Speed of Light ⚡*

**Our Thesis:**

> *Defi is full of slow, clunky and expensive user experiences. We're changing that. Taking the best experiences of centralized trading apps and transferring them on-chain to bring users the benefit of transparency, self-custody, decentralization and community ownership.*

**Our Mission:**

> *To provide crypto traders the most reliable and secure platform to easily take advantage of market trends.*

**Our Vision:**

> *The power of on-chain trading in the hands of every trader.*

<details>

<summary>🫀 Core Reason For ZETA’s Existence</summary>

The global need for seamless trading experience, underserved by limitations in current central exchange and decentralized exchange models. Zeta is blazing the path to offer the best of both worlds, providing users with an unparalleled user experience and security.

</details>

<details>

<summary>📈 Primary Business For Next 5 Years</summary>

Zeta Markets envisions the most seamless end-to-end on-chain perps trading experience in the hands of every trader. Providing each user seamless onboarding and trading regardless of platform, on their assets of choice, with speed & security.

</details>

<details>

<summary>🤖 Technology That Sets ZETA Apart</summary>

1. Pioneer of the [**on-chain central limit orderbook**](/zeta-protocol/exchange-architecture/orderbook-and-matching-engine) (CLOB). All matching engine logic lives on-chain and is run by the validator network. CLOBs are the gold standard in financial markets, and give traders on Zeta significantly better spreads and execution versus AMMs.
2. **Extremely fast and intuitive trading UI for web and mobile**. It has a modern, user-friendly design that has been written from the ground up to prioritise responsiveness and accessibility.
3. **Fast, low-latency, event-driven architecture**. The Zeta backend streams orderbook prices to the frontend within milliseconds of them reaching the network (intra-block), making the front-end feel as fast as a centralized exchange.
4. **Excellent capital efficiency** thanks to the [**Zeta cross-margin risk engine**](/zeta-protocol/exchange-architecture/margin-system). This allows users to trade all perp markets with up to 20x leverage using the same shared collateral.
5. **Advanced exchange security mechanisms** such as an insurance fund, global OI and withdrawal rate limits to prevent malicious exploits. Testament to this, Zeta has had no smart contract exploits in 3 years of operation.&#x20;
6. **Low gas fees** of Solana and a dynamic gas fee selection algorithm that makes sure users orders are likely to be executed without overpaying.&#x20;
7. **Institutional-grade market connectivity**. Zeta supports a [several SDKs](/build-with-zeta/sdks/python-sdk) for algorithic traders that are websocket-based and highly performant.
8. **Specialized order types** like Time-in-Force (TIF) orders with auto-expiration to protect liquidity providers during times of Solana congestion.
9. **Sophisticated rewards systems** such as trading leaderboards, [points programs](broken://pages/eNRKo3RhYTX4d1BbcPlz) and [market maker rewards](/rewards-programs/maker-rewards-program) that update in near real-time.
10. (Coming Soon) Zeta will pioneer Solana's first DeFi L2 to compete with Centralized Exchanges in speed, liquidity, ease of use and fees.

</details>

<details>

<summary>💜 Zeta’s Promises that we continually build towards</summary>

1. *Fast* - Zeta is the fastest Perps DEX in the market.
2. *User-friendly* - Zeta makes DeFi intuitive and accessible for both pros and casual users.
3. *Secure* - Users have control of their funds and withdraw when they want to with peace of mind.
4. *Reliable* - Zeta as a platform is reliable, and the team prioritises users and shipping better products above all else
5. *Opportunity to Benefit* - Users are exposed to money making opportunities and ways to earn more rewards on Zeta, and are not treated as assets or exit liquidity

</details>

<details>

<summary>🌋 Zeta’s Narrative</summary>

Zeta Markets is building the best perps exchange in the world, and full scale on-chain perps ecosystem to drive DeFi forward and onboard the masses.

Zeta believes in a future where all crypto traders’ needs for trading, community and ownership are met permissionlessly and non-custodially on-chain. To make that future true is:

1. Working on the best mobile & desktop perps trading experience.
2. Creating a virtuous flywheel where all stakeholders benefit from utilising the product and participating in governance, co-creating the future of the Zeta ecosystem.
3. Placing high conviction bets on perps trading as a permanent pillar of the on-chain ecosystem, and Solana as the future of the internet.
4. Launching $Z token as the governance token of the Zeta ecosystem to govern on various important issues such as product decisions, ecosystem growth initiatives and take on community-presented proposals.

As a leading and profitable OG Solana protocol and leading perps DEX, Zeta believes that we are on a long term journey with our community. Our focus and high conviction, void of distractions, will enable the product & community to serve as the best suited for all crypto traders long term, and $ZEX as the symbol for the mass on-chain perps trading meta.

</details>

## Key Audience

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>🥇 DeFi Pro-sumers</strong></td><td><p></p><p>Reasonably sophisticated users who are already onboarded onto DeFi and understand the nuance of using on-chain applications. They are already in the trading funnel, having traded spot before and being at least aware of perps trading. They fall within two categories:</p><ol><li>Existing DeFi perp traders</li><li>DeFi users who trade spot and are aware of perps.</li></ol></td><td></td></tr><tr><td><strong>🥈 CEX-to-DEX users</strong></td><td><p></p><p>Users of centralized exchanges that want to onboard into on-chain trading to experience permissionless and non-custodial finance.</p></td><td></td></tr><tr><td><strong>🏆 Market Makers</strong></td><td><p></p><p>Market Makers (MMs) are highly sophisticated firms or individuals who programmatically provide liquidity to the users. Their primary objective is to make profit from the spreads and from facilitating large amounts of volume.</p><p>MMs seek an easy integration experience, reliable architecture and lots of retail flow for them to trade against.</p></td><td></td></tr></tbody></table>

## Personality & Key Words

Zeta Markets exudes a personality in line with the vision of onboarding the masses—more appealing, more playful, more rebellious, and friendly, with a young and innovative spirit. We do not shy away from strong convictions and care tremendously about our users and their needs, all while not taking ourselves and the market too seriously.

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td></td><td>🏎️  Fast</td><td></td></tr><tr><td></td><td>🧠 Innovative</td><td></td></tr><tr><td></td><td>🦺 Reliable</td><td></td></tr><tr><td></td><td>⚡ Perpetuals Trading</td><td></td></tr><tr><td></td><td>📖 Trustworthy</td><td></td></tr><tr><td></td><td>📱 Hardcore</td><td></td></tr></tbody></table>


# Media Kit

## Brief Introduction & History of Zeta

Founded in 2021 by a team of trading and software development professionals, Zeta Markets is a pioneering crypto perpetuals exchange on Solana. Zeta distinguished itself early on [by winning the second ever Solana hackathon](https://solana.com/news/announcing-winners-of-the-solana-season-hackathon), competing against more than 13,000 teams. This success accelerated the transition of Zeta Markets from a mere proof of concept to a leading decentralized exchange.&#x20;

In December 2021, Zeta Markets announced a $8.5M strategic funding round backed by renowned industry players including Electric Capital, Jump Crypto, Wintermute and Solana Ventures, among others. In May 2024, Zeta Markets closed a new [$5M strategic round](https://blog.zeta.markets/blog/zeta-markets-completes-5m-strategic-round-led-by-electric-capital) led by Electric Capital, with participation from DACM, Airtree Ventures, Selini Capital, and prominent angel investors.

As of May 2024, Zeta Markets has facilitated trading volumes exceeding $6 billion, serving more than 100,000 MAU, and these numbers continue to grow. The vision of Zeta Markets is ambitious yet clear: to place the power of permissionless, non-custodial trading into the hands of every trader in the world.

## Investors

Zeta Markets is invested in by [Electric Capital](https://www.electriccapital.com/), [Jump Capital](https://jumpcap.com/), [Wintermute](https://www.wintermute.com/), and [Solana Ventures](https://solana.ventures/).

Additional investors include Race Capital, DACM, Airtree Ventures, Selini Capital, Amber Group, Sino Global Capital, Genesis Block Ventures, MGNR, 3kVC, LedgerPrime, and SkyVision Capital.

The latest strategic round saw the participation of prominent angel investors, such as Anatoly Yakovenko of Solana, Mert Mumtaz of Helius, Richard Wu of Tensor, Marius Ciubotariu of Kamino, Stepan Simkin of Squads, Alex Smirnov of Debridge, Genia Mikhalchenko of Pyth, Nom of Bonk, JMR Luna of Wintermute, and others.

<figure><img src="/files/YLifgEpK3gtwvRS8vZ3N" alt=""><figcaption></figcaption></figure>

## Zeta's Path Forward

“The power of onchain trading in the hands of every trader”, from vision to reality. More details in the full [Roadmap](https://blog.zeta.markets/blog/zeta-s-roadmap-decoded).

<figure><img src="/files/ZxLdmEWfQp7l41IqWOU8" alt=""><figcaption></figcaption></figure>

## Core Contributors in the Media

{% embed url="<https://solana.com/validated/episodes/tristan-frizza-co-founder-ceo-zeta-markets-ep-62>" %}

{% embed url="<https://www.prnewswire.com/news-releases/zeta-markets-completes-8-5m-strategic-funding-round-led-by-jump-capital-301440040.html>" %}

{% embed url="<https://thedefiant.io/jup-token-rockets-to-top-10-dex-by-market-cap-minutes-after-launch>" %}

{% embed url="<https://www.youtube.com/watch?pp=ygUOdHJpc3RhbiBmcml6emE=&v=sjhc-SdB9XM>" %}

{% embed url="<https://www.youtube.com/watch?v=n-sf-syww0I>" %}


# Logo & Visual Guidelines

{% hint style="info" %}
Working on a design / animation related to Zeta Markets?\
Download the Logo Kit and follow the visual guidelines provided below.
{% endhint %}

{% file src="/files/8nAzOUEctEGUPeISwSIb" %}

{% file src="/files/SWgfktbyqwAQ0S32VO1G" %}

{% file src="/files/NQsKBBemh2X6qiwxQ4EG" %}

{% file src="/files/sPzcPk8PFbzLfbasq4yw" %}


# Zeta X Litepaper

## Zeta X (ZX): Building a Trustless Layer 2 for Decentralized Derivatives Trading on Solana

### Abstract

> We present our initial approach to scaling decentralized perpetuals trading through an optimistic rollup built on Solana that leverages zero-knowledge proofs for trustless on-chain settlement. The rollup will use an off-chain matching engine to achieve performance on par with centralised exchanges whilst leveraging the transparency and security of Solana L1 for data availability (DA) and settlement.

### Table of Contents

* [Introduction](/zeta-x/zeta-x-litepaper/introduction)
* [ZX](/zeta-x/zeta-x-litepaper/zx)
* [Role of $ZEX](/zeta-x/zeta-x-litepaper/role-of-usdzex)
* [Why Solana?](/zeta-x/zeta-x-litepaper/why-solana)
* [High Level Architecture of ZX](/zeta-x/zeta-x-litepaper/high-level-architecture-of-zx)
* [Roadmap](/zeta-x/zeta-x-litepaper/roadmap)
* [Appendix A](/zeta-x/zeta-x-litepaper/appendix-a)
* [References](/zeta-x/zeta-x-litepaper/references)


# Introduction

### Zeta’s First 100k Users

With Zeta Markets, we built DeFi’s most performant fully on-chain central limit order book (CLOB), natively on Solana. This iteration successfully managed over $7 billion in trading volume and has supported over 100,000 active traders, uncovering critical insights into L1 CLOB scalability and opportunities to improve the trader experience.&#x20;

Through the development of Zeta Markets we have identified a number of limitations in delivering a world-class user experience for on-chain perps trading solely on the L1. Despite its industry-leading block times of 400ms and much lower gas fees compared to its competitors, a derivatives exchange built completely on the Solana L1 still faces several challenges such as latency, congestion and high barriers to liquidity provision ([<mark style="color:blue;">Appendix A</mark>](/zeta-x/zeta-x-litepaper/appendix-a)).

ZX is our solution to providing the optimal trading experience that preserves the core advantages of on-chain trading such as complete self-custody, transparency, proof of reserves and verifiability of state changes - qualities that both DeFi users and market makers highly value.

### Doubling Down on Solana

The landscape for DeFi derivatives has continued to expand and evolve significantly since the launch of Zeta’s v1 in 2021. In the first four months of 2024 alone, the total monthly volume averaged close to $250 billion. During the same period, Solana saw a surge in DeFi activity that brought its global DEX volume on equal footing with Ethereum.

<figure><img src="/files/h1yc6ppgJYBK4z5GBidi" alt=""><figcaption></figcaption></figure>

Given these dynamics, we are confident in Solana’s continued growth as a pivotal layer for DeFi activities. By choosing to develop a Solana L2 solution, Zeta strategically positions itself to leverage Solana's thriving DeFi ecosystem and incoming liquidity.

Furthermore, Zeta Markets is a project that has the spirit of Solana at its core. Our team is continually inspired and reassured by the resilience of the Solana community, which has successfully navigated through challenging events such as the FTX collapse, numerous technical hurdles, and a prolonged bear market. We are committed to remaining an integral part of this robust community.

ZX is being built in close collaboration with the Sovereign Labs team who are building an open-source toolkit for architecting asynchronously-proven, sovereign zk-rollups. [\[1\]](https://www.sovereign.xyz/)

ZX aims to push the frontiers of what Solana is capable of in terms of performance and security, charting a course for the future scalability and excellence of dApps that are only possible on Solana.


# ZX

ZX will be a Solana rollup built to scale the trading experience. Settlement and consensus (data availability) will exist on the native Solana L1, whilst execution will be handled by an off-chain zkVM compatible matching engine. While perpetuals trading remains our primary focus, ZX is designed with the flexibility to facilitate a broader range of functionalities found across today's DeFi applications such as borrow-lend and spot trading.

### Core Features

* **High Throughput**: Capable of processing up to 10,000 transactions per second (TPS).
* **Speed**: Latency will be competitive with leading platforms like Binance with soft-confirmations ranging between 3-5 milliseconds.
* **User Experience**: Seamless, one-click trading, eliminating the need for users to sign each transaction.
* **Capital Efficiency**: Supports trading with up to 50x leverage with multiple forms of collateral.
* **Proof of Reserves**: On-chain transparency of the funds held by the exchange smart contract at all times.&#x20;
* **Verifiability and transparency**: ZX blocks will be publicly available for full node access on Solana L1 and have a trustless verification and dispute process.
* **REST/Websocket API**: A developer experience on par with centralised venues.


# Role of $ZEX

The $ZEX token is the governance token of the Zeta Markets protocol, designed to strategically align the interests of our community with the protocol’s overarching goals. We are excited to expand the scope of $ZEX utility beyond governance and incentives (outlined in the token whitepaper [\[2\]](https://zeta-foundation.gitbook.io/zeta-foundation/whitepaper)) through ZX.&#x20;

$ZEX is designed to play a significant role in the ZX rollup infrastructure by facilitating transactions and serving as an incentive mechanism to reward stakeholders performing critical operations. These stakeholders include sequencers who order and produce blocks, full nodes that publish state commitments, and prover nodes that verify state transitions.

Beyond rollup infrastructure, we are envisioning further use cases of $ZEX on ZX by offering additional utility to long term stakeholders that stake $ZEX such as exclusive fee tiers.


# Why Solana?

Apart from ideological and strategic reasons, there are a couple key practical considerations behind our decision to build ZX as a Solana rollup.

### 1. Operational Costs

Solana’s low gas fees, compared to its competitors, significantly reduces the operational costs of our rollup infrastructure, making it the ideal network for an orderbook style DEX handling millions of transactions weekly. ZX requires batching and sending all rollup transactions to the L1 for data availability, a process that would be cost-prohibitive on other networks. Additionally, the rent paid for ephemeral accounts storing the data blobs for ZX blocks is fully reclaimable, ensuring that overall costs are kept low and tied directly to Solana’s affordable transaction fees.

### 2. Fast Block Times

The faster the block times, the quicker the rollup blocks can become finalized on the L1 (DA) and by extension, the finalization of a new logical rollup state. This means users are sooner able to access the latest state of the rollup, which is critical for higher quality UX. Also faster finality times (not block times)leads to faster forced transactions if the sequencer is censoring. For comparison, Solana block times are 400ms; 37.5 times faster than Ethereum’s 15 seconds.

### &#x20;3. Access to Capital

Solana boasts a thriving DeFi ecosystem, ranking fourth in total value locked (TVL) and second in DEX volumes across all chains. The ability for ZX to seamlessly access this liquidity and offer users an intuitive experience within the Solana ecosystem presents a distinct advantage.




---

[Next Page](/llms-full.txt/1)

