Module 2 / 2
Perp DEXs – Hyperliquid, dYdX vs CEX
Perpetual futures are the product that came to dominate crypto volume – 70-80% of turnover is perps. Until 2022 perps were the domain of CEXs (Binance, Bybit). Since 2023 perp DEXs have been growing: dYdX v4, Hyperliquid, GMX, Vertex, ApolloX. The promise: self-custody, a transparent orderbook or oracle, no...
- Author
- Zordon Intelligence Sp. z o.o.
- Updated
- 10 min read
- Structure sources
- 2
Introduction
Perpetual futures are the product that came to dominate crypto volume – 70-80% of turnover is perps. Until 2022, perps were the domain of CEXs (Binance, Bybit). Since 2023, perp DEXs have been growing: dYdX v4, Hyperliquid, GMX, Vertex, ApolloX. The promise: self-custody, a transparent orderbook or oracle, no FTX risk. The price: a different liquidation risk model, worse liquidity on exotics, smart contract risk.
This lesson compares perp DEX vs CEX from the angle of mechanics, risk and measurement. Not to talk you into migrating, but so that you can consciously choose where to execute and calculate the true cost: fee, funding, slippage, counterparty risk.
What a perp is and how it works
A perpetual contract has no expiry date. The perp price is anchored to spot by the funding rate.
The components:
- Mark Price: the price used for liquidation, calculated from the average spot + basis.
- Funding rate: a periodic payment between long and short. If perp > spot, long pays short (positive funding). If perp < spot, short pays long (negative).
- Margin: collateral. Isolated = only for that position. Cross = the whole portfolio as collateral.
- Leverage: it is not a product, it is a setting for position size relative to margin.
PnL and liquidation formula (simplified, without fees):
PnL = (Exit Price - Entry Price) * Quantity * Direction
Direction long = +1, short = -1
Long liquidation price (isolated, 10x):
Entry BTC $60k, margin $1k, position 0.166 BTC ($10k notional)
Liquidation ≈ Entry Price * (1 - 1/Leverage + Maintenance Margin)
For 10x, maintenance 0.5% -> ~ $54,300
Funding 8h:
Funding Cost = Position Notional * funding rate
If funding rate = 0.01% per 8h, position $10k -> $1 per 8h, $3 per day
Real cost of holding:
Cost = Maker/Taker Fee + Funding * time + Entry/exit Slippage
CEX perp – the model
Binance, Bybit, OKX: a centralised orderbook, the CEX is the counterparty and the matching engine.
| Element | CEX |
|---|---|
| Liquidity | Highest, especially BTC/ETH, spread 0.5-1 bps |
| Fee | 0.02% maker / 0.04-0.06% taker with VIP, up to 0.05%/0.1% without |
| Funding | Stable, arbitraged by market makers |
| Leverage | Up to 125x (marketing), 3-10x used in practice |
| Risk | Counterparty (exchange), account freeze, downtime during volatility |
| Transparency | No real-time proof of reserves, the orderbook can be filtered |
| API / tooling | Advanced, low latency |
The main CEX risk in 2024-2025 is not a hack, but regulatory freezing, delisting, auto-deleveraging during a liquidation cascade.
Perp DEX – 3 architectures
1. Off-chain orderbook, on-chain settlement – Hyperliquid, dYdX v4
Hyperliquid: its own L1 (Hyperliquid Chain) with the orderbook in the validators’ mempool. Settlement on-chain, matching off-chain, but transparent. High throughput, 20k TPS, sub-second finality. Hyperliquid has vaults (HLP) as the counterparty for part of the flow.
dYdX v4: its own Cosmos chain (dYdX Chain), validators keep the orderbook in memory. Zero gas fee per order (you pay only the trading fee, not EVM gas). Very low latency for Cosmos.
Pros: CEX-like UX, low latency. Cons: Can validators censor? Dependence on the bridge (for Hyperliquid: an Arbitrum bridge to fund the account).
2. Oracle pricing, pool as counterparty – GMX v2
There is no orderbook. The price comes from an oracle (Chainlink + fast price feed). The trader trades against the GLV pool (GMX Liquidity Vault). The pool earns fees and is the counterparty.
Pros: no slippage on large sizes relative to the oracle (up to the OI limit), simple. Cons: oracle dependence, pool risk (if most traders win, the pool loses), price impact for large OI.
3. Hybrid AMM + Orderbook – Vertex, ApeX
Vertex: an orderbook on Arbitrum with cross-margin and a unified portfolio. It combines spot, perp, money market.
Cost comparison – where you really pay
| Cost | CEX (Binance VIP1) | Hyperliquid | dYdX v4 | GMX v2 |
|---|---|---|---|---|
| Taker fee BTC | 0.04% | 0.035% | 0.05% | 0.06-0.07% (open+close) |
| Maker fee | 0.02% | 0.01% | 0% (often) | N/A |
| Funding | Variable, ~0.01%/8h in a bull market | Similar, slightly higher vol | Similar | Borrow fee, not funding |
| Slippage $1M BTC | <1 bps | 2-5 bps | 2-5 bps | Price impact 0-10 bps depending on OI |
| Gas | 0 | 0 (included in the fee) | 0 | Arbitrum/Avax gas |
| Withdrawal | Free internal, on-chain fee | Arbitrum bridge fee | Bridge from dYdX Chain | Gas |
The real cost is not in the fee. It is in slippage and funding during euphoria.
Holding a $100k notional BTC long for 10 days, funding avg 0.015%/8h:
Opening + closing fee:
CEX: $40+$40 = $80
Hyperliquid: $35+$35 = $70
Funding 10 days = 30 periods * 0.015% * $100k = $450
CEX and DEX similar, but a DEX may have higher funding at low liquidity
Total cost: ~$530 = 0.53% notional
At 10x leverage, that is 5.3% of your margin in 10 days just for holding.
That is why funding is the key – not leverage.
Liquidation risk and mechanisms – critical differences
On a CEX you have: maintenance margin, an insurance fund, ADL (auto-deleveraging) when the fund is empty. On large CEXs liquidation goes through an engine that tries to close at mark price.
On a perp DEX:
- Hyperliquid: liquidations are executed by validators, with the HLP vault as a backstop. If HLP loses, the yield vault drops.
- dYdX v4: an insurance fund on chain, validators liquidate. Cross chain can mean delays in funding collateral.
- GMX v2: liquidation at the oracle price, there is no insurance fund from other people’s fees – the GLV pool is the counterparty. A large liquidation cascade can temporarily lower price feed quality.
Risk checklist before opening a position on a perp DEX:
- Is mark price = oracle price or orderbook mid? A divergence >0.5% is liquidation risk despite a correct spot price.
- What is the insurance fund / HLP TVL? The larger it is, the lower the ADL risk.
- Is funding capped? Some DEXs have a max funding of 1%/8h vs 0.375% on a CEX.
- Does the network have a history of downtime during volatility? The Hyperliquid L1 had outages in 2024 under load.
- Is your collateral USDC on the same chain, or a cross-chain IOU? USDC.e vs native USDC carries bridge risk.
When to choose a DEX and when a CEX – the matrix
| Scenario | Better choice | Why |
|---|---|---|
| Scalping BTC/ETH, large size ($500k+) | CEX | Lowest slippage, depth |
| Swing BTC/ETH, medium size $10-100k, you want self-custody | Hyperliquid / dYdX | Low cost, no CEX custody risk |
| Long tail alt perp (e.g. an alt with a $50M MC) | Perp DEX is often the only option | A CEX does not list it, but the spread is wide – smaller position |
| Hedging a spot portfolio held in a cold wallet | Perp DEX | You do not have to send spot to a CEX |
| Funding arbitrage | Both – long CEX, short DEX | Funding differences of 0.05% are an opportunity, but count gas and transfer time |
| Resident of a country with a CEX block | Perp DEX | Access without KYC (but with frontend risk) |
Setup and security on a perp DEX
- Funding: Most perp DEXs are on Arbitrum/Base. Fund through the official bridge or a CEX withdrawal to Arbitrum (native USDC). Never click a bridge from a Google ad.
- Wallet: An operational one (Rabby), not a Vault. Perp positions should not sit in the same wallet as long-term holds.
- Approve: A perp DEX asks you to approve USDC. Give a limited approval for the amount you are funding, not unlimited.
- API keys: If you use a bot, a key for trading only, without withdrawals, with an IP whitelist.
- Stop loss: On a DEX the stop is often a trigger order on-chain – check whether it works during high volatility. Keep a backup alert on TradingView.
Procedure for opening a perp DEX position:
1. Check the funding rate 7d avg and the current one.
2. Check the OI and the OI limit for the given market (whether it is close to the cap).
3. Check the spread and the orderbook depth 0.5% from mid.
4. Open a test 10% of the position, measure realised vs expected slippage.
5. Set the SL as reduce-only and the TP.
6. Record in the journal: entry fee, funding start, liquidation price, max risk $.
Risk per trade = (Entry - SL) * Quantity + 30% buffer for funding on a long hold
When the plan says do not trade
- When funding >0.1%/8h and you want to open a BTC long for 10 days. You pay 3% notional for 10 days. That is not a trade, it is a donation to the shorts.
- When the OI on the altperp market is >80% of the max OI cap on the DEX. No room for new entrants, a long squeeze and a violent -0.2% funding are easy.
- When the DEX network is lagging and you are trading news. A delayed oracle = liquidation at a bad price despite a correct thesis.
- When you hold your entire spot portfolio at the same address as a cross-margin perp position. Liquidation of the perp can drag the spot with it. Isolation is mandatory.
- When the CEX is under maintenance and the DEX has 5x its normal spread. Those are not conditions for low-cost execution. Wait.
Mistakes that cost the most
- Using 50x leverage because the DEX allows it. Leverage is a mistake multiplier. At 50x, a 1% move is -50% of margin. Professionals use 2-5x.
- Not measuring slippage. You believe a 0.03% fee is the whole cost. And slippage on an alt perp is 0.5%. On $20k that is $100 per entry.
- Holding a long in euphoria with positive funding of 0.2% per 8h. The market is saying: everyone is long, you pay for it. Ignoring funding wipes out the gain from price.
- No backup plan for liquidation during downtime. You do not know how to close a position if the frontend goes down. Can you close directly through the contract?
- Treating the perp DEX as a portfolio. You leave $50k USDC on the perp DEX contract “because I will be trading in a moment”. That is exposure to smart contract risk. Fund before the trade, withdraw after.
Measurable exercise
Cost benchmark – compare 3 execution venues on one trade:
Choose the setup: long BTC, notional $10k, SL 2% below entry.
Execute (on paper or with micro positions):
| Venue | Real entry fee | Entry slippage (bps) | Funding / Borrow 24h | Real exit fee | Exit slippage | Total cost $ and % margin | Time to close (min) |
|---|---|---|---|---|---|---|---|
| Binance | |||||||
| Hyperliquid | |||||||
| dYdX v4 |
Formula:
Total Cost % = (Fee_in + Fee_out + Funding + Slippage_in_$ + Slippage_out_$) / Margin * 100%
After 10 such comparisons you will know where your system has the truly lowest cost (for your size). For $1k vs $100k the results will be different – measure for your own range.
Second exercise: for 14 days, record the funding rate every 8h for BTC on a CEX and on Hyperliquid. Calculate the difference. How many times was the difference >0.02% (an arbitrage opportunity)?
Check yourself
- What is a funding rate and when does long pay short?
- Explain the difference between mark price and last price and why mark price is used for liquidation.
- Compare the GMX v2 architecture vs Hyperliquid.
- How would you calculate the real cost of holding a perp position for 10 days?
- Why is cross-margin with a spot portfolio at the same address a risk?
Frequently asked questions
Is a perp DEX safer than a CEX after the FTX collapse? Safe in a different way. There is no risk that the exchange owner lends out your funds. There is smart contract bug risk and oracle failure risk. That is a different risk vector, not zero risk. That is why self-custody does not mean the absence of risk.
Why is funding on a perp DEX sometimes higher than on a CEX? Lower arbitrage efficiency and lower liquidity. When everyone wants to go long on an ALT and few want to short, funding has to be higher to encourage an arbitrageur to open a short. On a CEX more market makers do this automatically.
Can I lose more than my margin on a perp DEX? On most perp DEXs, no – liquidation closes the position before the balance goes negative, and the insurance fund covers the difference. But with extreme gapping and a low fund, debt is possible – in cross-margin models with spot borrowing. Read the docs on “bad debt”.
What is the point of the dYdX chain (Cosmos) for an ETH trader? Network abstraction. You trade from any wallet (MetaMask) through a bridge, but settlement is on dYdX Chain. For the end user the difference is UX and fees. For security – you have to trust the dYdX Chain validators and the bridge.
Is it worth holding DEX tokens (HYPE, DYDX) to get lower fees? Do the math. Staking HYPE or DYDX gives a fee discount, but exposure to the DEX token is additional risk. If you trade little, the discount will not cover the token’s volatility. If you trade a lot ($10M per month), it may pay off. Measure: the discount in $ vs the token’s decline.
Advertisement
Key takeaways
- Perpetual futures are the product that came to dominate crypto volume – 70-80% of turnover is perps. Until 2022 perps were the domain of CEXs (Binance, Bybit). Since 2023 perp DEXs have been growing: dYdX v4, Hyperliquid, GMX, Vertex, ApolloX. The promise: self-custody, a transparent orderbook or oracle, no...
Structure sources
The material is based on source documents. Variable values — fees, limits, regulatory figures — are worth checking at the source before making a decision.
- Glassnode / Nansen — on-chain analytics
- Binance Research — cryptocurrency reports
Disclaimer
- Educational material. Not investment advice or a recommendation. Trading involves the risk of losing capital.
- The materials are educational. They are not investment advice or a recommendation within the meaning of financial instruments trading regulations. Numbers in examples are illustrative unless a measurement date and source are given.
Who writes this and how we check it
The materials are written and verified by Redakcja Kurs Tradera — the rules are described on about the site: every number has a source, and we show gaps openly. Report a factual error via contact — corrections are described in the content.
Progress is stored only in this browser (localStorage) — there is no account and no copy on the server. Clearing site data will remove it. Manage your data