LiquidView API
v1 — Real-time DEX execution cost data
Access real-time and historical execution cost data across decentralized perpetual exchanges. Build trading bots, analytics dashboards, smart order routers, and more.
Introduction
The LiquidView API provides programmatic access to execution cost analytics across all major decentralized perpetual exchanges. Data is collected in real-time and aggregated hourly.
9+ Exchanges
Hyperliquid, Paradex, gTrade, Lighter, Orderly, Aster, Variational, Extended, GRVT
5 Order Sizes
$1K, $10K, $100K, $500K, $1M notional
Up to 90 Days
Hourly granularity, up to 2,160 hours of history
Supported Exchanges
What is Execution Cost?
Execution cost measures the total slippage + fees incurred when executing a market order on a DEX perpetual exchange. LiquidView simulates orders of various sizes across all supported exchanges and records the effective cost in basis points (bps). Lower cost = better execution quality for traders.
Authentication
All API requests require authentication via an API key. Include your key in the Authorization header.
GET /api/v1/tokens HTTP/1.1
Host: liquidview.app
Authorization: Bearer lv_your_api_key_hereKeep your key secret
- • Never expose your key in client-side code, public repos, or browser requests
- • Use environment variables or a secret manager
- • If compromised, revoke it immediately in your dashboard
Getting an API Key
- 1.Subscribe to LiquidView Premium
- 2.Go to API Keys in your dashboard
- 3.Click New Key, name it, and copy the generated key
- 4.The key is shown once — store it securely
Rate Limits
API requests are rate-limited per key. Current limits:
| Tier | Rate Limit | Max History | Order Sizes |
|---|---|---|---|
| Pro | 60 requests/min | 2,160 hours (90 days) | All (1k – 1m) |
Rate limit info is included in response headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1711929600When you exceed the limit, you'll receive a 429 Too Many Requests response with a retryAfter field (in seconds).
Endpoints
Error Handling
The API uses standard HTTP status codes. All error responses include an error field.
| Status | Meaning | Common Cause |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Invalid token, size, or exchange parameter |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Key revoked or subscription expired |
| 429 | Too Many Requests | Rate limit exceeded. Check retryAfter field |
| 500 | Server Error | Something went wrong on our end |
{
"error": "Rate limit exceeded",
"retryAfter": 42,
"limit": 60
}Code Examples
cURL
# List available tokens
curl -s \
-H "Authorization: Bearer $LIQUIDVIEW_API_KEY" \
https://www.liquidview.app/api/v1/tokens | jq .
# Get BTC execution costs (last 48h)
curl -s \
-H "Authorization: Bearer $LIQUIDVIEW_API_KEY" \
"https://www.liquidview.app/api/v1/token/BTC?hours=48" | jq .
# Get ETH history on Hyperliquid (500k size, 7 days)
curl -s \
-H "Authorization: Bearer $LIQUIDVIEW_API_KEY" \
"https://www.liquidview.app/api/v1/history/ETH?hours=168&size=500k&exchange=hyperliquid" | jq .Python
import os
import requests
API_KEY = os.environ["LIQUIDVIEW_API_KEY"]
BASE_URL = "https://www.liquidview.app/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# Get available tokens
tokens = requests.get(f"{BASE_URL}/tokens", headers=HEADERS).json()
print(f"Available tokens: {tokens['data']}")
# Get BTC costs across all exchanges (24h)
btc = requests.get(f"{BASE_URL}/token/BTC?hours=24", headers=HEADERS).json()
for exchange in btc["data"]:
print(f"{exchange['exchange']:15s} "
f"10k: {exchange['avg_10k']:.2f} bps "
f"100k: {exchange['avg_100k']:.2f} bps")
# Get hourly history for SOL on Hyperliquid
history = requests.get(
f"{BASE_URL}/history/SOL",
headers=HEADERS,
params={"hours": 168, "size": "100k", "exchange": "hyperliquid"}
).json()
for point in history["series"][0]["data"][:5]:
print(f"{point['timestamp']} cost: {point['cost']} bps")JavaScript / Node.js
const API_KEY = process.env.LIQUIDVIEW_API_KEY;
const BASE = "https://www.liquidview.app/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };
// Get BTC execution costs
const res = await fetch(`${BASE}/token/BTC?hours=24`, { headers });
const { data } = await res.json();
// Find cheapest exchange for 100k
const cheapest = data.sort((a, b) => a.avg_100k - b.avg_100k)[0];
console.log(`Best 100k execution: ${cheapest.exchange} at ${cheapest.avg_100k} bps`);
// Stream historical data for a bot
async function getCostHistory(token, hours = 24, size = "10k") {
const res = await fetch(
`${BASE}/history/${token}?hours=${hours}&size=${size}`,
{ headers }
);
return res.json();
}
const ethHistory = await getCostHistory("ETH", 168, "500k");
console.log(`Got ${ethHistory.series.length} exchange series`);Go
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
)
const baseURL = "https://www.liquidview.app/api/v1"
type TokenResponse struct {
Success bool `json:"success"`
Data []string `json:"data"`
Count int `json:"count"`
}
func main() {
apiKey := os.Getenv("LIQUIDVIEW_API_KEY")
req, _ := http.NewRequest("GET", baseURL+"/tokens", nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result TokenResponse
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Available tokens (%d): %v\n", result.Count, result.Data)
}Changelog
- Initial API release with 3 endpoints
- API key authentication with SHA-256 hashing
- Per-key rate limiting (60 req/min)
- 9 exchanges, 5 order sizes, up to 90 days history
- Usage tracking per key (request count, last used)
Ready to build?
Get your API key and start integrating LiquidView data into your trading stack.
