A Practical Guide to Cross-DEX Arbitrage with Hyperliquid
Cross-DEX arbitrage means taking advantage of short-lived price differences between decentralized exchanges by buying and selling the same asset across venues. In theory, the trade is market-neutral. In practice, fees, latency, liquidity, funding, execution quality, and protocol risk can quickly turn a visible spread into a loss. Source: Hyperliquid docs. Source: OneKey GitHub. Source: Hyperliquid docs.
As Hyperliquid has become one of the largest on-chain derivatives venues by trading activity, the spread between Hyperliquid perpetuals and spot DEX markets such as Uniswap or GMX has become an important area for quantitative traders to monitor. This guide breaks down the main cross-DEX arbitrage patterns involving Hyperliquid and evaluates how practical they are in the current market environment.
Key comparison table
Types of cross-DEX arbitrage involving Hyperliquid
Cross-DEX arbitrage with Hyperliquid generally falls into several categories.
Opportunity 1: Perp premium vs. spot DEX arbitrage
When a Hyperliquid perpetual trades above or below the on-chain spot price, there may be a spread to capture after accounting for the normal premium implied by funding.
Typical approach:
- If the perp trades at a premium to spot: short the Hyperliquid perp and go long spot on-chain, for example through a Uniswap v3 WETH/USDC pool.
- If the perp trades at a discount to spot: long the Hyperliquid perp and short spot on-chain, for example by borrowing the asset through a protocol such as Aave and selling it.
A simple price comparison workflow may look like this:
import requests
def get_hl_mark_price(coin: str) -> float:
resp = requests.post(
"https://api.hyperliquid.xyz/info",
json={"type": "metaAndAssetCtxs"},
timeout=10,
)
meta, ctxs = resp.json()
for i, u in enumerate(meta["universe"]):
if u["name"] == coin:
return float(ctxs[i]["markPx"])
return None
def get_uniswap_price(token_address: str) -> float:
# Query via the Uniswap v3 Subgraph or on-chain slot0.
# This is a placeholder. In production, connect to a subgraph,
# RPC endpoint, or multicall pipeline.
...
Important: a perpetual mark price already reflects funding dynamics. A clean arbitrage signal should subtract the portion of the premium or discount that is reasonably explained by funding before treating the remaining spread as tradable.
Opportunity 2: Funding-rate arbitrage between Hyperliquid, dYdX, and GMX
dYdX and GMX are major on-chain derivatives venues that compete with Hyperliquid. Differences in funding rates across these protocols can create cross-protocol arbitrage opportunities.
Key differences to understand:
- GMX uses GLP/GM pool-based pricing and funding logic, which differs from Hyperliquid’s order book model.
- dYdX v4 is built with the Cosmos SDK and settles on its own chain.
- Hyperliquid runs on its own L1 and is designed for low-latency trading.
A practical monitoring stack should pull funding and market data from all relevant venues into one comparison dashboard:
PROTOCOLS = {
"hyperliquid": "https://api.hyperliquid.xyz/info",
"gmx": "https://api.gmx.io/...", # Refer to GMX docs
"dydx": "https://indexer.dydx.trade/...", # Refer to [dYdX](https://docs.dydx.xyz/) docs
}
The trade is usually structured as opposing positions on two venues: long where funding is favorable and short where funding is expensive, while keeping delta exposure as close to neutral as possible. Execution costs, margin requirements, liquidation risk, and changes in funding rates must all be included in the model.
Opportunity 3: Atomic arbitrage and flash loans
On a single chain such as Ethereum or Arbitrum, if two AMMs show a price difference, a trader can theoretically use a flash loan to complete the arbitrage in one transaction:
- Borrow USDC from Aave without upfront collateral, as long as it is repaid in the same transaction.
- Buy ETH with USDC on Uniswap v3.
- Sell ETH on another venue at a higher price.
- Repay the flash loan and keep the remaining spread.
For Hyperliquid, the practical constraints are significant:
- Hyperliquid runs on its own L1 and does not share atomic execution with Ethereum.
- Flash loans cannot be used to atomically execute trades across Hyperliquid and Ethereum-based protocols.
- Atomic arbitrage involving Hyperliquid spot markets is limited by architecture.
- MEV competition is extremely intense, and simple on-chain arbitrage margins have been compressed heavily.
Because of this, flash-loan-style arbitrage is less straightforward for Hyperliquid than for two protocols on the same EVM chain.
Opportunity 4: Cross-chain price-lag arbitrage
Sometimes the same asset trades at slightly different prices on DEXs across different chains because information and liquidity do not move instantly. In theory, fast cross-chain arbitrage can capture these temporary gaps.
In practice, this is difficult:
- Bridges can take minutes to hours, by which time the spread may be gone.
- Truly fast cross-chain arbitrage requires cross-chain messaging infrastructure such as LayerZero, and the tooling remains early.
- Bridge smart contract risk may outweigh the expected arbitrage profit.
As a result, cross-chain price-lag arbitrage is mostly a theoretical opportunity for most traders. The real execution window is very narrow.
Opportunity 5: Liquidation arbitrage
When large positions on Hyperliquid approach liquidation, prices around the liquidation level can temporarily become distorted. Experienced traders may attempt to:
- Monitor large positions near liquidation thresholds, for example by scanning the
clearinghouseStateendpoint. - Enter hedged or opposite positions before or immediately after liquidation events.
- Manage inventory and margin tightly as liquidation flow hits the order book.
Liquidation arbitrage is high-frequency and high-risk. It requires low-latency infrastructure, precise execution, and strong risk controls. Traders should study Hyperliquid’s official documentation before attempting to interact with liquidation-related mechanisms.
Technical infrastructure requirements
The more competitive the arbitrage opportunity, the more infrastructure matters. A serious setup typically needs:
- Low-latency connectivity: infrastructure located close to relevant Hyperliquid nodes and RPC endpoints.
- Efficient order submission: official SDKs or direct RPC calls with minimal unnecessary overhead.
- Real-time risk monitoring: millisecond-level tracking for delta, margin ratio, spread deviation, funding exposure, and venue balances.
- Reliable market data: normalized order book, funding, mark price, index price, and fee data across all target venues.
- A strong understanding of Hyperliquid’s developer docs and on-chain architecture.
For discretionary traders, the requirements are lighter, but the same principles apply: know your costs, understand your liquidation risk, and avoid trading spreads that disappear after fees and slippage.
OneKey Wallet: safer asset management for arbitrage workflows
Cross-DEX arbitrage often requires moving and managing funds across multiple protocols. Private key security should be treated as core infrastructure, not an afterthought.
A OneKey hardware wallet provides a physically isolated signing environment. Even if a monitoring server, trading dashboard, or execution script is compromised, the private key is not directly exposed.
For traders who do not need fully programmatic signing, OneKey Perps offers a practical interface for trading Hyperliquid, checking positions, and making manual adjustments quickly. It is especially useful for monitoring perp exposure, managing margin, and intervening when an automated strategy needs human review.
If you trade perps or manage cross-venue positions, consider downloading OneKey and using OneKey Perps as your Hyperliquid workflow interface. You can also review the OneKey open-source repository to understand how it may fit into a broader trading and security setup.
FAQ
Q1: Is cross-DEX arbitrage still profitable?
Simple statistical arbitrage and flash-loan arbitrage are much less profitable than they used to be because MEV bots and professional trading systems have compressed most obvious spreads. Funding-rate arbitrage, especially across CEX and DEX venues, can still have opportunities, but it requires careful cost control and reliable execution. Strategies with an information or infrastructure edge, such as liquidation monitoring, may still be viable for experienced traders.
Q2: How do Hyperliquid and GMX funding rates differ?
Hyperliquid uses an on-chain order book model, with funding shaped by order flow and settled hourly. GMX v2 uses the GM pool model, where funding is driven by factors such as open interest imbalance and liquidity utilization. Because the mechanisms are different, the same asset can show different funding rates across the two venues. That difference is the basis for cross-protocol funding arbitrage. For implementation details, refer to the GMX and Hyperliquid docs.
Q3: Does an arbitrage bot need to run 24/7?
For strategies that capture short-lived spreads, yes. The bot needs to run continuously because opportunities can appear and vanish within seconds or less. For funding-rate strategies, the timing is less intense. Some traders manually check funding conditions around settlement windows, although automation still helps with consistency and risk control.
Q4: How should gas and trading fees be handled?
All costs must be included before entering a trade. Hyperliquid L1 has relatively low transaction costs, which is one of its advantages compared with Ethereum mainnet protocols. Still, a complete model should include Hyperliquid fees, the counterparty chain’s gas costs, DEX swap fees, slippage, borrow costs, funding, and any bridge or transfer costs.
Q5: Are there legal or regulatory risks in liquidation arbitrage?
In many jurisdictions, participating in a DEX liquidation mechanism is generally treated as normal market activity. However, rules vary by location and by the trader’s circumstances. If this matters to your setup, consult a qualified legal professional.
Risk notice
This article is for technical and educational purposes only and is not investment, financial, or legal advice. Cross-DEX arbitrage involves execution risk, protocol risk, liquidity risk, smart contract risk, bridge risk, liquidation risk, and operational risk. Loss of principal is possible. Make sure you understand the risks before trading.



