What Is Perpetual Trading? Perpetual Futures and Perp DEXs Explained

In this article
- Perpetual trading means trading perpetual futures: leveraged contracts that track an asset's price and never expire. A funding rate, paid between longs and shorts every few hours or every hour, keeps the contract price close to the spot price.
- Leverage cuts both ways. A trader posts margin, and when losses eat it down to the maintenance level, the position is liquidated at the mark price, not the last trade.
- A perp DEX runs this on-chain. The main designs are an on-chain order book on its own chain (Hyperliquid, dYdX) and an oracle and liquidity pool model (GMX). The hard parts are the margin engine, oracles and liquidations, not the trading screen.
- In the US, perps are regulated derivatives. In May 2026 the CFTC approved the first US-listed bitcoin perpetual, but a permissionless perp DEX serving US users still raises serious registration questions.
Jump to
- What is perpetual trading?
- How perpetual futures work: margin, leverage and liquidation
- The funding rate, explained with an example
- CEX perps vs perp DEXs
- Perp DEX explained: the main designs
- Key components of a perp DEX
- The main risks of perp DEXs
- Perpetual futures in the US: the regulatory picture (October 2026)
- Perpetual DEX development: what building one involves
- Perp DEX readiness checklist
- Where Gilzor fits
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 trading | Dated futures | Perpetual futures | |
|---|---|---|---|
| You own the asset | Yes | No | No |
| Expiry | None | Fixed date, then settle or roll | None |
| What keeps the price in line | It is the price | Convergence at expiry | Periodic funding payments |
| Leverage | Only with a margin loan | Yes, set by the exchange | Yes, set by the exchange or protocol |
| Can go short easily | Not without borrowing | Yes | Yes |
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 price | Move | Profit or loss | Equity left | What happens |
|---|---|---|---|---|
| $105,000 | +5% | +$1,000 | $3,000 | Margin grows by 50% |
| $95,000 | −5% | −$1,000 | $1,000 | Half the margin is gone |
| $92,500 | −7.5% | −$1,500 | $500 | Equity 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.
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 perps | Perp DEX | |
|---|---|---|
| Custody | The exchange holds customer funds | Users keep keys; funds sit in contracts or chain state |
| Matching and margin | Private servers | Smart contracts or a purpose-built chain, publicly verifiable |
| Account opening | KYC and onboarding by the exchange | Connect a wallet; screening depends on the front end |
| Transparency | Positions and reserves visible only to the operator | Positions, liquidations and funding visible on-chain |
| Main risks | Operator failure, frozen withdrawals | Smart contract bugs, oracle manipulation, governance and key risk |
| Speed | Very fast, central matching | Depends 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.
- Example: dYdX Chain, built with the Cosmos SDK and CometBFT.
- Counterparty: other traders, through an order book.
- How matching works: each full node keeps an in-memory order book. Block proposers match orders by price-time priority, and matches settle on-chain once the block passes consensus.
- Trade-off: fast matching without putting every order in a block, at the cost of running a validator set and a more complex design.
- Example: GMX, deployed as smart contracts on Arbitrum, Avalanche and MegaETH.
- Counterparty: liquidity pools. Liquidity providers deposit tokens, and the pool's value moves with traders' net profit and loss, plus the fees it collects.
- Prices: trades execute at oracle prices sourced from aggregated exchange data, with price impact and borrowing fees to balance the pool.
- Trade-off: no market makers needed and it deploys on an existing chain, but the oracle becomes the critical dependency and liquidity providers carry trader risk.
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.
| Component | What it does | What goes wrong if it's weak |
|---|---|---|
| Matching or execution | Fills orders: order book matching, or oracle-priced execution against a pool | Bad fills, front-running, stuck orders |
| Margin engine | Tracks collateral, positions, leverage limits, cross and isolated margin | Under-collateralized accounts, bad debt |
| Oracles and mark price | Brings in the index price and computes a fair mark price | Manipulated prices, unfair liquidations |
| Liquidation engine | Closes positions below maintenance margin, often through keeper bots | Late liquidations turn into losses for the protocol |
| Insurance fund or backstop | Absorbs losses when a liquidation closes below zero equity | Losses fall on profitable traders or liquidity providers |
| Funding module | Computes and settles funding on schedule | The perp drifts far from spot |
| Risk parameters and governance | Leverage caps, open interest caps, market listings, who can change them | One thin market drains the whole protocol |
| Indexer, API and front end | Charts, positions, history, alerts, wallet connection | Users 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




Talk to the people who build it. Tell us about your project and get a free estimate of scope, timeline and cost.
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.
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:
- 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.
- 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.
- Design the oracle layerChoose oracle providers, add staleness and deviation checks, define the mark price, and decide which markets are too thin to list.
- 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.
- Build keepers, indexer and APILiquidation and order-execution bots, an indexer for positions and history, and a trading API for market makers.
- Build the trading front endCharts, order entry, clear liquidation price and funding display, wallet connection and transaction previews.
- 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.
- 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.
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?
How does the funding rate work in perpetual futures?
What is a perp DEX?
Are perpetual futures legal in the US?
What is the difference between mark price and index price?
How long does perpetual DEX development take?
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.

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?
Services
Web DevelopmentCustom websites and web apps — front-end, back-end, launch and support.→By company type
Selected projects






The team behind them





