exchangeStatus - HyperCore Info Endpoint
Monitor Hyperliquid exchange health and status with real-time timestamps. Essential for health checks, data freshness verification, and maintenance monitoring.
Get current Hyperliquid exchange status and timestamp for health monitoring and data freshness verification.
Authenticate HyperCore Info requests by sending your Dwellir API key in the x-api-key header to https://api-hyperliquid-mainnet-info.n.dwellir.com/info.
When to Use This Endpoint
The exchangeStatus endpoint is essential for:
- Health Monitoring — Verify exchange is operational
- Data Freshness — Check timestamp for data staleness
- Maintenance Detection — Monitor for special statuses
- Uptime Tracking — Build status dashboards
Common Use Cases
1. Check Data Freshness
async function checkDataFreshness(maxAgeSeconds = 60) {
const status = await getExchangeStatus();
const now = Date.now();
const age = (now - status.time) / 1000; // Convert to seconds
if (age > maxAgeSeconds) {
console.warn(`Warning: Exchange data is ${age.toFixed(1)}s old`);
return false;
}
return true;
}
// Usage
const isFresh = await checkDataFreshness(30);
if (!isFresh) {
console.log('Consider retrying or alerting');
}2. Build Health Check Monitor
class ExchangeHealthMonitor {
constructor(checkIntervalMs = 30000) {
this.checkIntervalMs = checkIntervalMs;
this.isHealthy = true;
this.lastCheck = null;
}
async start() {
while (true) {
try {
const status = await getExchangeStatus();
this.lastCheck = Date.now();
const age = (Date.now() - status.time) / 1000;
this.isHealthy = age < 60 && status.specialStatuses.length === 0;
if (!this.isHealthy) {
console.error('Exchange unhealthy:', {
dataAge: age,
specialStatuses: status.specialStatuses
});
}
} catch (error) {
console.error('Health check failed:', error);
this.isHealthy = false;
}
await new Promise(r => setTimeout(r, this.checkIntervalMs));
}
}
getStatus() {
return {
isHealthy: this.isHealthy,
lastCheck: this.lastCheck
};
}
}
// Usage
const monitor = new ExchangeHealthMonitor();
monitor.start();3. Status Dashboard Endpoint
async function getDashboardStatus() {
const status = await getExchangeStatus();
const now = Date.now();
const latency = now - status.time;
return {
status: status.specialStatuses.length === 0 ? 'operational' : 'maintenance',
latency: `${latency}ms`,
specialStatuses: status.specialStatuses,
lastUpdate: new Date(status.time).toISOString()
};
}4. Alert on Special Statuses
async function checkForAlerts() {
const status = await getExchangeStatus();
if (status.specialStatuses.length > 0) {
// Send alert
console.error('ALERT: Special statuses detected:', status.specialStatuses);
await sendAlert({
title: 'Hyperliquid Special Status',
message: `Statuses: ${status.specialStatuses.join(', ')}`,
timestamp: status.time
});
}
}Best Practices
- Poll regularly (every 30-60 seconds) for monitoring dashboards
- Check freshness before processing critical data
- Alert on special statuses to catch maintenance periods
- Monitor latency between your server time and exchange time
- Implement circuit breakers when exchange is unhealthy
Performance Tips
Lightweight Health Check
// Minimal health check for high-frequency monitoring
async function quickHealthCheck() {
try {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 5000);
const status = await fetch(ENDPOINT, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ type: 'exchangeStatus' }),
signal: controller.signal
});
clearTimeout(timeout);
return status.ok;
} catch {
return false;
}
}Related Endpoints
Monitor Hyperliquid exchange health with Dwellir's HyperCore Info Endpoint. Get your API key →