API v1.0Hyperliquid Compatible
API Reference
PaperExchange's Hyperliquid API is 100% compatible with the original. Use the same request format with your PaperExchange API key.
Base URL
PaperExchange uses a unified API with exchange-specific paths. For Hyperliquid:
https://api.paperx.co/v1/exchanges/hyperliquidGlobal endpoints (auth, billing) use: https://api.paperx.co/v1/auth and https://api.paperx.co/v1/billing
Authentication
All trading endpoints require authentication via API key in the X-API-Key header.
curl -X POST https://api.paperx.co/v1/exchanges/hyperliquid/info \
-H "Content-Type: application/json" \
-H "X-API-Key: pe_your_api_key" \
-d '{"type": "clearinghouseState"}'Trading Endpoints (Hyperliquid Compatible)
These endpoints mirror Hyperliquid's API exactly. Your existing Hyperliquid code works with just a URL change.
| Endpoint | Method | Description |
|---|---|---|
/v1/exchanges/hyperliquid/info | POST | Market data, prices, order book, account state |
/v1/exchanges/hyperliquid/exchange | POST | Place/cancel orders, update leverage, TWAP orders |
POST /v1/exchanges/hyperliquid/info - Request Types
| Type | Description |
|---|---|
allMids | All mid prices for all assets |
meta | Exchange metadata (assets, decimals) |
metaAndAssetCtxs | Meta + funding rates, open interest |
clearinghouseState | Account state, positions, margin |
openOrders | All open orders |
userFills | Recent trade fills |
userFunding | Funding payment history |
l2Book | Order book for a coin |
candleSnapshot | OHLCV candle data |
POST /v1/exchanges/hyperliquid/exchange - Action Types
| Action | Description |
|---|---|
order | Place limit/market orders |
cancel | Cancel orders by order ID |
cancelByCloid | Cancel orders by client order ID |
modify | Modify existing order |
batchModify | Batch modify multiple orders |
updateLeverage | Set leverage (1-50x) |
updateIsolatedMargin | Add/remove isolated margin |
twapOrder | Place TWAP order |
twapCancel | Cancel TWAP order |
scheduleCancel | Dead man's switch |
Account & Auth Endpoints
PaperExchange-specific endpoints for account management.
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/v1/auth/register | POST | None | Create account (3-day trial, $10k balance) |
/v1/auth/login | POST | None | Login, returns JWT token |
/v1/auth/me | GET | JWT | Get current user profile |
/v1/auth/api-keys | POST | JWT | Create API key (max 5 basic, 10 pro) |
/v1/auth/api-keys | GET | JWT | List all API keys |
/v1/auth/api-keys/{id} | DELETE | JWT | Revoke API key |
/v1/auth/account/reset | POST | JWT/Key | Top up balance (when < $100) |
/v1/auth/forgot-password | POST | None | Request password reset email |
/v1/auth/reset-password | POST | None | Reset password with token |
Dashboard Endpoints
Endpoints for the trading dashboard. All require JWT or API key authentication.
| Endpoint | Method | Description |
|---|---|---|
/v1/exchanges/hyperliquid/account/overview | GET | Full account overview with positions, PnL, stats |
/v1/exchanges/hyperliquid/account/positions | GET | All open positions |
/v1/exchanges/hyperliquid/account/orders | GET | Order history (filter by status) |
/v1/exchanges/hyperliquid/account/orders/open | GET | Open orders only |
/v1/exchanges/hyperliquid/account/fills | GET | Trade fill history |
/v1/exchanges/hyperliquid/account/analytics | GET | Trading analytics (win rate, PnL, volume) |
/v1/exchanges/hyperliquid/account/equity-curve | GET | Equity curve data for charts |
/v1/exchanges/hyperliquid/account/reset | POST | Full account reset (deletes all data) |
/v1/exchanges/hyperliquid/account/set-balance | POST | Set custom starting balance ($1k-$10M) |
Billing Endpoints
| Endpoint | Method | Description |
|---|---|---|
/v1/billing/subscription | GET | Current subscription status |
/v1/billing/plans | GET | Available plans and pricing |
/v1/billing/subscribe | POST | Create payment invoice |
/v1/billing/invoices | GET | Invoice history |
/v1/billing/discount/apply | POST | Apply discount code |
Rate Limits
Basic Plan ($20/mo)
- • 200 requests/minute
- • 5 API keys
- • $10,000 virtual balance
- • 30 days history
Pro Plan ($30/mo)
- • 500 requests/minute
- • 10 API keys
- • $100,000 virtual balance
- • 90 days history
Rate Limit Headers
X-RateLimit-Limit: 200
X-RateLimit-Remaining: 195
X-RateLimit-Reset: 1700000060Trading Engine
Our trading engine simulates Hyperliquid's behavior with real mainnet data:
- Fees: Maker 0.015%, Taker 0.045% (matches Hyperliquid base tier)
- Leverage: 1x to 50x (cross or isolated margin)
- Slippage: Realistic order book walking for market orders
- Liquidations: Uses Hyperliquid's exact liquidation formula
- Funding: Real funding rates applied every 8 hours
- Assets: 130+ perpetual contracts (all Hyperliquid assets)
Error Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad request (invalid parameters) |
401 | Unauthorized (invalid/missing API key) |
403 | Forbidden (subscription expired, trial ended) |
429 | Rate limit exceeded |
500 | Internal server error |