OKX Derivative DEX FAQ

Published on Sep 1, 2023Updated on Apr 4, 20246 min read10

1. What's the main difference between OKX Perpetual DEX and centralized perpetual contracts?

The OKX Derivative DEX is a decentralized exchange built on the Ethereum Layer 2 network, featuring self-custody of funds. It employs Zero-Knowledge Proof (ZKP) technology to ensure user privacy and asset security. Currently, it supports the cross margin trading mode of the USDC-margined contracts, where all contracts share margins, offsetting gains and losses against each other, with settlement conducted in USDC.

2. What is a Layer 2 network? Why do perpetual contracts deploy on Layer 2 networks?

A Layer 2 network is a network architecture that operates on top of a Layer 1 network. It is typically used to increase the scalability, speed, and cost-efficiency of a given network. The OKX Derivative DEX integrates ZK-Rollups technology to ensure that transactions are settled on a Layer 2 network.
The Ethereum is limited to approximately 15 transactions per second, and transaction fees can become extremely high during peak times. The perpetual contract trading is high-frequency and real-time, and the higher TPS of the layer 2 network can bring better trading experience.

3. What is self-custody?

Self-custody allows individuals to manage digital currencies and assets independently, without depending on third-party custodians or intermediaries. Assets are transferred straight from the wallet to custody via smart contracts, without any involvement from centralized third parties.

4. What is ZK-Rollups?

ZK-Rollups, a blockchain scaling solution that utilizes Zero-Knowledge Proof (ZKP) technology, is essential in safeguarding data privacy on the User Chain. It offers high throughput, instantaneous finality (no need to worry about transactions being reversed), self-custody, and transaction strategy privacy.

5. What is transaction authorization? Why do I need two-step transaction authorization?

Transaction authorization is to generate Snark Key and API Key on Layer2. Users need to perform EIP712 signature authorization twice to ensure the normal operation of the subsequent on-chain transaction process.

6. What is Fast Withdrawal?

Fast withdrawal funds are sent directly from the liquidity pool, and the execution time of the layer 2 network is approximately 20 minutes. A 0.1% fee will be applied to cover the liquidity interest of the liquidity pool and the network fee for sending transactions.

7. Why is a two-step process necessary for normal withdrawal?

In order to withdraw assets from the Layer 2 network, users first need to submit a withdrawal request for verification. Once the verification is completed, the user can manually request the withdrawal of assets on the main network.

8. Why does a normal withdrawal take 12 hours?

When making normal withdrawal, Layer2 submits the ZK certificate to the mainnet, and verified by the mainnet contract, which takes about 12 hours.

9. Why did my withdrawal fail?

There are 2 reasons that may affect your withdrawal:

  • Insufficient account balance
  • On-chain transaction failed
    For a normal withdrawal, it is recommended to increase the network fee in order to ensure the success of the transaction, as the second step of the chain failure needs to bear the network fee.
    In Fast Withdrawal mode, there will be no fees assessed for failed transactions.

10. What is the maximum leverage of DEX perpetual contract?

Mainstream cryptos (BTC and ETH) support up to 20x leverage, while other cryptos (such as SOL) support up to 10x leverage.

11. Can I select "Take Profit", "Stop Loss" and "Reduce Only" at the same time?

Reduce Only Orders are the default for both TP/SL orders and Position TP/SL orders, meaning that no additional selections are necessary.

12. Why did my orders get cancelled?

  • When the account risk factor is high/the margin rate is low, the system will automatically cancel the order to reduce the risk;
  • When the corresponding positioning disappears, TP/SL order will also be cancelled;
  • When Reduce-only orders become open orders, they may be changed or cancelled.

13. How to calculate the profit of trading?

Profit from Long Position = Contract Size * |Number of Contracts| * Multiplier * (Mark Price - Average Entry Price)
Profit from Short Position = Contract Size * |Number of Contracts| * Multiplier * (Average Entry Price - Mark Price)

14. How do I calculate the DEX Perpetual contract margin? In Cross mode, all available assets in the user's account are considered as available margin.

Initial margin = Contract Size * |Number of Contracts| * Mark Price / Leverage. The initial margin will vary depending on the price of the trading currency.
Available margin = Asset Balance - Order IMR Occupied - Position IMR Occupied - Total Order Fees
Margin ratio = (Cross Margin Balance + Cross Margin UPL - All Maker Fees) / (Maintenance Margin + Pre-liquidation Fees)

15. What is the effective mechanism of DEX perpetual contracts?

  • Post Only (Only Maker): When placing a limited order, if you select Post Only, your order will only be in the form of a Maker order and will not match the order already in the order book.
  • GTC (Good till cancelled): All orders are selected GTC, by default. That is, if the user or system does not cancel, the order will always be in the order state.
  • FOK (Fill or Kill): If the counterparty order can't fill all of your orders, the system will cancel the order based on the depth of the current trading pool.
  • IOC (Immediate or cancel): Upon placing an order, the system will detect the current depth and attempt to trade the order with a counterparty order that is available in the current depth. Any remaining part of the order that can't be traded will be immediately cancelled.

16. Why is it changed to the limit order when the buying price is too high?

Limits are instrumental in safeguarding investors from being victims of market manipulation. Without such regulations, there may be a tiny number of traders who can take advantage of their small amount of assets and high leverage multiples to cause drastic price fluctuations in contracts.

17. Why are there some TP/SL orders reach the trigger price and not be triggered?

  • When the current TP/SL order is attached, once the current order is fully filled, the TP/SL order will be triggered.
  • If the user selects the Mark Price as the Trigger Price, it is possible that the latest Market Price will not activate the order.