· 14 min read

What Is Perpetual Trading? Perpetual Futures and Perp DEXs Explained

Perpetual trading is trading perpetual futures: contracts that track the price of an asset like bitcoin, can be used with leverage and never expire. Instead of an expiry date, longs and shorts pay each other a funding rate that keeps the contract close to the real price. Below: how perps work in plain English, how perp DEXs are built, and what US rules look like as of October 2026.
A price chart with an infinity loop, long and short arrows and a funding payment between them, illustrating what perpetual trading is
Planning a perp DEX or derivatives product?Tell us the markets, the chain and who your users are. We’ll help you map the architecture, the risk engine and the audit path.
Discuss my perp DEX

What is perpetual trading?

A futures contract is an agreement to buy or sell an asset at a set price on a future date. Traders use futures to bet on price moves without holding the asset, often with borrowed exposure called leverage.

A perpetual future, or "perp", is a futures contract with no expiry date. You can hold a long (betting the price goes up) or a short (betting it goes down) for as long as your margin holds out. Perps were popularized by crypto exchanges and are now a core product on most of them.

The trick is how a contract that never settles stays close to the real price. A regular future converges to spot at expiry. A perp uses a recurring payment between longs and shorts, the funding rate, to pull its price toward the spot index.

Spot tradingDated futuresPerpetual futures
You own the assetYesNoNo
ExpiryNoneFixed date, then settle or rollNone
What keeps the price in lineIt is the priceConvergence at expiryPeriodic funding payments
LeverageOnly with a margin loanYes, set by the exchangeYes, set by the exchange or protocol
Can go short easilyNot without borrowingYesYes

How perpetual futures work: margin, leverage and liquidation

Four terms explain almost everything a perp trader experiences.

  • Margin is the collateral a trader posts, usually a stablecoin such as USDC. Initial margin is what you need to open a position. Maintenance margin is the minimum you must keep to stay open.
  • Leverage is position size divided by margin. $2,000 of margin controlling a $20,000 position is 10x.
  • Liquidation is the forced closing of a position when equity (margin plus unrealized profit or loss) falls below maintenance margin.
  • Index price is the reference spot price, built from several spot exchanges. Mark price is the venue's estimate of the contract's fair value, used for profit and loss and for liquidations, so one odd trade can't wipe traders out.

A worked leverage example

The numbers below are illustrative and ignore fees and funding. A trader posts $2,000 and opens a 10x long: $20,000 of exposure, or 0.2 BTC at $100,000.

BTC mark priceMoveProfit or lossEquity leftWhat happens
$105,000+5%+$1,000$3,000Margin grows by 50%
$95,000−5%−$1,000$1,000Half the margin is gone
$92,500−7.5%−$1,500$500Equity hits a 2.5% maintenance margin ($500): liquidation

A 7.5% move, which bitcoin can make in a day, is enough to close this position. That is why perp venues spend so much engineering on how and when liquidations happen. Maintenance levels vary by venue and asset. Hyperliquid's documentation, for example, sets maintenance margin at half the initial margin at the market's maximum leverage: 1.25% for a market capped at 40x, and higher for markets with lower leverage caps.

The funding rate, explained with an example

Funding is a payment between traders, not a fee to the exchange. It is usually calculated from the premium, the gap between the perp price and the index, sometimes plus a small fixed interest component.

  • Perp above the index (more eager longs): funding is positive and longs pay shorts. That makes holding longs more expensive and pulls the price down.
  • Perp below the index (more eager shorts): funding is negative and shorts pay longs.
How the funding rate pulls a perp back toward spot Spot exchanges BTC prices Oracle / index price e.g. $100,000 Perp market price order book or oracle Perp above index: funding positive Longs Shorts Holding longs costs more, so the perp drifts down Perp below index: funding negative Longs Shorts Holding shorts costs more, so the perp drifts up pay funding pay funding The venue compares the perp price with the index every few seconds and settles funding on a schedule, often hourly.
Funding moves money between traders. The exchange or protocol only calculates and settles it.

Worked funding example

Say BTC perps trade a little above the index and the funding rate is +0.01% per hour (an illustrative number). A trader holding a $20,000 long pays $2 per hour, or $48 a day, to shorts. A trader with a $20,000 short receives the same $48. If the rate turns to −0.01%, the flow reverses.

Schedules and formulas differ by venue. According to Hyperliquid's documentation, funding is paid hourly, is computed from the premium averaged over the hour plus a clamped interest component based on 0.01% per 8 hours, and is capped at 4% per hour. dYdX's documentation also describes hourly funding based on the average premium over the previous hour. For a long-term holder, funding can cost more than trading fees, so good trading apps show it clearly before a trade.

CEX perps vs perp DEXs

Perps trade on centralized exchanges (CEXs) and on decentralized exchanges (DEXs). The contract logic is similar. Who holds the money and who can change the rules is not.

Centralized exchange perpsPerp DEX
CustodyThe exchange holds customer fundsUsers keep keys; funds sit in contracts or chain state
Matching and marginPrivate serversSmart contracts or a purpose-built chain, publicly verifiable
Account openingKYC and onboarding by the exchangeConnect a wallet; screening depends on the front end
TransparencyPositions and reserves visible only to the operatorPositions, liquidations and funding visible on-chain
Main risksOperator failure, frozen withdrawalsSmart contract bugs, oracle manipulation, governance and key risk
SpeedVery fast, central matchingDepends on design; order book chains get close to CEX speed

Perp DEX explained: the main designs

Every perp DEX answers one question differently: who is on the other side of the trade, and where does the price come from? Three designs dominate. The descriptions below come from each project's own documentation as of October 2026.

  • Example: Hyperliquid. Its HyperCore layer keeps the order book, margin and matching state as part of its own blockchain, secured by HyperBFT consensus, without an off-chain order book.
  • Counterparty: other traders and market makers, through a central limit order book.
  • Prices: validators publish an oracle price about every three seconds, a weighted median of centralized exchange prices. The mark price combines that oracle with Hyperliquid's own book and other venues' perp prices.
  • Trade-off: CEX-like experience, but you are building and running a blockchain, which is a very large undertaking.

Most new teams that want their own perp product start with a pool-based or hybrid design on an existing chain. Building an order book chain is a multi-year infrastructure project. For a broader look at DeFi build models, see our guide on how to build a DeFi app.

Key components of a perp DEX

The trading screen is the visible 10%. The engine underneath is what decides whether the protocol survives a 20% candle.

ComponentWhat it doesWhat goes wrong if it's weak
Matching or executionFills orders: order book matching, or oracle-priced execution against a poolBad fills, front-running, stuck orders
Margin engineTracks collateral, positions, leverage limits, cross and isolated marginUnder-collateralized accounts, bad debt
Oracles and mark priceBrings in the index price and computes a fair mark priceManipulated prices, unfair liquidations
Liquidation engineCloses positions below maintenance margin, often through keeper botsLate liquidations turn into losses for the protocol
Insurance fund or backstopAbsorbs losses when a liquidation closes below zero equityLosses fall on profitable traders or liquidity providers
Funding moduleComputes and settles funding on scheduleThe perp drifts far from spot
Risk parameters and governanceLeverage caps, open interest caps, market listings, who can change themOne thin market drains the whole protocol
Indexer, API and front endCharts, positions, history, alerts, wallet connectionUsers can't see risk until they are liquidated

The main risks of perp DEXs

  • Oracle manipulation. If an attacker can move the price the protocol reads, they can inflate their collateral and borrow or withdraw against it. In January 2023 the CFTC charged a trader with what it called an "oracle manipulation" scheme that allegedly took over $110 million from Mango Markets, a decentralized exchange. Thin markets with low-liquidity reference prices are the classic target.
  • Auto-deleveraging (ADL). When liquidations and the backstop can't cover losses, some protocols close part of profitable traders' positions to restore balance. GMX's documentation, for example, triggers ADL when pending profit becomes too large relative to the pool. Traders rarely expect it, so it must be disclosed.
  • Liquidation cascades. Fast moves trigger liquidations, which push prices further and trigger more. Open interest caps, partial liquidations and a mark price that resists wicks all help.
  • Smart contract and chain risk. A bug in the margin or liquidation logic is a protocol-sized incident. On an app-chain, consensus and validator bugs join the list.
  • Key and governance risk. Whoever can list markets, change leverage limits or upgrade contracts can drain the protocol by mistake or on purpose. Admin powers belong behind a multisig and a timelock.

Built by Gilzor

Results we’ve shipped

70+products launched
98%delivered on time
85%clients come back
Art Scherbakov, Co-FounderAndrew Laminsky, CTOYuri Rudenya, Head of Mobile Development at GilzorAlena Timofeeva, Product Marketing Lead

Talk to the people who build it. Tell us about your project and get a free estimate of scope, timeline and cost.

See how we’d approach yours

Perpetual futures in the US: the regulatory picture (October 2026)

Perps are derivatives, and in the US derivatives on commodities, including crypto assets the CFTC treats as commodities, fall under the Commodity Futures Trading Commission. Offering them to US persons generally requires registered venues and intermediaries. For years, that kept most perp trading offshore, and many offshore venues and perp DEX front ends block US users.

Several things changed in 2025 and 2026:

  • Perpetual-style futures. From July 2025, Coinbase Derivatives listed long-dated "perp style" crypto futures with a five-year expiry and an hourly funding mechanism, self-certified with the CFTC. In June 2026, CFTC staff said it would not recommend enforcement action if Coinbase Derivatives and Bitnomial removed the expiration dates from their existing perpetual-style crypto futures.
  • First US-listed perpetual. On May 29, 2026 the CFTC issued an order approving a bitcoin perpetual contract, KalshiEX's BTCPERP, for listing on a registered exchange as a futures contract. In an op-ed published the same day, Chairman Michael Selig wrote that perpetual trading activity had "predictably occurred offshore".
  • A policy for other perps. The same day, the CFTC issued a policy statement saying perpetual contracts on assets not covered by the bitcoin order should be submitted for Commission review and approval, noting that the perpetual design may not suit every asset class.
  • Offshore perps through a US broker. Also on May 29, CFTC staff said certain crypto perpetuals listed on Deribit FZE, the foreign board of trade affiliated with the futures commission merchant Coinbase Financial Markets, may be treated as foreign futures.
  • A court challenge. In June 2026, CME Group sued the CFTC in federal court in Washington, D.C., asking it to set aside the bitcoin perpetual approval and the policy statement. The CFTC asked the court in September to dismiss the case; as of late October 2026 no ruling had been reported.

None of this makes a permissionless perp DEX available to US users by default. In September 2023 the CFTC settled charges against Deridex, which offered perpetual contracts through a blockchain protocol, for operating without registering as a swap execution facility or contract market and as a futures commission merchant, and for lacking a customer identification program.

General information, not legal or investment advice

Perpetual futures are high-risk leveraged products, and rules are changing quickly. If you plan to offer perps, build a perp front end or serve US users, involve derivatives counsel before you design the product, and expect geofencing, screening and disclosure requirements to shape the architecture.

Perpetual DEX development: what building one involves

If you are scoping a perp product, the order of work matters more than the tech stack. A typical path:

  1. Pick the design and the chainOrder book or pool, your own chain or an existing layer 2. This sets team size, timeline and the kind of liquidity you need: market makers for a book, liquidity providers for a pool.
  2. Write the risk model before the codeMargin formulas, maintenance levels, leverage and open interest caps per market, funding formula, liquidation steps and what happens when equity goes negative. Simulate them against historical crashes.
  3. Design the oracle layerChoose oracle providers, add staleness and deviation checks, define the mark price, and decide which markets are too thin to list.
  4. Build the core contracts or chain modulesMargin engine, execution, liquidations, funding, insurance fund or backstop. Keep the code that holds funds small and well tested, with fuzz and invariant tests.
  5. Build keepers, indexer and APILiquidation and order-execution bots, an indexer for positions and history, and a trading API for market makers.
  6. Build the trading front endCharts, order entry, clear liquidation price and funding display, wallet connection and transaction previews.
  7. Audit, then launch with capsIndependent audits of contracts and risk logic, a bug bounty, then mainnet with low open interest caps that rise over time.
  8. OperateMonitoring for oracle deviations and bad debt, an incident and pause plan, and ongoing parameter tuning per market.

Team and timeline

A typical team: smart contract engineers (Solidity, or Rust or Go for an app-chain), a risk or quant engineer for margin and funding, backend engineers for keepers and the indexer, a front-end developer who has built trading screens, QA and security, DevOps, and outside auditors and counsel.

9–15 moRough range for a pool-based perp DEX on an existing layer 2, audits included
18 mo+Rough range for an order book design on its own app-chain
2+Independent audits that serious perp protocols commonly plan for

These are planning estimates, not quotes. Budgets sit at the top of the DeFi protocol range in our blockchain app development cost guide or above it, because of risk engineering and audit scope. If your product needs custody, fiat rails or a central order book, compare it with the models in our crypto exchange development cost guide.

Perp DEX readiness checklist

Tick what is already true for your product.

Perp DEX readiness

FAQ

What is perpetual trading in simple terms?
Perpetual trading is buying or selling perpetual futures: contracts that let you bet on an asset's price going up (long) or down (short) with leverage, without owning the asset and without an expiry date. Because there is no expiry to pull the contract price back to the real price, longs and shorts pay each other a funding rate at regular intervals. When the contract trades above the spot price, longs usually pay shorts, and the other way round.
How does the funding rate work in perpetual futures?
The funding rate is a small periodic payment between traders, not a fee to the exchange. It is calculated from the gap between the contract price and the spot index, often plus a small interest component. If the rate is positive, longs pay shorts; if negative, shorts pay longs. For example, at a rate of 0.01% per hour, a $20,000 long pays $2 each hour to shorts. Hyperliquid and dYdX both settle funding hourly, according to their documentation.
What is a perp DEX?
A perp DEX is a decentralized exchange for perpetual futures. Traders keep control of their funds through their own wallet, and margin, positions and liquidations are handled by smart contracts or by the rules of a purpose-built blockchain. The two main designs are an on-chain order book, where traders match with each other (Hyperliquid, dYdX), and a pool model, where trades execute at oracle prices against a liquidity pool (GMX).
Are perpetual futures legal in the US?
As of October 2026, perpetual futures are derivatives regulated by the CFTC, so they can be offered to US persons only through registered venues and intermediaries. For years that meant they mostly traded offshore. On May 29, 2026 the CFTC approved a bitcoin perpetual contract for listing on a US-registered exchange and issued a policy statement on listing other perpetuals; CME Group has challenged that approval in court. This does not make offshore venues or unregistered perp DEXs available to US users. This is general information, not legal advice.
What is the difference between mark price and index price?
The index price is a reference for the asset's spot price, usually built from several spot exchanges. The mark price is the exchange's estimate of the contract's fair value, used to calculate unrealized profit and loss and to decide liquidations. Using a mark price instead of the last trade means a single wick or a thin order book is less likely to liquidate traders unfairly.
How long does perpetual DEX development take?
As rough planning ranges, not quotes: a pool-based perp DEX on an existing layer 2 typically takes 9 to 15 months including audits, and an order book design on its own app-chain takes well over a year and a much larger team. Risk parameters, oracle design, multiple audits and a capped launch usually set the date more than front-end work does.

Where Gilzor fits

We build the parts of a trading product that users touch every day: trading front ends, backends, APIs and the integrations around them, through our Web3 development and smart contract development services. In crypto, our team refactored the architecture of the KickEX exchange app and rewrote unstable code so users could trade, transfer and withdraw reliably. We work from Poland and Cyprus, with a few shared hours a day with the US East Coast.

Tell us which markets you want to list, on which chain and for which users. We'll help you choose a design, scope the risk engine and plan the audit path before code is written.

No sales pitch

Get a straight answer for your project

Tell us what you’re building. We’ll reply with options, a rough cost and timeline. If we’re not the right fit, we’ll say so.

Next, a few optional questions so the first call is useful. We use your details only to reply to your request. Privacy Policy

Yuri Rudenya
Written byYuri Rudenya

Head of Mobile Development at Gilzor. Leads iOS and Android delivery and the mobile app audits, from release process to architecture.

LinkedIn →

Gilzor · Web Development partner

Need a team for your web product?

95%referred by business partners
70+successful launches
85%repeat business
98%delivered on time

The team behind them

Art Scherbakov
Art ScherbakovCo-Founder
Andrew Laminsky
Andrew LaminskyCTOLinkedIn
Yuri Rudenya
Yuri RudenyaHead of Mobile Development at GilzorLinkedIn
Alena Timofeeva
Alena TimofeevaProduct Marketing LeadLinkedIn
Tell us what you’re buildingOptions, a rough cost and timeline for your project. No commitment.

More insights