@0xarchive/sdk 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/index.d.mts +429 -7
- package/dist/index.d.ts +429 -7
- package/dist/index.js +185 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +185 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -218,6 +218,38 @@ const history = await client.hyperliquid.openInterest.history('ETH', {
|
|
|
218
218
|
});
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
+
### Liquidations (Hyperliquid only)
|
|
222
|
+
|
|
223
|
+
Get historical liquidation events. Data available from May 2025 onwards.
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
// Get liquidation history for a coin
|
|
227
|
+
const liquidations = await client.hyperliquid.liquidations.history('BTC', {
|
|
228
|
+
start: Date.now() - 86400000,
|
|
229
|
+
end: Date.now(),
|
|
230
|
+
limit: 100
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// Paginate through all results
|
|
234
|
+
const allLiquidations = [...liquidations.data];
|
|
235
|
+
while (liquidations.nextCursor) {
|
|
236
|
+
const next = await client.hyperliquid.liquidations.history('BTC', {
|
|
237
|
+
start: Date.now() - 86400000,
|
|
238
|
+
end: Date.now(),
|
|
239
|
+
cursor: liquidations.nextCursor,
|
|
240
|
+
limit: 1000
|
|
241
|
+
});
|
|
242
|
+
allLiquidations.push(...next.data);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Get liquidations for a specific user
|
|
246
|
+
const userLiquidations = await client.hyperliquid.liquidations.byUser('0x1234...', {
|
|
247
|
+
start: Date.now() - 86400000 * 7,
|
|
248
|
+
end: Date.now(),
|
|
249
|
+
coin: 'BTC' // optional filter
|
|
250
|
+
});
|
|
251
|
+
```
|
|
252
|
+
|
|
221
253
|
### Candles (OHLCV)
|
|
222
254
|
|
|
223
255
|
Get historical OHLCV candle data aggregated from trades.
|
|
@@ -276,6 +308,68 @@ const lighterCandles = await client.lighter.candles.history('BTC', {
|
|
|
276
308
|
| `1d` | 1 day |
|
|
277
309
|
| `1w` | 1 week |
|
|
278
310
|
|
|
311
|
+
### Data Quality Monitoring
|
|
312
|
+
|
|
313
|
+
Monitor data coverage, incidents, latency, and SLA compliance across all exchanges.
|
|
314
|
+
|
|
315
|
+
```typescript
|
|
316
|
+
// Get overall system health status
|
|
317
|
+
const status = await client.dataQuality.status();
|
|
318
|
+
console.log(`System status: ${status.status}`);
|
|
319
|
+
for (const [exchange, info] of Object.entries(status.exchanges)) {
|
|
320
|
+
console.log(` ${exchange}: ${info.status}`);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Get data coverage summary for all exchanges
|
|
324
|
+
const coverage = await client.dataQuality.coverage();
|
|
325
|
+
for (const exchange of coverage.exchanges) {
|
|
326
|
+
console.log(`${exchange.exchange}:`);
|
|
327
|
+
for (const [dtype, info] of Object.entries(exchange.dataTypes)) {
|
|
328
|
+
console.log(` ${dtype}: ${info.totalRecords.toLocaleString()} records, ${info.completeness}% complete`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Get symbol-specific coverage with gap detection
|
|
333
|
+
const btc = await client.dataQuality.symbolCoverage('hyperliquid', 'BTC');
|
|
334
|
+
const oi = btc.dataTypes.open_interest;
|
|
335
|
+
console.log(`BTC OI completeness: ${oi.completeness}%`);
|
|
336
|
+
console.log(`Gaps found: ${oi.gaps.length}`);
|
|
337
|
+
for (const gap of oi.gaps.slice(0, 5)) {
|
|
338
|
+
console.log(` ${gap.durationMinutes} min gap: ${gap.start} -> ${gap.end}`);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// List incidents with filtering
|
|
342
|
+
const result = await client.dataQuality.listIncidents({ status: 'open' });
|
|
343
|
+
for (const incident of result.incidents) {
|
|
344
|
+
console.log(`[${incident.severity}] ${incident.title}`);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Get latency metrics
|
|
348
|
+
const latency = await client.dataQuality.latency();
|
|
349
|
+
for (const [exchange, metrics] of Object.entries(latency.exchanges)) {
|
|
350
|
+
console.log(`${exchange}: OB lag ${metrics.dataFreshness.orderbookLagMs}ms`);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Get SLA compliance metrics for a specific month
|
|
354
|
+
const sla = await client.dataQuality.sla({ year: 2026, month: 1 });
|
|
355
|
+
console.log(`Period: ${sla.period}`);
|
|
356
|
+
console.log(`Uptime: ${sla.actual.uptime}% (${sla.actual.uptimeStatus})`);
|
|
357
|
+
console.log(`API P99: ${sla.actual.apiLatencyP99Ms}ms (${sla.actual.latencyStatus})`);
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### Data Quality Endpoints
|
|
361
|
+
|
|
362
|
+
| Method | Description |
|
|
363
|
+
|--------|-------------|
|
|
364
|
+
| `status()` | Overall system health and per-exchange status |
|
|
365
|
+
| `coverage()` | Data coverage summary for all exchanges |
|
|
366
|
+
| `exchangeCoverage(exchange)` | Coverage details for a specific exchange |
|
|
367
|
+
| `symbolCoverage(exchange, symbol)` | Coverage with gap detection for specific symbol |
|
|
368
|
+
| `listIncidents(params)` | List incidents with filtering and pagination |
|
|
369
|
+
| `getIncident(incidentId)` | Get specific incident details |
|
|
370
|
+
| `latency()` | Current latency metrics (WebSocket, REST, data freshness) |
|
|
371
|
+
| `sla(params)` | SLA compliance metrics for a specific month |
|
|
372
|
+
|
|
279
373
|
### Legacy API (Deprecated)
|
|
280
374
|
|
|
281
375
|
The following legacy methods are deprecated and will be removed in v2.0. They default to Hyperliquid data:
|
|
@@ -532,11 +626,13 @@ import type {
|
|
|
532
626
|
OrderBook,
|
|
533
627
|
PriceLevel,
|
|
534
628
|
Trade,
|
|
629
|
+
Candle,
|
|
535
630
|
Instrument,
|
|
536
631
|
LighterInstrument,
|
|
537
632
|
LighterGranularity,
|
|
538
633
|
FundingRate,
|
|
539
634
|
OpenInterest,
|
|
635
|
+
Liquidation,
|
|
540
636
|
CursorResponse,
|
|
541
637
|
WsOptions,
|
|
542
638
|
WsChannel,
|
package/dist/index.d.mts
CHANGED
|
@@ -586,6 +586,265 @@ declare class OxArchiveError extends Error {
|
|
|
586
586
|
}
|
|
587
587
|
/** Timestamp can be Unix ms (number), ISO string, or Date object */
|
|
588
588
|
type Timestamp = number | string | Date;
|
|
589
|
+
/** System status values */
|
|
590
|
+
type SystemStatusValue = 'operational' | 'degraded' | 'outage' | 'maintenance';
|
|
591
|
+
/** Status of a single exchange */
|
|
592
|
+
interface ExchangeStatus {
|
|
593
|
+
/** Current status */
|
|
594
|
+
status: SystemStatusValue;
|
|
595
|
+
/** Timestamp of last received data */
|
|
596
|
+
lastDataAt?: string;
|
|
597
|
+
/** Current latency in milliseconds */
|
|
598
|
+
latencyMs?: number;
|
|
599
|
+
}
|
|
600
|
+
/** Status of a data type (orderbook, fills, etc.) */
|
|
601
|
+
interface DataTypeStatus {
|
|
602
|
+
/** Current status */
|
|
603
|
+
status: SystemStatusValue;
|
|
604
|
+
/** Data completeness over last 24 hours (0-100) */
|
|
605
|
+
completeness24h: number;
|
|
606
|
+
}
|
|
607
|
+
/** Overall system status response */
|
|
608
|
+
interface StatusResponse {
|
|
609
|
+
/** Overall system status */
|
|
610
|
+
status: SystemStatusValue;
|
|
611
|
+
/** When this status was computed */
|
|
612
|
+
updatedAt: string;
|
|
613
|
+
/** Per-exchange status */
|
|
614
|
+
exchanges: Record<string, ExchangeStatus>;
|
|
615
|
+
/** Per-data-type status */
|
|
616
|
+
dataTypes: Record<string, DataTypeStatus>;
|
|
617
|
+
/** Number of active incidents */
|
|
618
|
+
activeIncidents: number;
|
|
619
|
+
}
|
|
620
|
+
/** Coverage information for a specific data type */
|
|
621
|
+
interface DataTypeCoverage {
|
|
622
|
+
/** Earliest available data timestamp */
|
|
623
|
+
earliest: string;
|
|
624
|
+
/** Latest available data timestamp */
|
|
625
|
+
latest: string;
|
|
626
|
+
/** Total number of records */
|
|
627
|
+
totalRecords: number;
|
|
628
|
+
/** Number of symbols with data */
|
|
629
|
+
symbols: number;
|
|
630
|
+
/** Data resolution (e.g., '1.2s', '1m') */
|
|
631
|
+
resolution?: string;
|
|
632
|
+
/** Current data lag */
|
|
633
|
+
lag?: string;
|
|
634
|
+
/** Completeness percentage (0-100) */
|
|
635
|
+
completeness: number;
|
|
636
|
+
}
|
|
637
|
+
/** Coverage for a single exchange */
|
|
638
|
+
interface ExchangeCoverage {
|
|
639
|
+
/** Exchange name */
|
|
640
|
+
exchange: string;
|
|
641
|
+
/** Coverage per data type */
|
|
642
|
+
dataTypes: Record<string, DataTypeCoverage>;
|
|
643
|
+
}
|
|
644
|
+
/** Overall coverage response */
|
|
645
|
+
interface CoverageResponse {
|
|
646
|
+
/** Coverage for all exchanges */
|
|
647
|
+
exchanges: ExchangeCoverage[];
|
|
648
|
+
}
|
|
649
|
+
/** Gap information for per-symbol coverage */
|
|
650
|
+
interface CoverageGap {
|
|
651
|
+
/** Start of the gap (last data before gap) */
|
|
652
|
+
start: string;
|
|
653
|
+
/** End of the gap (first data after gap) */
|
|
654
|
+
end: string;
|
|
655
|
+
/** Duration of the gap in minutes */
|
|
656
|
+
durationMinutes: number;
|
|
657
|
+
}
|
|
658
|
+
/** Coverage for a specific symbol and data type */
|
|
659
|
+
interface SymbolDataTypeCoverage {
|
|
660
|
+
/** Earliest available data timestamp */
|
|
661
|
+
earliest: string;
|
|
662
|
+
/** Latest available data timestamp */
|
|
663
|
+
latest: string;
|
|
664
|
+
/** Total number of records */
|
|
665
|
+
totalRecords: number;
|
|
666
|
+
/** Completeness percentage (0-100) */
|
|
667
|
+
completeness: number;
|
|
668
|
+
/** Detected data gaps */
|
|
669
|
+
gaps: CoverageGap[];
|
|
670
|
+
}
|
|
671
|
+
/** Per-symbol coverage response */
|
|
672
|
+
interface SymbolCoverageResponse {
|
|
673
|
+
/** Exchange name */
|
|
674
|
+
exchange: string;
|
|
675
|
+
/** Symbol name */
|
|
676
|
+
symbol: string;
|
|
677
|
+
/** Coverage per data type */
|
|
678
|
+
dataTypes: Record<string, SymbolDataTypeCoverage>;
|
|
679
|
+
}
|
|
680
|
+
/** Incident status values */
|
|
681
|
+
type IncidentStatusValue = 'open' | 'investigating' | 'identified' | 'monitoring' | 'resolved';
|
|
682
|
+
/** Incident severity values */
|
|
683
|
+
type IncidentSeverityValue = 'minor' | 'major' | 'critical';
|
|
684
|
+
/** Data quality incident */
|
|
685
|
+
interface Incident {
|
|
686
|
+
/** Unique incident ID */
|
|
687
|
+
id: string;
|
|
688
|
+
/** Status: open, investigating, identified, monitoring, resolved */
|
|
689
|
+
status: string;
|
|
690
|
+
/** Severity: minor, major, critical */
|
|
691
|
+
severity: string;
|
|
692
|
+
/** Affected exchange (if specific to one) */
|
|
693
|
+
exchange?: string;
|
|
694
|
+
/** Affected data types */
|
|
695
|
+
dataTypes: string[];
|
|
696
|
+
/** Affected symbols */
|
|
697
|
+
symbolsAffected: string[];
|
|
698
|
+
/** When the incident started */
|
|
699
|
+
startedAt: string;
|
|
700
|
+
/** When the incident was resolved */
|
|
701
|
+
resolvedAt?: string;
|
|
702
|
+
/** Total duration in minutes */
|
|
703
|
+
durationMinutes?: number;
|
|
704
|
+
/** Incident title */
|
|
705
|
+
title: string;
|
|
706
|
+
/** Detailed description */
|
|
707
|
+
description?: string;
|
|
708
|
+
/** Root cause analysis */
|
|
709
|
+
rootCause?: string;
|
|
710
|
+
/** Resolution details */
|
|
711
|
+
resolution?: string;
|
|
712
|
+
/** Number of records affected */
|
|
713
|
+
recordsAffected?: number;
|
|
714
|
+
/** Number of records recovered */
|
|
715
|
+
recordsRecovered?: number;
|
|
716
|
+
}
|
|
717
|
+
/** Pagination info for incident list */
|
|
718
|
+
interface Pagination {
|
|
719
|
+
/** Total number of incidents */
|
|
720
|
+
total: number;
|
|
721
|
+
/** Page size limit */
|
|
722
|
+
limit: number;
|
|
723
|
+
/** Current offset */
|
|
724
|
+
offset: number;
|
|
725
|
+
}
|
|
726
|
+
/** Incidents list response */
|
|
727
|
+
interface IncidentsResponse {
|
|
728
|
+
/** List of incidents */
|
|
729
|
+
incidents: Incident[];
|
|
730
|
+
/** Pagination info */
|
|
731
|
+
pagination: Pagination;
|
|
732
|
+
}
|
|
733
|
+
/** WebSocket latency metrics */
|
|
734
|
+
interface WebSocketLatency {
|
|
735
|
+
/** Current latency */
|
|
736
|
+
currentMs: number;
|
|
737
|
+
/** 1-hour average latency */
|
|
738
|
+
avg1hMs: number;
|
|
739
|
+
/** 24-hour average latency */
|
|
740
|
+
avg24hMs: number;
|
|
741
|
+
/** 24-hour P99 latency */
|
|
742
|
+
p9924hMs?: number;
|
|
743
|
+
}
|
|
744
|
+
/** REST API latency metrics */
|
|
745
|
+
interface RestApiLatency {
|
|
746
|
+
/** Current latency */
|
|
747
|
+
currentMs: number;
|
|
748
|
+
/** 1-hour average latency */
|
|
749
|
+
avg1hMs: number;
|
|
750
|
+
/** 24-hour average latency */
|
|
751
|
+
avg24hMs: number;
|
|
752
|
+
}
|
|
753
|
+
/** Data freshness metrics (lag from source) */
|
|
754
|
+
interface DataFreshness {
|
|
755
|
+
/** Orderbook data lag */
|
|
756
|
+
orderbookLagMs?: number;
|
|
757
|
+
/** Fills/trades data lag */
|
|
758
|
+
fillsLagMs?: number;
|
|
759
|
+
/** Funding rate data lag */
|
|
760
|
+
fundingLagMs?: number;
|
|
761
|
+
/** Open interest data lag */
|
|
762
|
+
oiLagMs?: number;
|
|
763
|
+
}
|
|
764
|
+
/** Latency metrics for a single exchange */
|
|
765
|
+
interface ExchangeLatency {
|
|
766
|
+
/** WebSocket latency metrics */
|
|
767
|
+
websocket?: WebSocketLatency;
|
|
768
|
+
/** REST API latency metrics */
|
|
769
|
+
restApi?: RestApiLatency;
|
|
770
|
+
/** Data freshness metrics */
|
|
771
|
+
dataFreshness: DataFreshness;
|
|
772
|
+
}
|
|
773
|
+
/** Overall latency response */
|
|
774
|
+
interface LatencyResponse {
|
|
775
|
+
/** When these metrics were measured */
|
|
776
|
+
measuredAt: string;
|
|
777
|
+
/** Per-exchange latency metrics */
|
|
778
|
+
exchanges: Record<string, ExchangeLatency>;
|
|
779
|
+
}
|
|
780
|
+
/** SLA targets */
|
|
781
|
+
interface SlaTargets {
|
|
782
|
+
/** Uptime target percentage */
|
|
783
|
+
uptime: number;
|
|
784
|
+
/** Data completeness target percentage */
|
|
785
|
+
dataCompleteness: number;
|
|
786
|
+
/** API P99 latency target in milliseconds */
|
|
787
|
+
apiLatencyP99Ms: number;
|
|
788
|
+
}
|
|
789
|
+
/** Completeness metrics per data type */
|
|
790
|
+
interface CompletenessMetrics {
|
|
791
|
+
/** Orderbook completeness percentage */
|
|
792
|
+
orderbook: number;
|
|
793
|
+
/** Fills completeness percentage */
|
|
794
|
+
fills: number;
|
|
795
|
+
/** Funding rate completeness percentage */
|
|
796
|
+
funding: number;
|
|
797
|
+
/** Overall completeness percentage */
|
|
798
|
+
overall: number;
|
|
799
|
+
}
|
|
800
|
+
/** Actual SLA metrics */
|
|
801
|
+
interface SlaActual {
|
|
802
|
+
/** Actual uptime percentage */
|
|
803
|
+
uptime: number;
|
|
804
|
+
/** 'met' or 'missed' */
|
|
805
|
+
uptimeStatus: string;
|
|
806
|
+
/** Actual completeness metrics */
|
|
807
|
+
dataCompleteness: CompletenessMetrics;
|
|
808
|
+
/** 'met' or 'missed' */
|
|
809
|
+
completenessStatus: string;
|
|
810
|
+
/** Actual API P99 latency */
|
|
811
|
+
apiLatencyP99Ms: number;
|
|
812
|
+
/** 'met' or 'missed' */
|
|
813
|
+
latencyStatus: string;
|
|
814
|
+
}
|
|
815
|
+
/** SLA compliance response */
|
|
816
|
+
interface SlaResponse {
|
|
817
|
+
/** Period covered (e.g., '2026-01') */
|
|
818
|
+
period: string;
|
|
819
|
+
/** Target SLA metrics */
|
|
820
|
+
slaTargets: SlaTargets;
|
|
821
|
+
/** Actual SLA metrics */
|
|
822
|
+
actual: SlaActual;
|
|
823
|
+
/** Number of incidents in this period */
|
|
824
|
+
incidentsThisPeriod: number;
|
|
825
|
+
/** Total downtime in minutes */
|
|
826
|
+
totalDowntimeMinutes: number;
|
|
827
|
+
}
|
|
828
|
+
/** Parameters for listing incidents */
|
|
829
|
+
interface ListIncidentsParams {
|
|
830
|
+
/** Filter by incident status */
|
|
831
|
+
status?: IncidentStatusValue;
|
|
832
|
+
/** Filter by exchange */
|
|
833
|
+
exchange?: string;
|
|
834
|
+
/** Only show incidents starting after this timestamp (Unix ms) */
|
|
835
|
+
since?: number | string;
|
|
836
|
+
/** Maximum results per page (default: 20, max: 100) */
|
|
837
|
+
limit?: number;
|
|
838
|
+
/** Pagination offset */
|
|
839
|
+
offset?: number;
|
|
840
|
+
}
|
|
841
|
+
/** Parameters for getting SLA metrics */
|
|
842
|
+
interface SlaParams {
|
|
843
|
+
/** Year (defaults to current year) */
|
|
844
|
+
year?: number;
|
|
845
|
+
/** Month 1-12 (defaults to current month) */
|
|
846
|
+
month?: number;
|
|
847
|
+
}
|
|
589
848
|
|
|
590
849
|
interface HttpClientOptions {
|
|
591
850
|
baseUrl: string;
|
|
@@ -1026,6 +1285,165 @@ declare class LiquidationsResource {
|
|
|
1026
1285
|
byUser(userAddress: string, params: LiquidationsByUserParams): Promise<CursorResponse<Liquidation[]>>;
|
|
1027
1286
|
}
|
|
1028
1287
|
|
|
1288
|
+
/**
|
|
1289
|
+
* Data quality API resource
|
|
1290
|
+
*
|
|
1291
|
+
* Provides endpoints for monitoring data quality, coverage, incidents, and SLA metrics.
|
|
1292
|
+
*
|
|
1293
|
+
* @example
|
|
1294
|
+
* ```typescript
|
|
1295
|
+
* // Get system status
|
|
1296
|
+
* const status = await client.dataQuality.status();
|
|
1297
|
+
* console.log(`System status: ${status.status}`);
|
|
1298
|
+
*
|
|
1299
|
+
* // Get coverage for all exchanges
|
|
1300
|
+
* const coverage = await client.dataQuality.coverage();
|
|
1301
|
+
*
|
|
1302
|
+
* // Get symbol-specific coverage with gap detection
|
|
1303
|
+
* const btc = await client.dataQuality.symbolCoverage('hyperliquid', 'BTC');
|
|
1304
|
+
* console.log(`BTC OI completeness: ${btc.dataTypes.open_interest.completeness}%`);
|
|
1305
|
+
* for (const gap of btc.dataTypes.open_interest.gaps.slice(0, 5)) {
|
|
1306
|
+
* console.log(`Gap: ${gap.start} - ${gap.end} (${gap.durationMinutes} min)`);
|
|
1307
|
+
* }
|
|
1308
|
+
* ```
|
|
1309
|
+
*/
|
|
1310
|
+
declare class DataQualityResource {
|
|
1311
|
+
private http;
|
|
1312
|
+
private basePath;
|
|
1313
|
+
constructor(http: HttpClient, basePath?: string);
|
|
1314
|
+
/**
|
|
1315
|
+
* Get overall system health status
|
|
1316
|
+
*
|
|
1317
|
+
* @returns StatusResponse with overall status, per-exchange status,
|
|
1318
|
+
* per-data-type status, and active incident count
|
|
1319
|
+
*
|
|
1320
|
+
* @example
|
|
1321
|
+
* ```typescript
|
|
1322
|
+
* const status = await client.dataQuality.status();
|
|
1323
|
+
* console.log(`Overall: ${status.status}`);
|
|
1324
|
+
* for (const [exchange, info] of Object.entries(status.exchanges)) {
|
|
1325
|
+
* console.log(`${exchange}: ${info.status}`);
|
|
1326
|
+
* }
|
|
1327
|
+
* ```
|
|
1328
|
+
*/
|
|
1329
|
+
status(): Promise<StatusResponse>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Get data coverage summary for all exchanges
|
|
1332
|
+
*
|
|
1333
|
+
* @returns CoverageResponse with coverage info for all exchanges and data types
|
|
1334
|
+
*
|
|
1335
|
+
* @example
|
|
1336
|
+
* ```typescript
|
|
1337
|
+
* const coverage = await client.dataQuality.coverage();
|
|
1338
|
+
* for (const exchange of coverage.exchanges) {
|
|
1339
|
+
* console.log(`${exchange.exchange}:`);
|
|
1340
|
+
* for (const [dtype, info] of Object.entries(exchange.dataTypes)) {
|
|
1341
|
+
* console.log(` ${dtype}: ${info.totalRecords} records`);
|
|
1342
|
+
* }
|
|
1343
|
+
* }
|
|
1344
|
+
* ```
|
|
1345
|
+
*/
|
|
1346
|
+
coverage(): Promise<CoverageResponse>;
|
|
1347
|
+
/**
|
|
1348
|
+
* Get data coverage for a specific exchange
|
|
1349
|
+
*
|
|
1350
|
+
* @param exchange - Exchange name ('hyperliquid' or 'lighter')
|
|
1351
|
+
* @returns ExchangeCoverage with coverage info for all data types on this exchange
|
|
1352
|
+
*
|
|
1353
|
+
* @example
|
|
1354
|
+
* ```typescript
|
|
1355
|
+
* const hl = await client.dataQuality.exchangeCoverage('hyperliquid');
|
|
1356
|
+
* console.log(`Orderbook earliest: ${hl.dataTypes.orderbook.earliest}`);
|
|
1357
|
+
* ```
|
|
1358
|
+
*/
|
|
1359
|
+
exchangeCoverage(exchange: string): Promise<ExchangeCoverage>;
|
|
1360
|
+
/**
|
|
1361
|
+
* Get data coverage for a specific symbol on an exchange
|
|
1362
|
+
*
|
|
1363
|
+
* Includes gap detection showing periods where data may be missing.
|
|
1364
|
+
*
|
|
1365
|
+
* @param exchange - Exchange name ('hyperliquid' or 'lighter')
|
|
1366
|
+
* @param symbol - Symbol name (e.g., 'BTC', 'ETH')
|
|
1367
|
+
* @returns SymbolCoverageResponse with per-data-type coverage including gaps
|
|
1368
|
+
*
|
|
1369
|
+
* @example
|
|
1370
|
+
* ```typescript
|
|
1371
|
+
* const btc = await client.dataQuality.symbolCoverage('hyperliquid', 'BTC');
|
|
1372
|
+
* const oi = btc.dataTypes.open_interest;
|
|
1373
|
+
* console.log(`OI completeness: ${oi.completeness}%`);
|
|
1374
|
+
* console.log(`Gaps found: ${oi.gaps.length}`);
|
|
1375
|
+
* for (const gap of oi.gaps.slice(0, 3)) {
|
|
1376
|
+
* console.log(` ${gap.durationMinutes} min gap at ${gap.start}`);
|
|
1377
|
+
* }
|
|
1378
|
+
* ```
|
|
1379
|
+
*/
|
|
1380
|
+
symbolCoverage(exchange: string, symbol: string): Promise<SymbolCoverageResponse>;
|
|
1381
|
+
/**
|
|
1382
|
+
* List incidents with filtering and pagination
|
|
1383
|
+
*
|
|
1384
|
+
* @param params - Filter and pagination options
|
|
1385
|
+
* @returns IncidentsResponse with list of incidents and pagination info
|
|
1386
|
+
*
|
|
1387
|
+
* @example
|
|
1388
|
+
* ```typescript
|
|
1389
|
+
* // Get all open incidents
|
|
1390
|
+
* const result = await client.dataQuality.listIncidents({ status: 'open' });
|
|
1391
|
+
* for (const incident of result.incidents) {
|
|
1392
|
+
* console.log(`${incident.severity}: ${incident.title}`);
|
|
1393
|
+
* }
|
|
1394
|
+
* ```
|
|
1395
|
+
*/
|
|
1396
|
+
listIncidents(params?: ListIncidentsParams): Promise<IncidentsResponse>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Get a specific incident by ID
|
|
1399
|
+
*
|
|
1400
|
+
* @param incidentId - The incident ID
|
|
1401
|
+
* @returns Incident details
|
|
1402
|
+
*
|
|
1403
|
+
* @example
|
|
1404
|
+
* ```typescript
|
|
1405
|
+
* const incident = await client.dataQuality.getIncident('inc_123');
|
|
1406
|
+
* console.log(`Status: ${incident.status}`);
|
|
1407
|
+
* console.log(`Root cause: ${incident.rootCause}`);
|
|
1408
|
+
* ```
|
|
1409
|
+
*/
|
|
1410
|
+
getIncident(incidentId: string): Promise<Incident>;
|
|
1411
|
+
/**
|
|
1412
|
+
* Get current latency metrics for all exchanges
|
|
1413
|
+
*
|
|
1414
|
+
* @returns LatencyResponse with WebSocket, REST API, and data freshness metrics
|
|
1415
|
+
*
|
|
1416
|
+
* @example
|
|
1417
|
+
* ```typescript
|
|
1418
|
+
* const latency = await client.dataQuality.latency();
|
|
1419
|
+
* for (const [exchange, metrics] of Object.entries(latency.exchanges)) {
|
|
1420
|
+
* console.log(`${exchange}:`);
|
|
1421
|
+
* if (metrics.websocket) {
|
|
1422
|
+
* console.log(` WS current: ${metrics.websocket.currentMs}ms`);
|
|
1423
|
+
* }
|
|
1424
|
+
* console.log(` OB lag: ${metrics.dataFreshness.orderbookLagMs}ms`);
|
|
1425
|
+
* }
|
|
1426
|
+
* ```
|
|
1427
|
+
*/
|
|
1428
|
+
latency(): Promise<LatencyResponse>;
|
|
1429
|
+
/**
|
|
1430
|
+
* Get SLA compliance metrics for a specific month
|
|
1431
|
+
*
|
|
1432
|
+
* @param params - Optional year and month (defaults to current month)
|
|
1433
|
+
* @returns SlaResponse with SLA targets, actual metrics, and compliance status
|
|
1434
|
+
*
|
|
1435
|
+
* @example
|
|
1436
|
+
* ```typescript
|
|
1437
|
+
* const sla = await client.dataQuality.sla({ year: 2026, month: 1 });
|
|
1438
|
+
* console.log(`Period: ${sla.period}`);
|
|
1439
|
+
* console.log(`Uptime: ${sla.actual.uptime}% (${sla.actual.uptimeStatus})`);
|
|
1440
|
+
* console.log(`Completeness: ${sla.actual.dataCompleteness.overall}%`);
|
|
1441
|
+
* console.log(`API P99: ${sla.actual.apiLatencyP99Ms}ms`);
|
|
1442
|
+
* ```
|
|
1443
|
+
*/
|
|
1444
|
+
sla(params?: SlaParams): Promise<SlaResponse>;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1029
1447
|
/**
|
|
1030
1448
|
* Hyperliquid exchange client
|
|
1031
1449
|
*
|
|
@@ -1158,6 +1576,10 @@ declare class OxArchive {
|
|
|
1158
1576
|
* Lighter.xyz exchange data (August 2025+)
|
|
1159
1577
|
*/
|
|
1160
1578
|
readonly lighter: LighterClient;
|
|
1579
|
+
/**
|
|
1580
|
+
* Data quality metrics: status, coverage, incidents, latency, SLA
|
|
1581
|
+
*/
|
|
1582
|
+
readonly dataQuality: DataQualityResource;
|
|
1161
1583
|
/**
|
|
1162
1584
|
* @deprecated Use client.hyperliquid.orderbook instead
|
|
1163
1585
|
*/
|
|
@@ -1788,8 +2210,8 @@ declare const CandleSchema: z.ZodObject<{
|
|
|
1788
2210
|
quoteVolume: z.ZodOptional<z.ZodNumber>;
|
|
1789
2211
|
tradeCount: z.ZodOptional<z.ZodNumber>;
|
|
1790
2212
|
}, "strip", z.ZodTypeAny, {
|
|
1791
|
-
timestamp: string;
|
|
1792
2213
|
open: number;
|
|
2214
|
+
timestamp: string;
|
|
1793
2215
|
high: number;
|
|
1794
2216
|
low: number;
|
|
1795
2217
|
close: number;
|
|
@@ -1797,8 +2219,8 @@ declare const CandleSchema: z.ZodObject<{
|
|
|
1797
2219
|
quoteVolume?: number | undefined;
|
|
1798
2220
|
tradeCount?: number | undefined;
|
|
1799
2221
|
}, {
|
|
1800
|
-
timestamp: string;
|
|
1801
2222
|
open: number;
|
|
2223
|
+
timestamp: string;
|
|
1802
2224
|
high: number;
|
|
1803
2225
|
low: number;
|
|
1804
2226
|
close: number;
|
|
@@ -3082,8 +3504,8 @@ declare const CandleArrayResponseSchema: z.ZodObject<{
|
|
|
3082
3504
|
quoteVolume: z.ZodOptional<z.ZodNumber>;
|
|
3083
3505
|
tradeCount: z.ZodOptional<z.ZodNumber>;
|
|
3084
3506
|
}, "strip", z.ZodTypeAny, {
|
|
3085
|
-
timestamp: string;
|
|
3086
3507
|
open: number;
|
|
3508
|
+
timestamp: string;
|
|
3087
3509
|
high: number;
|
|
3088
3510
|
low: number;
|
|
3089
3511
|
close: number;
|
|
@@ -3091,8 +3513,8 @@ declare const CandleArrayResponseSchema: z.ZodObject<{
|
|
|
3091
3513
|
quoteVolume?: number | undefined;
|
|
3092
3514
|
tradeCount?: number | undefined;
|
|
3093
3515
|
}, {
|
|
3094
|
-
timestamp: string;
|
|
3095
3516
|
open: number;
|
|
3517
|
+
timestamp: string;
|
|
3096
3518
|
high: number;
|
|
3097
3519
|
low: number;
|
|
3098
3520
|
close: number;
|
|
@@ -3115,8 +3537,8 @@ declare const CandleArrayResponseSchema: z.ZodObject<{
|
|
|
3115
3537
|
}>;
|
|
3116
3538
|
}, "strip", z.ZodTypeAny, {
|
|
3117
3539
|
data: {
|
|
3118
|
-
timestamp: string;
|
|
3119
3540
|
open: number;
|
|
3541
|
+
timestamp: string;
|
|
3120
3542
|
high: number;
|
|
3121
3543
|
low: number;
|
|
3122
3544
|
close: number;
|
|
@@ -3132,8 +3554,8 @@ declare const CandleArrayResponseSchema: z.ZodObject<{
|
|
|
3132
3554
|
};
|
|
3133
3555
|
}, {
|
|
3134
3556
|
data: {
|
|
3135
|
-
timestamp: string;
|
|
3136
3557
|
open: number;
|
|
3558
|
+
timestamp: string;
|
|
3137
3559
|
high: number;
|
|
3138
3560
|
low: number;
|
|
3139
3561
|
close: number;
|
|
@@ -3257,4 +3679,4 @@ type ValidatedCandle = z.infer<typeof CandleSchema>;
|
|
|
3257
3679
|
type ValidatedLiquidation = z.infer<typeof LiquidationSchema>;
|
|
3258
3680
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
3259
3681
|
|
|
3260
|
-
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CursorResponse, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, LighterClient, type LighterGranularity, type LighterInstrument, type Liquidation, LiquidationArrayResponseSchema, type LiquidationHistoryParams, LiquidationSchema, LiquidationSideSchema, type LiquidationsByUserParams, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type PriceLevel, PriceLevelSchema, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedCandle, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedLiquidation, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default };
|
|
3682
|
+
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CompletenessMetrics, type CoverageGap, type CoverageResponse, type CursorResponse, type DataFreshness, type DataTypeCoverage, type DataTypeStatus, type ExchangeCoverage, type ExchangeLatency, type ExchangeStatus, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Incident, type IncidentSeverityValue, type IncidentStatusValue, type IncidentsResponse, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, type LatencyResponse, LighterClient, type LighterGranularity, type LighterInstrument, type Liquidation, LiquidationArrayResponseSchema, type LiquidationHistoryParams, LiquidationSchema, LiquidationSideSchema, type LiquidationsByUserParams, type ListIncidentsParams, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type Pagination, type PriceLevel, PriceLevelSchema, type RestApiLatency, type SlaActual, type SlaParams, type SlaResponse, type SlaTargets, type StatusResponse, type SymbolCoverageResponse, type SymbolDataTypeCoverage, type SystemStatusValue, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedCandle, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedLiquidation, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WebSocketLatency, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default };
|