
How perp DEXes actually work, from funding rate math with examples to order book vs AMM design, margin types, and on-chain liquidations.
Author: Akshat Thakur
Spot traders stepping into derivatives often ask one thing first: How perp DEXes work in real conditions, not just theory. Perpetual DEXes bring leverage, self-custody, and full on-chain transparency together, but the mechanics can feel unfamiliar at the start.
This guide breaks it down step by step so you can understand how perp DEX works before risking real capital. From swaps and funding rates to margin and liquidations, each piece is explained in plain terms so you can trade with clarity.
If you’ve only traded spot crypto, you’re used to owning the asset. You buy BTC or ETH, it sits in your wallet, and your profit or loss depends on price changes. Derivatives work differently. You don’t own the asset. You’re trading a contract that tracks its price.
A traditional future is the simplest starting point. It’s a contract where you agree to buy or sell an asset at a fixed price on a specific date in the future. Think of it like locking in the price of something today but settling the deal later. When that date arrives, the contract expires. You either settle the difference in cash or take delivery of the asset.
This creates friction. If you want to keep your position, you need to “roll over” into a new contract before expiry. That means closing your current trade and opening another one, often at a slightly different price. Over time, this adds cost and complexity.
A perpetual swap removes that problem completely. It works like a future, but it never expires. You can hold the position as long as your margin supports it. There’s no settlement date, no rollover, and no forced closing tied to time.
This is why it’s called “perpetual.” The position can exist indefinitely.
What you’re actually trading is a synthetic contract. You don’t own BTC or ETH. Instead, you hold a position that mirrors the asset’s price. Your collateral, usually USDC or another stablecoin, backs that position.
The idea wasn’t born in crypto. Economist Robert Shiller proposed similar “continuous futures” in the early 1990s. It stayed theoretical until BitMEX launched the first crypto perpetual swap in 2016. That product changed how traders approached derivatives.
Here’s how the two compare:
Perpetual swaps feel closer to spot trading. You keep your position open as long as you want, while a separate mechanism keeps the price aligned with reality.
Perpetual swaps don’t expire. That creates a problem.
In a traditional future, the price naturally converges to the spot price as expiry approaches. Without expiry, nothing forces that convergence. In theory, the perpetual price could drift far away from the real market price.
Funding rates solve this.
A funding rate is a periodic payment exchanged between traders. It typically happens every 8 hours, though some platforms use shorter intervals. The key idea is simple: one side pays the other depending on whether the perpetual price is above or below the spot price.
If the perpetual price is higher than spot, the funding rate is positive. Long traders pay short traders.
If the perpetual price is lower than spot, the funding rate is negative. Short traders pay long traders.
This creates a balancing force. If longs are overcrowded and pushing price above spot, they start paying. That cost pushes some traders to close longs or open shorts. Price moves back toward spot.
Funding Rate = (Perp Price − Spot Price) / Spot Price × Adjustment
Now let’s make it concrete.
ETH spot is $3,000. The ETH perpetual is trading at $3,015. That’s 0.5% above spot. The funding rate is set at +0.05% for the next interval. You hold a $10,000 long position.
At the funding timestamp:
You pay = $10,000 × 0.05% = $5
That $5 goes directly to traders holding short positions. If you keep the position open for a full day with three funding intervals:
Total paid = $5 × 3 = $15
Now flip the scenario. If the perpetual trades below spot, you would receive funding instead of paying it. This is why funding matters. It’s not just a technical detail. It directly affects your PnL, especially in trending markets where funding can stay positive or negative for long periods.
In extreme conditions, funding can spike. During sharp market moves, rates have exceeded 0.3% per interval. That’s meaningful if you’re using leverage.
Important clarification:
Funding rates are not fees paid to the exchange.
They are peer-to-peer payments between traders.
The exchange simply calculates and facilitates the transfer. The money moves from one side of the market to the other. Think of funding as the “cost of keeping the contract aligned with reality.” It’s what allows perpetual swaps to exist without expiry.
If you’re starting to explore perp trading, it helps to see how these mechanics play out in real markets. Follow our X for breakdowns of live funding shifts, positioning, and trade setups.
All perpetual DEXes need a way to match trades. There are two main designs: order books and AMMs.
An order book, also called a central limit order book (CLOB), works like a traditional exchange. Traders place bids (buy orders) and asks (sell orders). The system matches them based on price and time.
Platforms like Hyperliquid, dYdX, EdgeX, and Reya use this model.
The advantage is precision. You get tight spreads and exact execution prices. It feels similar to a centralized exchange. The downside is infrastructure. Order books need fast, high-performance systems to work smoothly on-chain.
An AMM, or automated market maker, takes a different approach. Instead of matching buyers and sellers, you trade against a pool of liquidity.
Platforms like GMX, Level Finance, and Aster use this model.
Liquidity providers deposit assets into a pool. The protocol uses a formula or oracle price to quote trades. You can always trade because the pool is always there. The trade-off is slippage. Large trades move the price against you because you’re interacting with a finite pool of capital.
There’s also a third approach: hybrid models. For example, Drift Protocol combines an order book with an AMM backstop. If the order book is thin, the AMM fills the gap.
Here’s a clear comparison:
In 2026, the shift toward order book models is clear. Platforms like Hyperliquid processed around $2.9 trillion in trading volume in 2025 using a fully on-chain order book, showing that high-performance CLOB designs can scale.
But AMMs still matter. They work well for smaller markets where liquidity is limited. They also allow passive users to earn yield by providing capital. Both designs solve the same problem in different ways. Understanding this helps you choose where and how to trade.

Perp DEXes need liquidity to function. Someone has to take the other side of trades. In traditional finance, that role is handled by firms like Citadel. In DeFi, it’s often handled by community-owned vaults.
These are called market maker vaults. Start with the problem. On an order book, you need constant bids and asks. Without them, traders can’t enter or exit positions efficiently. Vaults solve this by pooling user capital and using it to provide liquidity.
Take HLP on Hyperliquid as an example. HLP (Hyperliquidity Provider) on Hyperliquid is an active vault with roughly $350–500M in TVL, where users deposit USDC and the system uses that capital to place bids and asks, handle liquidations, and keep the market functioning. Profits from fees and liquidations are shared with depositors.
GLP on GMX works differently. It’s a pool of multiple assets. Traders don’t trade against other users. They trade directly against the pool.
If traders win, the pool loses.
If traders lose, the pool gains.
As a liquidity provider, your returns depend on trader performance.
There’s also a newer concept called Just-In-Time liquidity. Platforms like Drift allow liquidity to appear only when a trade happens, then disappear immediately after. This improves capital efficiency but adds technical complexity.
The key idea is simple.
When you deposit into these vaults, you become the counterparty to traders. That’s very different from something like Uniswap, where you’re just facilitating swaps. Here, you are effectively taking the opposite side of leveraged trades.
This creates a clear trade-off:
You earn fees and potential profits, But you take on market risk. If traders consistently win, vault depositors lose money.
Market maker vaults turn passive capital into active trading infrastructure. They make perp DEXes usable, but they also shift risk from professional firms to everyday users.
Margin is simply your collateral. It’s the money you put up to open a leveraged trade.
If you open a $10,000 position with 10x leverage, you only deposit $1,000. That $1,000 is your margin. The rest is effectively borrowed. Your margin absorbs any losses. If losses get too large, your position is closed automatically.
There are two main ways this margin is managed.
Isolated margin keeps each trade separate. Every position has its own dedicated collateral. Think of it like separate wallets. If your BTC trade fails, only the margin assigned to that trade is lost. Your ETH or SOL positions remain untouched. This makes isolated margin easier to control, especially if you’re running multiple independent trades.
Cross margin combines everything into one pool. Your entire account balance backs all positions at the same time. Profits from one trade can offset losses from another. This reduces the chance of liquidation because stronger positions support weaker ones. But the trade-off is risk. If one position goes badly wrong, it can pull down your entire account.
Here’s a clear comparison:
A newer development is portfolio margin. Platforms like Hyperliquid are testing this approach. Instead of treating positions separately, the system evaluates your entire portfolio as one combined risk unit. Long and short positions can offset each other, reducing required margin.
This is the most capital-efficient model so far. But it still shares the same core trade-off as cross margin. Everything is connected.
If you want clear boundaries and simpler risk, isolated margin is easier to manage. If you want to maximize capital usage, cross or portfolio margin gives you more flexibility but demands more discipline.

Liquidations exist to protect the system. When you trade with leverage, you’re using borrowed exposure. Your margin acts as a buffer. If losses exceed that buffer, someone has to cover the gap.
Without liquidations, that loss would fall on the protocol or liquidity providers. So the system closes your position before it reaches that point.
Two terms define this process.
Initial margin is what you deposit to open the trade.
Maintenance margin is the minimum balance required to keep it open.
Maintenance margin is usually small, around 1% to 5% of position size. As the market moves against you, your equity drops. Once it falls below this threshold, liquidation is triggered.
On-chain, this is automatic. Smart contracts track positions in real time. External agents help execute. On platforms like Drift Protocol, keeper bots monitor accounts and trigger liquidations. On Hyperliquid, on-chain liquidators compete to close positions and earn a reward.
Once triggered, your position is force-closed at the current market or oracle price. There is no delay and no human intervention.
There is also a key level called the bankruptcy price. This is where your position’s value reaches zero. If liquidation happens beyond this level due to fast price moves, losses can exceed your margin.
That’s why insurance funds exist. They absorb these rare shortfalls. On Hyperliquid, the HLP vault performs this role.
The real danger appears during cascades.
Large liquidations push price further in the same direction, triggering more liquidations. The October 2025 crypto liquidation cascade wiped out about $19 billion in a single day, with Hyperliquid alone absorbing roughly $10.3 billion of that volume.
Events like the Paradex rollback incident and cases like Garrett Jin show how fast losses can compound. Liquidations are not random. They are a direct outcome of leverage.
Perpetual trading exists in two environments. Decentralized exchanges (DEXs) and centralized exchanges (CEXs). Both work, but they solve problems differently.
Here’s a direct comparison:
Custody is the biggest difference.
On a DEX, your funds stay in your control through smart contracts. The platform cannot move them arbitrarily. On a CEX, your funds sit on the exchange’s balance sheet. You trust the platform to remain solvent and allow withdrawals.
Transparency follows naturally. On-chain systems let anyone verify trades, positions, and liquidations. Centralized exchanges do not offer this level of visibility.
Speed used to be a major gap. That gap is shrinking. Platforms like Hyperliquid now offer near-instant execution with very high throughput. Still, CEXs remain faster for ultra-low latency strategies.
Liquidity is still stronger on centralized exchanges, especially for major pairs. But DEX volumes are growing quickly and closing that gap.
Regulation is another dividing line. CEXs operate under regulatory frameworks and require identity verification. DEXs are mostly permissionless. New frameworks, like the CFTC guidelines introduced in 2026, are starting to define how on-chain derivatives fit into the system.
Each side has risks.
DEXs face smart contract bugs and oracle manipulation. For example, GMX V1 lost $42M in a July 2025 exploit, highlighting the real smart contract risk in on-chain trading. Also, because positions are visible on-chain, traders can be targeted.
CEXs carry counterparty risk. If the platform fails or freezes withdrawals, users have limited control.
There is no perfect choice. Many traders use both depending on the situation.

Perpetual trading looks simple on the surface. But the risks are mechanical and unforgiving.
Leverage is the first and most obvious one. At 10x leverage, a 10% move against you wipes out your margin. At higher leverage, even small price moves can end your position quickly. This is very different from spot trading, where you can hold through volatility.
Funding rates are the hidden cost.
If you’re on the wrong side of a trend, you pay repeatedly. Every few hours, funding drains your position. Over days or weeks, this adds up even if price hasn’t moved much.
Liquidation hunting is another reality on on-chain platforms.
Because positions are visible, large traders can estimate where liquidations sit. They can push price toward those levels. A well-known example is James Wynn, who lost significant capital after repeated liquidations were triggered.
Smart contract risk sits underneath everything.
Your collateral is locked in code. If there is a bug or exploit, funds can be lost instantly. Even established protocols have faced issues.
Oracle manipulation is less common but serious. If the price feed is wrong, liquidations can happen incorrectly. The Paradex rollback incident showed how damaging this can be.
Liquidity fragmentation adds another layer. Capital is spread across many platforms. Thin liquidity can lead to poor execution, especially during volatile moves.
These are not edge cases. They are part of how the system works.
Understanding them is the difference between controlled risk and avoidable losses.
Follow our X for real-time breakdowns of funding rates, liquidation flows, and how perp DEX mechanics play out in live markets.
This article is for educational purposes only and does not constitute financial or investment advice. Trading leveraged products carries substantial risk of loss.
All the opinions in this article are that of the author and in no way are financial advice. Our Crypto Talk and the author always suggest you do your own research in crypto and to never take anything as financial advice that you read on the internet. Check our Terms and conditions for more info.
Telegram Reclaims TON, Six Years After the SEC Killed It
Salvium Protocol AMA With Our Crypto Talk
How Perp DEXes Work: Funding Rates, Liquidations & Orders
Sell in May Explained: Why Crypto Traders Follow This in 2026
Telegram Reclaims TON, Six Years After the SEC Killed It
Salvium Protocol AMA With Our Crypto Talk
How Perp DEXes Work: Funding Rates, Liquidations & Orders
Sell in May Explained: Why Crypto Traders Follow This in 2026