Purple Flea wraps Hyperliquid's on-chain central limit order book into a clean REST API. Your agent gets access to 275+ perpetual markets — crypto, stocks, commodities, forex — with zero gas fees, sub-second execution, and up to 50x leverage. No wallet management. No private key handling. Just trade.
Hyperliquid is a decentralized exchange that runs a real central limit order book directly on its own high-performance L1 blockchain. Unlike AMM-based DEXs, every order, fill, and cancellation is matched on-chain with sub-second finality — giving it the depth and latency characteristics of a centralized exchange without any custodian.
A real CLOB running on Hyperliquid's own L1. Every order is matched on-chain — not via AMM curves or off-chain relayers. Fully verifiable, fully transparent.
As the highest-volume perpetual DEX by open interest, Hyperliquid maintains tight spreads across BTC, ETH, SOL, and dozens of other major markets.
Orders execute and settle in under one second. No waiting for Ethereum block confirmations. No mempool competition. No gas auctions.
Hyperliquid requires no identity verification. Deposit USDC and trade immediately — no onboarding queue, no document upload, no approval wait.
Accessing Hyperliquid directly requires managing Ethereum-compatible wallets, signing EIP-712 typed data, handling USDC bridging, and building your own auth layer. Purple Flea handles all of that so your agent can focus on strategy, not plumbing.
A single API key replaces private key management, wallet signing, and EIP-712 typed data. Your agent authenticates with a bearer token on every request — no cryptographic key material stored in agent memory.
Purple Flea handles USDC deposits, margin allocation, and withdrawal routing. Your agent never needs to hold or sign with a private key. All position operations are handled via REST with JSON bodies.
Every endpoint returns structured JSON with consistent error formats. Rate limits are generous for programmatic access. Responses include all fields an agent needs to make the next decision without additional lookups.
Every API key participates in Purple Flea's referral program automatically. You earn 20% of trading fees generated by agents you refer — forever, with no cap and no minimum payout threshold above $1 USDC.
Hyperliquid lists perpetual contracts across asset classes far beyond crypto. Your agent can run a momentum strategy on NVDA, harvest funding on BTC-PERP, hedge forex exposure on EUR-USD, and go long gold — all through the same API, the same auth token, the same position management endpoints.
Every design decision in the Purple Flea Hyperliquid API is optimized for programmatic, high-frequency access. Here is what makes it the right choice for autonomous agents.
Hyperliquid's L1 processes orders without EVM gas costs. Your agent can submit hundreds of orders per hour without gas cost unpredictability eating into returns. The only fee is the exchange taker/maker fee on fills.
From API call to confirmed fill in under one second on average. No mempool waiting, no confirmation blocks. Your agent gets the fill price it expects when acting on a signal, not the price three blocks later.
Major markets support leverage from 1x to 50x. Specify leverage per-order alongside margin mode (isolated or cross). Your agent controls exact risk exposure on every position it opens.
Every market response includes the current 8-hour funding rate and the timestamp of the next funding settlement. Your agent can factor funding into entry/exit decisions and run delta-neutral strategies systematically.
Perpetual markets on Hyperliquid never close. Crypto perps trade continuously. Stock and forex perps have their own schedules reflected in funding rate behavior — your agent can operate around the clock.
Beyond market orders, your agent can place limit orders at specific prices and stop-loss orders that trigger on mark price. Full order lifecycle management via the /v1/orders endpoint.
All Hyperliquid API endpoints are served from trading.purpleflea.com.
Every request requires a bearer token in the Authorization header.
All request and response bodies are JSON.
?category=crypto|stocks|commodities|forex filter.
?depth=5 query param to limit levels returned. Useful for agents calculating expected slippage before entering a position.
market, side (long|short), size, leverage (1–50), order_type (market|limit). Optional: limit_price, margin_mode (isolated|cross). Returns fill price, position ID, and liquidation price on success.
size field allows partial close — useful for scaling out of a position incrementally.
reduce_only flag to ensure the order can only reduce an existing position. Returns order ID for tracking.
?from and ?to Unix timestamp filters. Essential for agents running funding rate arbitrage or building predictive funding models.
Both examples use only the standard library and requests. Drop them into any agent, swap in your API key, and run.
You can access Hyperliquid directly — it has a public API. Here is why most agent developers choose to go through Purple Flea instead.
| Feature | Direct Hyperliquid | Purple Flea (HL API) |
|---|---|---|
| Authentication | EIP-712 wallet signing per request | Bearer token — one header |
| Private key handling | Required — must be stored in agent | Not required — Purple Flea handles it |
| USDC deposit setup | Manual bridge from Arbitrum | Handled automatically |
| REST API | ✗ Custom JSON-RPC protocol | ✓ Standard REST + JSON |
| Error messages | Raw exchange error codes | Human-readable with suggested fixes |
| Referral income | ✗ | 20% of fees — forever |
| Agent onboarding time | Hours (wallet setup, signing logic) | Minutes (API key + first request) |
| Gas fees | ✓ None (Hyperliquid L1) | ✓ None (Hyperliquid L1) |
| Markets available | ✓ 275+ | ✓ 275+ |
| Execution speed | ✓ Sub-second | ✓ Sub-second |
Hyperliquid charges a taker fee on every filled order. Purple Flea earns a portion of that fee and passes 20% of it directly back to you — the developer or platform that referred the agent. There is no cap, no expiry, and no minimum trade count.
How to refer: Share your Purple Flea referral link. When another developer or agent framework registers using your link, every agent they create is automatically attributed to you. Referral attribution is permanent — it does not change if the referred developer changes their plan or API key.
Free to start. No KYC. 0 gas fees. 20% referral commission on every trade.