LogoLogo
Trade Now
  • Trade Now
  • 👋Welcome
    • About Demex
      • Roadmap
      • Terms and Conditions
      • Disclaimers
    • Getting Started
      • Depositing
      • Activate Account
      • One-Click Trading
  • 💰Demex Rewards
    • 🪂Demex Points
      • Spins
      • Wheel of Fortune and Loot Boxes
      • Squads
      • DMX Token
      • FAQs
    • 🏁Demex Endgame: 50,000,000 Demex Points
    • 💵Demex Credits
    • 🕙Past Events
      • 2022
        • Futures Trading Competition
          • Maker vs Taker #1
          • Maker vs Taker #2
        • Perpetuals Trading Competition
          • Top Gainers and Top Traders #1
          • Top Gainers and Top Traders #2
          • Top Gainers #3
      • 2023
        • Demex Trading Leagues
          • Demex Trading League
            • How to Register
          • Demex $100,000 Mega Marathon
            • Demex Trading League Vol 1
              • How to Register
            • Deposit Booster
            • Demex Trading League Vol 2
          • Demex Trading League (Round 3)
            • How to Register
          • Demex Trading League (Round 4)
          • LUNA Earn-A-Thon & Demex Trading League (Round 5)
          • Demex Trading League (Round 6)
          • SCRT Trading League
        • Earn-a-thons
          • Demex x StaFi ATOM Earn-A-Thon
          • Demex x Zilliqa ZIL Earn-A-Thon
            • How to Register
        • Trading Challenges
          • BNB Trading Challenge
            • How to generate your custom hashtag
          • NEO Trading Challenge
            • How to Register
          • OSMO Perp Trading Challenge
          • Perps Trading Challenge
        • Special Events
          • $500 Surprise Flash Promotion
          • Demex Incentivized Devnet (Ended)
            • Perp Pools Deposits
            • Base Vault and $CLP Staking
            • Fluo Dashboard (Deprecated)
              • Stake FLUO
              • Boost Rewards
              • esFLUO Rewards
            • Demex Trading League (Devnet)
              • How to Register
            • The HODL Lottery
              • How to Register
              • How to Count Your Tickets
      • 2024
        • Celestia Trading League
        • FOMO Points Booster
        • DeFi Points Booster
        • Celestia Points Booster
        • 🥛milkTIA x Demex Points Booster Bonanza
        • BTCETH Points Booster
        • 🟠 Archway Trading League
        • ⚛️ Cosmos Trading Competition
          • 🐋Whalecome to Demex
        • 💯DeFi & FOMO Points Booster
        • 💯DeFi & Layer 1 Points Booster
        • 💧dATOM Lend and Trade Spins Promo
        • 🐸Perp Pool Incentives with Leap Wallet
        • 👋Welcome #BackToDemex
        • 🥛milkTIA Lend and Trade Spins Promo
        • 🛡️Loss Protection
        • 🏃‍♂️STRD Lend and Trade Spins Promo
        • 🐶Meme Traders Arena
        • 🛡️Loss Protection Oct-Nov
        • 🌙LUNA Lend and Trade Spins Promo
        • 💯Modular Pool Points Booster
        • 🕰️Mantle Lend & Trade Spins Promo
        • 🏎️Mantle Trading League
        • 🛡️Loss Protection Dec 9 - 20
        • 👑Mantle Trading League S2
      • 2025
        • 🔲Mantle Rewards Station: 30,000,000 Demex Points
        • 🔲Mantle Rush
        • 🔐Loss Protection March 19 - 26, 2025
        • 🌀Mantle Lend & Trade Spins Promo
        • 💙Base Trading League
        • 🧢Base Lend & Trade Spins Promo
        • 🛡️Loss Protection Feb 10 - 20, 2025
        • 📝#DemexContentQuest
        • 📈#PerpsOnDemex
        • 👥Demex Referral Club
        • 🤖Traḋemex Bot
  • 📊Trade
    • Features
    • Perps & Futures
      • Pricing Engine
      • Margin Specifications
      • Liquidation Engine
      • Market Specifications
      • Pre-launch Perpetuals
      • Glossary
      • FAQs
    • Grouped USD Token
      • Constituent Criteria
      • Safety Features
      • Migration Guide
    • Fees
      • Trading Fees
      • Funding Fees
      • Network Fees
      • Deposit & Withdrawal Fees
      • Fee Delegation
      • CEX to Demex VIP Program
      • Fee Distribution
    • Notifications
      • Demex Progressive Web App (PWA)
    • Trading Modes
      • Lite Mode
      • Pro Mode
        • Features
        • Market Leverage
        • Order Types
        • Execution Options
        • Time-In-Force 🆕
        • Trigger (Stop) Orders
          • Take-Profit
          • Stop-Loss
        • Chart Trading 🆕
  • 💰EARN
    • Liquidity Pools
      • Spot Pools
        • Earnings
        • Amplified Pools
        • Uneven Pool Weights
        • Multi-Pool Routing
        • FAQs
      • Perp Pools
        • Earnings
        • Deposting & Redeeming
        • AMM Strategy
    • Nitron (Lend & Borrow)
      • Lending
      • Borrowing
        • Avoiding Liquidations
      • Liquidation
        • Partial Liquidations
      • USC Stablecoin
        • Interest Rate Model
      • High Efficiency Mode (E-Mode)
      • Liquidations
        • Liquidation Guide
      • Strategies
        • Using Nitron for Perp Trading
      • Protocol Safety Features
      • Risks
    • Referrals
      • Sharing Your Referral Link
      • FAQs
      • Terms and Conditions
  • Stake SWTH / DMX
  • 🫂COMMUNITY
    • Public Community Nodes
    • Feedback
    • Glossary
      • Annual Percentage Rate (APR)
      • Arbitrage
      • Decentralized Applications
      • Execution Options
      • Liquidation
      • Liquidity Pool
      • Liquidity Providers
      • Perpetual Pool
      • Open Interest (OI)
      • Order Book
      • Time-In-Force
      • Volume
      • Yield Farming
  • ⚙️Developers
    • APIs Overview
    • WebSocket API
    • RPC API
    • EVM API
    • Insights API
    • Node CLI
    • Running a Node
      • Testnet
      • Mainnet
      • Public API Node
      • Validators
        • Commissions & Penalties
  • 🤖EVM
    • Overview
    • Deployment Tutorial
    • Interacting with Demex L1
      • Built-in Oracle Contracts
      • Precompiled Trading Contracts
    • ICS-20 <> ERC-20 Token Conversion
    • Explorers
Powered by GitBook
On this page
  • Introduction
  • Oracles
  • Index Price
  • Mark Price
  • Fair Price Marking
  • Last Price Protected
  • Settlement
  • Settlement Price

Was this helpful?

  1. Trade
  2. Perps & Futures

Pricing Engine

PreviousPerps & FuturesNextMargin Specifications

Last updated 15 days ago

Was this helpful?

Introduction

Demex has a robust pricing engine to ensure markets have accurate and fair pricing for all market participants.

Oracles

Demex is built with an extremely fast, flexible and secure oracle protocol that is ran by the chain's validators. The oracles are able to submit price feeds and other real-world information with extremely high reliability and low latency. This is used to derive various fair prices of Demex's derivative markets.

Oracles act as intermediary components that link blockchains with real-world data. These services act as connectors between blockchains and the external world, allowing smart contracts to access data sources beyond their own networks.

Index Price

When oracle votes representing 67% of bonded tokens has been submitted for a specific timestamp, the median value of valid votes will be utilized to generate the Index Price for a market.

This typically happens within 1 second of any changes in the spot price.

Mark Price

The Mark Price is the price at which the futures contract is valued at when being traded. This can temporarily vary from the actual futures market price in order to protect market participants against manipulative trading. This can also vary from the underlying spot price due to time premiums ( or ) being applied on the derivative contract.

Fair Price Marking

The mark price of a market is determined by finding a fair price based on the current market's order book and ensuring that it does not deviate too quickly or too much from the index price.

More specifically, the following formula is used to determine each market's mark price:

MPRaw = IndexPrice + EMA30s(FairPrice - IndexPrice)
MarkPrice = clamp(IndexPrice * (100 - MPBand / 2)%, MPRaw, IndexPrice * (100 + MPBand / 2)%)

// MPBand is a market parameter (see GET markets: mark_price_band) denoted in integer basis points,
// EMA30s means 30-second exponential moving average,
// clamp(min, x, max) means min if x < min, or max if x > max, else x.

Fair price can be determined by the following formula:

1. If either the buy or sell order book has no orders:
FairPrice = IndexPrice

2. Otherwise:
ImpactBid = max[averagePrice(sell orders up to ImpactSize lots), BestBidPrice - ImpactBand]
ImpactAsk = min[averagePrice(buy orders up to ImpactSize lots), BestAskPrice + ImpactBand]
FairPrice = (ImpactBid + ImpactAsk) / 2

// ImpactSize is a market parameter (see GET markets: impact_size) denominated in base tokens (same as lot size)
// ImpactBand is a global market parameter (see GET market params: impact_band) denominated in integer basis points.

Last Price Protected

In the case that the oracle network is down or the index price cannot be updated for any other reason, the mark price formulation falls back to using the last traded price of the market.

Users can detect this change by monitoring the marking_strategy from the GET Prices endpoint. In normal fair price marking, the value will be fair. When falling back to last price marking, the value will be last.

MPRaw = clamp(LastPrice * (100 - LPPBand / 2)%, LastPrice, LastPrice * (100 + LPPBand / 2)%)
MarkPrice = clamp(EMA30(MarkPrice) * (100 - SmoothenBand / 2)%, MPRaw, EMA30(MarkPrice) * (100 - SmoothenBand + 2)%)

// LPPBand is a market parameter (see GET markets: last_price_protected_band) denoted in integer basis points
// SmoothenBand is a global market parameter (see GET market params: smoothen_band) denoted in integer basis points

Settlement

Futures on Demex are cash settled rather than settled by physical delivery. This means that at the settlement, the buyer of a futures contract will not buy the actual underlying, nor the seller will sell the underlying. There will only be a transfer of losses / gains at the settlement of the contract, based on the settlement price. Note that by nature, perpetual markets never settle.

Settlement Price

The last 30 minutes time-weighted average of the Index Price before each futures contract expiry time is used for market settlement. At contract expiration, all open positions will be closed and the PnL (based on the difference between the position's average opening price and this settlement price) will be automatically realized.

📊
contango
backwardation