# About

#### What is VDEX?

VDEX is the global capital marketplace where you can trade anything, anywhere. For the first time, users can buy crypto, stocks, commodities, FX, and prediction markets all on the same platform.

#### Mission

Self-custody and privacy are inalienable human rights. These rights must be upheld without imposing costs or compromising experience. VDEX fulfills this vision by unifying the control of a DEX with the performance of a CEX:

<p align="center"><strong>An immutable dark pool with sub-millisecond finality and Zero Fees.</strong></p>

#### Core Contributors

[Virtual Labs](https://virtuallabs.xyz/) is a core contributor supporting the growth of VDEX.


# Technical Overview

VDEX is powered by VORTEX, a framework built on zero knowledge state channels. Transactions are self-validated and peer-to-peer, eliminating middle men and restoring power to users.

VORTEX segments capital into two layers:

* The **settlement layer** is a blockchain that locks and reassigns **escrow** according to **state**
* **ZK State Channels (ZKSC)** are primitives that let users reassign **escrow** rights through **state** transitions

Participants lock funds on a settlement layer, like Ethereum, and receive a balance state. This balance state can be exchanged for position states through the ZKSC. At any time, users may submit states onchain to trustlessly unlock funds.&#x20;

This architecture has distinct advantages:

* Privacy
* Full Self-Custody
* ZeroGas, ZeroFee transactions
* Sub-millisecond finality
* Unbounded TPS

Learn more in the [VDEX Whitepaper](https://vdex.trade/whitepaper).


# Core Features


# Traditional Markets

VDEX uses [0DTE Perpetual Futures](https://docs.virtuallabs.xyz/technology/primatives/0dte-perpetual-future) to support non-crypto trading pairs, such as stocks, indexes, commodities, and foreign currencies. Although these traditional markets close during evenings and weekends, VDEX empowers users to hold their positions continuously.

Users can trade traditional markets, such as $AAPL, $XAU, and $EUR with up to 50x leverage. Positions may be cross margined with crypto pairs and other traditional markets for seamless capital efficiency.

If VDEX does not currently offer a particular trading pair, you can request a listing on our [Telegram](https://t.me/vdextrade) or [Discord](https://discord.gg/vdex-trade). With sufficient interest, VDEX can list markets within 24 hours.


# Prediction Markets

[VERDICT Futures](https://docs.virtuallabs.xyz/technology/primatives/verdict-futures) enable VDEX to list prediction markets. Traders may use their unified margin balance for cryptocurrency, traditional markets, and prediction markets without transfers.


# No KYC, No VPN

VDEX is the only capital exchange that offers universal, anonymous access.

While CEX users contend with identity verification and DEX users face geoblocking, VDEX offers No KYC, No VPN everywhere and to everyone. This includes commonly restricted jurisdictions such as the United States, Türkiye, and the Russian Federation.

Begin trading in seconds regardless of who you are or where you live.


# Chain Abstraction

VDEX unifies fragmented liquidity through omnichain deposits. Collateral can be supplied on supported chains such as Ethereum, Solana, Arbitrum, Avalanche, and BSC without bridging. Funds arrive within seconds.

Collateral remains on the user's preferred chain until withdrawn, eliminating third-party blockchain risks. Users can also deposit from multiple chains into one VDEX account, unifying collateral into one margin or yield balance. Profit can be withdrawn on any chain.


# Darkpool

Assets on VDEX are exchanged through private, peer-to-peer ledgers called [zero knowledge state channels](https://docs.virtuallabs.xyz/technology/primatives/zero-knowledge-state-channel). Other market participants are unable to view these transactions. Significantly, TP/SL and liquidation prices are also private, preventing malicious participants from targeting individual users.


# Full Self-Custody

User escrow is held in [Virtual Vaults](https://docs.virtuallabs.xyz/technology/primatives/virtual-vault-core) onchain so that

1. Funds cannot be co-mingled by the exchange
2. Each user can audit a dedicated proof of reserve
3. Full Self-Custody of funds is preserved at all times

Pre-signed balance states are maintained by each user's [Virtual Node](https://docs.virtuallabs.xyz/technology/primatives/virtual-node) so that funds can be withdraw independently of VDEX and in spite of frontend outages.


# Sub-Millisecond Finality

VDEX transactions execute directly between market participants, not via a central hub. The elimination of middlemen accelerates trading speeds to the theoretical limit. The removal of wallet pop-ups and VPN requirements further hasten settlement time.

The finality benchmark assumes that participants are engaging in co-geographically located clients. Distance to counterparty will proportionally increase settlement latency. As network participation increases, VDEX's intelligent routing will match participants to minimize individual and overall execution time.

Compared against this benchmark, VDEX transactions settle 200x faster than Hyperliquid, 400x faster than Solana, and 12,000 faster than Ethereum. As compared to peer-to-peer direct settlement, excessive blockchain latencies persist in spite of efforts to centralize validator sets.


# Volatile Asset Collatera

VDEX enables the collateralization of Bitcoin and Ethereum at face value. [Volatile Asset Collateral](https://docs.virtuallabs.xyz/technology/primatives/volatile-asset-collateral) is not converted at deposit, allowing margin and yield accounts to reflect real-time changes to underlying asset value.

For example, a user deposits 1 Bitcoin when $BTC = $100,000, so they have $100,000 margin. If $BTC increases to $110,000, then margin updates proportionally to $110,000. Within margin accounts, this enables capital efficient funding arbitrage and delta-neutral hedging.


# Zero Fees

Fees, gas, and MEV derive from blockchain inefficiency, congestion, and surveillance. VDEX participants execute transactions with sub-millisecond finality, unbounded throughput, and private settlement.

* ZeroFee: VDEX charges zero trading fees on cryptocurrencies and traditional assets
* ZeroGas: Transactions settle on the user's device without third-party validation, relinquishing the need for gas payments
* MEVZero: Private settlement prevents frontrunning, sandwich attacks, and other exploitations of user trades


# Onboarding

Learn to trade on VDEX in four easy steps

{% tabs %}
{% tab title="Prerequisites" %}

1. An EVM wallet
   * If you do not have a supported wallet (e.g., Rabby, MetaMask, WalletConnect, Ledger), you can easily create one at <https://metamask.io/>.
   * After downloading the extension and creating a wallet, you must store your seed phrase in a private and secure location. If anyone else knows your seed phrase, they will be able to steal your funds.
2. Collateral
   * Supported assets such as USDT, USDC, WETH or WBTC
   * Gas tokens on a supported chain (ETH on Ethereum or Arbitrum, BNB on BSC, or AVAX on Avalanche)
     {% endtab %}

{% tab title="Step 1" %}

### **Connect a Wallet**

1. Open [VDEX](https://app.vdex.trade/)
2. Click **“Connect Wallet”** in the top-right corner
3. Select a supported wallet
4. Sign the connection request
   {% endtab %}

{% tab title="Step 2" %}

### Deposit Collateral

1. Click **“Deposit”**
2. Select a supported asset (e.g., USDT, USDC, WETH, WBTC)
3. Confirm **“Approve Funds”**

   <figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2Fxwua4tnHnn3imPJOU7YA%2Fimage.png?alt=media&amp;token=ea78316d-edf3-46b0-8cfe-becf8cc9d81e" alt=""><figcaption></figcaption></figure>
4. Confirm **“Deposit Funds”**

   <figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2FfnEuHDAwRJJWY7u45MTh%2Fimage.png?alt=media&amp;token=b948055a-7885-4ba1-8f05-bf16b70f3bf9" alt=""><figcaption></figcaption></figure>

&#x20;Your deposit will arrive within two minutes.

<mark style="color:$info;">Note: Depositing is a two-step process within your wallet. This is a blockchain feature.</mark>
{% endtab %}

{% tab title="Step 3" %}

### Start Trading

1. Below the VDEX logo, hover over the current trading pair (e.g. BTC-USD) and select your favorite asset&#x20;

   <figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2Fiaovp7cfAdIpIKvduebj%2Fimage.png?alt=media&amp;token=f9f2a77e-f961-49a7-ad04-1b68d0bb8cbf" alt=""><figcaption></figcaption></figure>
2. Select Buy or Sell and your leverage factor (e.g., 20x)

   <figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2FTXYOTqYUEqwjYWJvgeis%2Fimage.png?alt=media&amp;token=0d1f3d30-7520-4c49-b7da-c28a771d7c53" alt=""><figcaption></figcaption></figure>
3. Enter your position size and hit **“Place Order”**
4. Monitor and close your positions

   <figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2Fq3Jwq5BIhtmeJcmfFXDw%2Fimage.png?alt=media&amp;token=ed55bbae-2fa9-45e5-b3cd-fd695a4330f5" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Step 4" %}

### Withdraw Funds

1. Click **“Withdraw”** below the order creation screen
2. Select the asset, blockchain and amount and click **“Create Withdrawal Proof”**

   <figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2F4jdCEJ0c23qvsVoUMtey%2Fimage.png?alt=media&amp;token=4f956fb9-ef4a-43ea-98e0-c6e7988ed0d5" alt=""><figcaption></figcaption></figure>
3. After 24 hours, click **“Validating Withdrawal Proofs”** then **“Withdraw”**

   <figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2FN5PW9lvj1Xe2XC2jLNWw%2Fimage.png?alt=media&amp;token=7b602fa0-fc36-40ea-8549-bfb4a09a38b8" alt=""><figcaption></figcaption></figure>

<mark style="color:$info;">Note: To safeguard user funds during VDEX Beta, withdrawals are subject to a 24 hour delay.</mark>
{% endtab %}
{% endtabs %}


# Official Accounts

Join VDEX's only official [**Telegram**](https://t.me/VDEX_Community)**,** [**Discord**](https://discord.com/invite/vdex-trade)**, and** [**X (Twitter)**](https://x.com/0xVDEX)**.**

*


# Perpetual Futures

Perp contracts never expire and can be opened with fractional margin, supporting leveraged trading.

VDEX supports perps on cryptocurrencies, stocks, commodities, FX, and prediction markets. Assets are listed by community request with leverage ranging from 1x to 50x.

Perpetuals function differently depending on the asset class:

* [VRC-12](https://docs.virtuallabs.xyz/technology/primatives/perpetual-future): crypto perps never expire or close
* [VRC-13](https://docs.virtuallabs.xyz/technology/primatives/0dte-perpetual-future): traditional asset perps are only tradable while spot markets are open but never expire
* [VRC-14](https://docs.virtuallabs.xyz/technology/primatives/verdict-futures): prediction markets resolve and close at 1 or 0 per the spot market


# Contract Specifications

Perps mirror spot prices and denomination (the perp contract and the spot asset have similar values). Convergence is tethered through peer-to-peer hourly funding.

Perps are quoted against USDT. The margin required to open a contract is determined by the leverage factor. The collateral required to maintain the position is half of the initial margin fraction at maximum leverage.

<table><thead><tr><th width="148.76953125">Symbol</th><th>Tick Size</th><th>Leverage</th><th>Initial Margin Fraction (IMF)</th><th>Maintenance Margin Fraction</th></tr></thead><tbody><tr><td>BTC</td><td>0.1</td><td>50x</td><td>2%</td><td>1%</td></tr><tr><td>XAU</td><td>0.1</td><td>50x</td><td>2%</td><td>1%</td></tr><tr><td>ETH</td><td>0.1</td><td>40x</td><td>2.5%</td><td>1.25%</td></tr><tr><td>SOL</td><td>0.01</td><td>40x</td><td>2.5%</td><td>1.25%</td></tr><tr><td>XRP</td><td>0.0001</td><td>40x</td><td>2.5%</td><td>1.25%</td></tr><tr><td>MSTR</td><td>0.1</td><td>40x</td><td>2.5%</td><td>1.25%</td></tr><tr><td>AVAX</td><td>0.001</td><td>20x</td><td>5%</td><td>2.5%</td></tr><tr><td>TRY</td><td>0.00001</td><td>20x</td><td>5%</td><td>2.5%</td></tr><tr><td>LINK</td><td>0.01</td><td>20x</td><td>5%</td><td>2.5%</td></tr><tr><td>BNB</td><td>0.1</td><td>20x</td><td>5%</td><td>2.5%</td></tr><tr><td>HYPE</td><td>0.001</td><td>20x</td><td>5%</td><td>2.5%</td></tr><tr><td>SUI</td><td>0.0001</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>CRO</td><td>0.00001</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>PENGU</td><td>0.000001</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>DOGE</td><td>0.00001</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>1000PEPE</td><td>0.000001</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>ZEC</td><td>0.01</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>AAVE</td><td>0.01</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>FARTCOIN</td><td>0.0001</td><td>10x</td><td>10%</td><td>5%</td></tr><tr><td>WLFI</td><td>0.00001</td><td>5x</td><td>20%</td><td>10%</td></tr><tr><td>ASTER</td><td>0.0001</td><td>3x</td><td>33.3%</td><td>16.7%</td></tr><tr><td>MON</td><td>0.000001</td><td>3x</td><td>33.3%</td><td>16.7%</td></tr></tbody></table>


# Fees

VDEX does not charge trading fees on cryptocurrencies or traditional markets. The VORTEX network similarly does not charge gas fees. VERDICT Futures have a 2.5% fee.

The liquidation engine collects a fee based on 1% of the notional value of the position if a user's equity falls below the maintenance margin. Withdrawals are subject to a $3 fee.


# Order Book

VDEX operates a central limit order book with bids and asks sorted by price. Orders can be placed in integer multiples of the [asset tick size](/trading/contract-specifications). Orders are matched in price-time priority.

The clearing house verifies margin during order creation and matching. If margin is insufficient to cover the full order, it will be reduced until a partial match can be executed.

VDEX orders execute peer-to-peer via [Virtual Rollups](https://docs.virtuallabs.xyz/technology/primatives/virtual-rollup), not through a centralized backend or blockchain. Transactions are not batched and are executed in the order received. This prevents MEV attack vectors whereby orders are placed and processed jointly.


# Order Types

* Market: An order that executes immediately against the order book
* Limit: An order that rests and fills at the specified price or better&#x20;
* Stop Market: A market order that is triggered when a specified price is met or exceeded. The type used in take profit and stop loss orders (TP/SL)
* TWAP: Time-Weighted Average Price orders spread out market buys every 30 seconds until the user's selected time period has elapsed


# Margin

Margin is the collateral required to open perp contracts.

#### Margin Mode

By default, positions are cross margined and access account equity. In cross margin mode, unrealized PnL is available as initial margin for new positions.

Users can select isolated margin for precise control. Unrealized PnL in isolated positions is used as additional margin for the open contract. At any time, margin can be added or removed from isolated positions within the bounds of the initial margin and account equity. Isolated margin liquidations do not affect other positions.

#### Margin Requirements

Leverage can be set by a user between 1 and the max leverage. Max leverage [depends on the asset](/trading/contract-specifications). The leverage of an existing position can be increased without closing the position, decreasing the initial margin requirement (IMR).

The margin required to open a position or create an order is the dollarized position size divided by the leverage. Margin supporting open orders cannot be withdrawn.

Positions will be liquidated when isolated margin or account equity is less than the maintenance margin requirement (MMR). &#x20;

#### Supported Collateral

Account equity is the sum of collateral value, PnL, and net funding. Users can add margin by depositing supported collateral, including USDC, USDT, WETH, and WBTC. All collateral adds margin at face value. [Volatile Asset Collateral](https://docs.virtuallabs.xyz/technology/primatives/volatile-asset-collateral), such as WETH and WBTC, is dynamic according to the mark price.

For example, a user deposits 1 Bitcoin when $BTC = $100,000, so they have $100,000 margin. If $BTC increases to $110,000, then margin updates proportionally to $110,000. Within margin accounts, this enables capital efficient funding arbitrage and delta-neutral hedging.

In cases of profit and positive yield, USD-denominated state is added. In cases of loss, USD-denominated state is subtracted, but the underlying VAC is not converted until withdrawal or liquidation. This means that if losses are reversed, the principle VAC is untouched.

#### Formulas

<details>

<summary>Margin Requirements</summary>

**Variables**

* `s` = position size
* `p` = entry price
* `p'` = liquidation price

**Formulas**

`Initial Margin Fraction (IMF) = 1/leverage`\
`Maintenance Margin Fraction (MMF) = IMF(max_leverage)/2`

`Initial Margin Requirement (IMR) = |s| * p * IMF`\
`Isolated Maintenance Margin Requirement (MMR) = |s| * p * MMF`

`MMR for Other Positions (MMR_o) = ∑(|s| * p * MMF)`\
`Cross Maintenance Margin Requirement = MMR_o + |s| * p' * MMF`

</details>


# Trading Credits

Trading credits are non-withdrawable margin that allows traders to increase their buying power and start risk-free trading after principal loss. Trading credits are awarded based on deposit and volume milestones as well as to new traders to experience the platform. Realized profits generated from trading credits may be withdrawn like regular funds.

#### Mechanics

VDEX is unique among perpetual exchanges by supporting trading credits. This is because attackers can create multiple accounts and extract risk-free profit without KYC or identity-level controls. To support trading credits at all, the VDEX design must differ from centralized exchanges.

First, in the event of losses, user equity is deducted before credits. This prevents one attacker from using two accounts to create opposite positions and secure risk-free profit.

Second, if an account holds trading credits and has made no net deposits during the profit-generating period, profit withdrawals are capped at 50% of the trading credit balance. Once this limit is reached, all remaining trading credits and any associated profits will expire and be reset to zero. This only affects traders who were given credits to test the platform—and therefore should not be able to earn uncapped gains—and does not impact real, active traders who received credits as a deposit matching bonus.&#x20;

Third, trades made using trading credits only are not eligible for referral rewards. This prevents risk-free revenue share collection.

Trading credits expire after 30 days of inactivity.

VDEX reserves the right, at its sole discretion, to revoke trading credits if any unusual, suspicious, or abusive activity is detected. Exploiters that use trading credits to hold delta-neutral positions to consume trading credits will be permanently banned.

#### Frequently Asked Questions

#### FAQs

**1. Are trading credits withdrawable?**

No. Trading credits are non-withdrawable and can only be used as margin for trading.

**2. Are profits generated using trading credits withdrawable?**

Yes. All realized profits are fully withdrawable.

Even if trading credits were previously drawn down, any funds recovered after the drawdown may still be withdrawn.

**3. If I withdraw my principal, will trading credits remain in my account?**

No. Under the deposit matching program, trading credits are revoked once a principal withdrawal is requested.

**4. In the event of losses, which balance is deducted first?**

Deposited funds (cash balance) are deducted first. Trading credits are only used after user equity is exhausted.

**5. When are trading credits revoked?**

Trading credits are revoked immediately when a withdrawal request for principal funds is submitted.

**6. Can I deposit $200 / $500 in multiple transactions in deposit matching program?**

Yes. Trading credits are issued once your **total cumulative deposits** reach the required threshold.

**7. If I lose my deposited funds due to trading losses, will my trading credits be revoked?**

No. Trading credits remain active even if deposited funds are fully lost.

**8. If I lose both my deposits and trading credits, and deposit again later, do I need to repay the trading credits?**

No. Trading credits do not create debt and do not need to be repaid.

**9. If I lose trading credits and later earn referral rewards, do I need to repay the trading credits?**

No. Referral rewards do not offset or repay previously used trading credits.

**10. Do trading credits expire?**

Yes. Trading credits expire after **30 days of inactivity** and may be revoked if unusual activity is detected, profits exceed the issued credit amount, or a principal withdrawal is requested under the deposit matching program.


# Deposit Matching

VDEX is trialing a deposit matching program. Traders with qualifying deposit amounts receive bonus trading credits.

* $200 Net Deposit → $100 Trading Credits
* $500 Net Deposit → $200 Trading Credits

Trading credits remain in the account until a withdrawal lowers the net deposit below the qualifying amount. Here are some examples for a trader who deposited $500:

1. The trader loses $100 without a withdrawal, bringing equity to $400. Trading credits are not revoked.
2. The trader profits $100 and withdraws $100, bringing equity back to $500. Trading credits are not revoked.
3. The trader profits $100 and withdraws $200, bringing equity to $400. Trading credits are revoked.


# Liquidations

The VDEX liquidation engine will close positions once account equity falls below the maintenance margin. The maintenance margin is half of the initial margin at maximum leverage. A detailed list can be found in [contract specifications](/trading/contract-specifications).

If account equity or isolated margin falls below the maintenance margin, the liquidation engine executes a market order to close the full position. During liquidations, any remaining collateral remains with the trader. VDEX does not charge clearance fees.

Backstop liquidations occur if equity falls below two-thirds of the maintenance margin before successful liquidation. During backstop liquidations, the Virtual Market Maker acquires unliquidated positions and remaining margin. This ensures that VDEX remains solvent when volatility and clustered liquidation prices cause liquidation cascades.

Within the margin mode that is backstop liquidated, the user ends up with zero account equity. Backstop liquidations in isolated margined positions do not affect other positions.&#x20;

Liquidations are based on the mark price, which combines the VDEX order book with external exchanges for maximum stability. During times of high volatility, the mark price may diverge significantly from the VDEX order book. Users may observe the trading chart, reflecting the last price, exceed liquidation prices without liquidation and vice versa.

#### Risk Management

To avoid liquidations and backstop liquidations, traders are encouraged to set stop loss orders and actively monitor open positions. Higher leverage factors increase the risk of liquidation.

#### Partial Liquidations

For positions larger than $10,000, only 20% of the position will be liquidated at a time. If a position is partially liquidated twice within 30 seconds, the entire position will be closed and equity is retained by the user.

#### Account Liquidations

VDEX uniquely supports [Volatile Asset Collateral (VAC)](https://docs.virtuallabs.xyz/technology/primatives/volatile-asset-collateral) at face value for account margining. VAC is denominated in their original form without swapping.

> For example, a user deposits 1 Bitcoin when $BTC = $100,000, so they have $100,000 margin. If $BTC increases to $110,000, then margin updates proportionally to $110,000.

To support maximum flexibility—including delta-neutral hedging and funding arbitrage—PnL is denominated in USD and losses are not immediately deducted from VAC.&#x20;

> Consider that the user accumulates losses of $11,000. Collateral is stored as (1 BTC, -11,000 USD). If the user withdraws immediately, 0.1 BTC is swapped for 11,000 USD, releasing 0.9 BTC. However, if $11,000 was regained through trading or stablecoin deposits, collateral becomes (1 BTC) not (0.9 BTC, 11,000 USD).

This introduces the possibility that VAC value may fall below USD-denominated losses. Account liquidations trigger automatic swapping from VAC to USD once account equity falls below this threshold.

> VDEX executes an account liquidation if 1.1\*losses > VAC or when BTC declines from $110,000 to $12,100.

#### Formulas

<details>

<summary>Liquidation Price</summary>

**Variables**

* `e` = account equity
* `s` = position size
* `p` = entry price
* `MMF` = maintenance margin fraction
* `MMR_o`  = MMR for other positions &#x20;
* `p'` = liquidation price

**Formulas**

`Isolated Liquidation Price p' = (e - s * p) / (|s| * MMF - s)`

`Cross Liquiation Price p' = (e - s * p - MMR_o) / (|s| * MMF - s)`

</details>

<details>

<summary>Example</summary>

* A user deposits `$1,000 (e = 1000)`
* The user shorts `1.5 XAU (s = -1.5) at $3,000 (p = 3000)` and longs  `10 SOL at $175` &#x20;
  * `XAU MMF = 0.01`
  * `SOL MMF = 0.025`
* `MMR_o = 10 * 175 * 0.025 = 43.75` &#x20;
* `p' = (1000 - (-1.5 * 3000) - 43.75) / (1.5 * 0.01 + 1.5) = 3601.49`
* The liquidation price of the XAU position is `$3,601.49`

</details>


# Funding

Unlike other derivatives, perpetual futures never expire. To tether the price of the perp to the spot asset, traders pay hourly funding based on the deviation.

The payment amount is determined by the funding rate. If the perp price is higher than the spot price, then the funding rate is positive and longs pay shorts; if the perp price is lower than the spot price, then the funding rate is negative and shorts pay longs. Significant deviations in either direction cause proportionally higher funding rates.&#x20;

Funding is entirely peer-to-peer, VDEX does not charge a funding fee.

#### Formulas

<details>

<summary>Funding Rate</summary>

**Variables**

* `pOracle` = spot price
* `pImpact` = order book impact price
* `s` = position size
* `d` = premium deviation

**Formulas**

`d = (max(pImpactBid - pOracle, 0) - max(pOracle - pImpactAsk, 0))/pOracle`

`8-Hour Funding Rate (F) = dAverage + clamp (0.0001 - dAverage, -0.0005, 0.0005)`

`Funding Payment = s * pOracle * F`

**Methodology**

The deviation between the perp price and spot price is measured through *d*. This is done through the impact and oracle prices respectively. The impact price is like the mid price, but incorporates order book depth.

*d* is sampled every 5 seconds and averaged over the hour, creating *dAverage*. This value represents the relative difference between the perp price and spot price, so a *dAverage* of -0.01 means the perp trades 1% below spot.

The funding rate tracks *dAverage* while filtering out small deviations. The clamp applies an interest rate of **0.0001** and bounds of **±0.0005**, producing a baseline funding rate of **0.01%** when **dAverage** remains within **±0.05%**. The interest rate represents the difference in cost to borrow USD versus spot crypto, defaulting to longs paying shorts. The clamp ensures that the funding rate is predictable and stable under normal market conditions.

Due to precedent, the 8-hour funding rate is calculated. However, funding is paid and displayed hourly. The results in a baseline rate of 0.00125%.

<figure><picture><source srcset="/files/Fu71251Cw5yWo8FaTcFo" media="(prefers-color-scheme: dark)"><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2FFWUOsUFapnJU3GcM6ZQC%2Fimage.png?alt=media&amp;token=7595e982-c359-4df1-91d4-836c634f3038" alt=""></picture><figcaption></figcaption></figure>

</details>

<details>

<summary>Example</summary>

* The interest rate is 0.01%
* The spot price of XAU is $3,000
* The impact price of the perpetual is $2,985; 0.5% below spot

1. Calculate the premium deviation, *dAverage*

   `d = (max(pImpactBid - pOracle, 0) - max(pOracle - pImpactAsk, 0))/pOracle`

   `d = (max(2985 - 3000, 0) - max(3000 - 2985, 0))/3000`

   `d = (0 - 15)/3000 = -0.5%`

   $$d\_{\text{Average}} = \frac{1}{720} \sum\_{i=1}^{720} d\_i$$, sampled every 5 seconds
2. Calculate the clamped difference

   `clamped difference = min(max(0.01% - dAverage, -0.05%), 0.05%)`

   `clamped difference = min(max(0.01% - (-0.5%), -0.05%), 0.05%)`

   `clamped difference = min(max(0.51%, -0.05%), 0.05%)`

   `clamped difference = min(0.51%, 0.05%) = 0.05%`
3. Calculate the Funding Rate, *f*

   `8-Hour Funding Rate (F) = dAverage + clamp (0.01% - dAverage, -0.05%, 0.05%)`

   `8-Hour Funding Rate (F) = -0.5% + 0.05%`

   `8-Hour Funding Rate (F) = -0.45%`

   `1-Hour Funding Rate  = -0.05625%`

</details>


# Price Architecture

Pricing an asset is subtly complex. VDEX measures the price of perpetuals through robust price indices and displays cosmetic values for client-side monitoring. &#x20;

#### Robust Price Indices

VDEX utilizes various price types to minimize the risk of market manipulation.

*pOracle:* the oracle price is an external data feed used in calculating the funding rate and in *pMark.* The data source depends on the asset class.

* Crypto - Binance, updates every second
* Stocks, Commodities, and Foreign Exchange - TwelveData, updates every five seconds
* Prediction Markets - Seda, updates every 200ms

*pMark:* the mark price is designed to be a fair approximation of the perp price. It is used in calculating unrealized PnL and margin requirements, as well as for TP/SL and liquidation triggers. *pMark* updates every second and is the median value of:

* *pOracle* plus a 150 second exponential moving average (EMA) of the difference between *pMid* and *pOracle*
* The median of the best bid, best ask, and *pLast* on VDEX
* *pOracle*

*pImpact*: the impact price measures market depth at *pMid*. Bid and ask orders of size *$1,000* are simulated against the order book. The median of the average execution prices is *pImpact. pImpact* is used exclusively in calculating the funding rate.

*pMid*: the mid price is the average price between the best bid price and best ask price. *pMid* is used in calculating *pMark*.

*pLast*: the last price is the most recent price at which an order was executed. *pLast* is used in calculating *pMark,* appears in the token dashboard, and appears on trading charts.

#### Display Prices

The protocol's fundamental state is based solely on margin. The following prices are inferred from margin and displayed for convenient monitoring:

* Entry price is updated to the average of the former entry price and successive trade prices, weighted by size
* Exit price is the executed price of an order.
* Expected price is the simulated execution price based on position size and the current state of the order book
* Unrealized PnL is the difference between entry price and *pMark*, scaled by position size
* Realized PnL measures the absolute change in margin from a position. It excludes funding payments and fees.
* Liquidation price reflects the point at which account equity falls below the maintenance margin requirement

#### Formulas

<details>

<summary>Exponential Moving Average</summary>

The exponential moving average (EMA) is calculated using the following method. Let `sample` be the new data point, and let `t` be the time (in minutes) since the last update.

The EMA is defined as:

`ema = numerator_new / denominator_new`

`numerator_new -> numerator_prev * exp(-t / 2.5) + sample * t`

`denominator_new -> denominator_prev * exp(-t / 2.5) + t`

This formulation applies a **decay factor over a 2.5-minute window**, giving more weight to recent values while smoothing out short-term noise.

</details>


# API

## X-API-Key Authentication Guide

### Overview

vDEX supports two authentication methods for accessing protected endpoints:

1. **Bearer Token (JWT)** - For client-side applications (web, mobile)
2. **X-API-Key** - For server-side applications (trading bots, automated systems)

This guide focuses on **X-API-Key** authentication for server-to-server communication.

### Getting Your API Key

Your API key is automatically generated when you first log in to the platform. To retrieve it:

1. [Contact our support team](https://t.me/VDEX_Community)
2. Provide your wallet address for verification
3. We'll send you your API key securely

Self-custodial API key generation is coming soon.

### API Key Format

```
vdex_<64-hexadecimal-characters>

Example:
vdex_f7e6d5c4b3a2918273645f5e4d3c2b1a0f9e8d7c6b5a4938271605f4e3d2c1b0

```

### How to Use

#### Basic Usage

Add the `X-API-Key` header to your HTTP requests:

```bash
curl -X GET <https://api.vdex.com/v1/user/balance> \\\\
  -H "X-API-Key: vdex_your_api_key_here"

```

### Available Endpoints

All authenticated endpoints support both Bearer token and X-API-Key authentication:

For complete API documentation, visit: <https://d3p6ozwmy1xgo4.cloudfront.net/index.html#/>

### Environment Variable Setup

#### .env File

```bash
# .env
VDEX_API_KEY=vdex_your_api_key_here
VDEX_BASE_URL=https://api.vdex.com/v1

```

#### Load in Your Application

**Node.js:**

```jsx
require('dotenv').config();
const apiKey = process.env.VDEX_API_KEY;

```

**Python:**

```python
from dotenv import load_dotenv
import os

load_dotenv()
api_key = os.getenv('VDEX_API_KEY')

```

**Go:**

```go
import "github.com/joho/godotenv"

godotenv.Load()
apiKey := os.Getenv("VDEX_API_KEY")

```

### Error Responses

#### Authentication Errors

```json
{
  "error": "missing authentication",
  "code": 401
}

```

**Solution:** Ensure `X-API-Key` header is present

```json
{
  "error": "invalid api key",
  "code": 401
}

```

**Solution:** Verify your API key is correct

```json
{
  "error": "invalid api key format",
  "code": 401
}

```

#### Placing an Order and Getting Balance (JavaScript/TypeScript)

Use your `X-API-Key` in the `X-API-Key` header. Examples below use Node 18+ native `fetch`.

```tsx
// setup.ts
import 'dotenv/config'

interface RequestHeaders {
  [key: string]: string
}

interface CreateLeverageOrderRequest {
  price: number
  leverage_type: 'cross' | 'isolated'
  quantity: number
  direction: 'buy' | 'sell'
  order_type: 'MarketOpen' | 'LimitOpen'
  expiration_time_in_min?: number
  base_asset_id: string
  initial_margin_asset_id: string
  initial_margin: number
  leverage: number
  take_profit_price?: number
  take_profit_amount?: number
  stop_loss_price?: number
  stop_loss_amount?: number
  is_mobile?: boolean
}

function getBaseUrl() {
  const baseUrl = process.env.VDEX_BASE_URL || '<https://api.vdex.com>'
  return baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl
}

function createHeaders({ apiKey }: { apiKey: string }): RequestHeaders {
  if (!apiKey || !apiKey.startsWith('vdex_')) throw new Error('Missing or invalid VDEX_API_KEY')
  return {
    'X-API-Key': apiKey,
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  }
}

async function httpJson<T>({ url, method, headers, body }: {
  url: string
  method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
  headers: RequestHeaders
  body?: unknown
}): Promise<T> {
  const res = await fetch(url, {
    method,
    headers,
    body: body ? JSON.stringify(body) : undefined
  })
  if (!res.ok) {
    const text = await res.text().catch(() => '')
    throw new Error(`HTTP ${res.status} ${res.statusText}${text ? `: ${text}` : ''}`)
  }
  return res.json() as Promise<T>
}

// GET /v2/users/balances
export async function getBalances(): Promise<unknown> {
  const baseUrl = getBaseUrl()
  const headers = createHeaders({ apiKey: process.env.VDEX_API_KEY as string })
  return httpJson({ url: `${baseUrl}/v2/users/balances`, method: 'GET', headers })
}

// POST /v2/orders
export async function placeOrder(order: CreateLeverageOrderRequest): Promise<unknown> {
  const baseUrl = getBaseUrl()
  const headers = createHeaders({ apiKey: process.env.VDEX_API_KEY as string })
  return httpJson({ url: `${baseUrl}/v2/orders`, method: 'POST', headers, body: order })
}

// Example usage
async function main() {
  const balances = await getBalances()
  console.log('balances', balances)

  const order: CreateLeverageOrderRequest = {
    price: 65000,
    leverage_type: 'cross',
    quantity: 0.01,
    direction: 'buy',
    order_type: 'LimitOpen',
    expiration_time_in_min: 60,
    base_asset_id: 'BTCUSD',
    initial_margin_asset_id: 'USDT',
    initial_margin: 100,
    leverage: 10,
    take_profit_price: 70000,
    stop_loss_price: 62000
  }

  const placed = await placeOrder(order)
  console.log('order', placed)
}

main().catch(err => {
  console.error(err)
  process.exit(1)
})

```

* Replace `base_asset_id`, `initial_margin_asset_id`, and other fields with valid values for your market. You can query supported pairs via `GET /v2/tokens/supported-pairs`.
* For market orders, set `order_type` to `MarketOpen` and omit `price`.

#### cURL quick examples

* Get balances:

```bash
curl -sS -X GET "$VDEX_BASE_URL/v2/users/balances" \\\\
  -H "X-API-Key: $VDEX_API_KEY" \\\\
  -H "Accept: application/json"

```

* Place order:

```bash
curl -sS -X POST "$VDEX_BASE_URL/v2/orders" \\\\
  -H "X-API-Key: $VDEX_API_KEY" \\\\
  -H "Content-Type: application/json" \\\\
  -d '{
    "price": 65000,
    "leverage_type": "cross",
    "quantity": 0.01,
    "direction": "buy",
    "order_type": "LimitOpen",
    "expiration_time_in_min": 60,
    "base_asset_id": "BTCUSD",
    "initial_margin_asset_id": "USDT",
    "initial_margin": 100,
    "leverage": 10,
    "take_profit_price": 70000,
    "stop_loss_price": 62000
  }'

```


# Beta

VDEXCore is presently in beta. This comes with additional limitations and protections for users. All withdrawals undergo a 24 hour dispute period even if they contain a finalized balance state. The protocol team retains the ability to upgrade settlement contracts in case of a discovered exploit. These two beta features enable the protocol team to monitor and prevent exploits before they occur.


# VPOINTs

The VDEX Points Program recognizes and rewards early contributors. Users will earn points based on trading, referrals, and LPing across the ecosystem. VDEX enables you to trade anything, anywhere, including crypto, stocks, commodities, FX, and prediction markets—all on the same platform.

An all-time leaderboard tracks total points while a weekly leaderboard shows real-time performance. This empowers long-time and new contributors to compete.

### How to Earn

Weekly performance is measured in XP. Traders can see their XP update immediately after creating a position. Liquidity providers earn XP every hour that their deposit is locked in the Virtual Market Maker.

Referrals are a large part of the reward system. Users earn 1 XP for every 4 XP earned by referred users. This applies to both trading volume and LP equity.

Every Wednesday at 12:00 NYC time, XP is distributed proportionally into 1,000,000 points. This means that lower overall XP results in a higher conversion to points. After claiming, XP resets for the next week. A small portion of points may be distributed for special events, bug bounties, and other open-source contributions.

Users rank into tiers based on their total points.

* **Shrimp:** >10 points
* **Clownfish:** >100 points
* **Swordfish:** >1,000 points
* **Hammerhead:** >10,000 points
* **Great White:** >100,000 points
* **Whale Shark:** >500,000 points

Points are your immutable proof of contribution. Leaderboards show competitive rankings. Tiers reflect long-term commitment. Points may be revoked for fraud, defamation, or other illicit activity, at the sole discretion of VDEX.

Check your points allocation here: [htttps://app.vdex.trade/points](https://app.vdex.trade/points)

### About VDEX

VDEX is the global capital marketplace where you can trade anything, anywhere. For the first time, users can buy crypto, stocks, commodities, FX, and prediction markets—all on the same platform.

We believe that self-custody and privacy are inalienable human rights. These rights must be upheld without imposing costs or compromising experience. VDEX fulfills this vision by unifying the control of a DEX with the performance of a CEX:

**An immutable dark pool with sub-millisecond finality and ZeroGas fees.**

VDEXs was founded by alumni from Yale University and Amazon and was incubated by Binance Labs and Gate Labs.


# Audit

VDEX smart contracts were audited by Halborn, a leading blockchain security firm.

* **Audit Type:** Smart Contract Audit
* **Auditor:** Halborn
* **Date of Engagement:** December 5–6, 2024
* **Last Updated:** March 5, 2025
* **Status: 100%** of all reported findings have been addressed.

**Click** [**here**](https://www.vdex.trade/audit) **to view the full audit report**


# Brand Kit

## LOGO

<figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2F2ThzqitppnpiVUX4hefw%2FVDEX_Logo_Only_ORIGINAL.png?alt=media&amp;token=dc74011d-8000-4f34-a271-f2faa5c550ee" alt=""><figcaption></figcaption></figure>

{% file src="/files/eaiZkYvqhCC0XzeWdqsQ" %}

{% file src="/files/5KJ3gHmgqgeECVZpdyu5" %}

{% file src="/files/aU65iZ8zIeLa0B4KUIs0" %}

{% file src="/files/RJPo1uHCkLIche6Rmt7H" %}

BRAND COLORS

<figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2F9vPhREJegQcJhUVWeXwF%2FBrand%20Guideline-2.jpg?alt=media&amp;token=a8013f42-1b06-4624-86f7-391ecf2b98fb" alt=""><figcaption><p>VDEX BRAND COLORS</p></figcaption></figure>

<figure><img src="https://4101695250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaqXFw9hEdwD1MWWRwfI%2Fuploads%2FATkYP9nS5uWW30XsgICD%2FBrand%20Guideline.jpg?alt=media&amp;token=378f54df-6d62-42d4-b928-4e1f61ef508f" alt=""><figcaption><p>VDEX FONT</p></figcaption></figure>

{% file src="/files/wvBPiFFAHltqgEeWsSUk" %}
COMPLETE BRAND KIT
{% endfile %}

{% file src="/files/Dwdh3dBQ0heP6Y4MpsIG" %}


