@0xarchive/sdk 0.5.3 → 0.5.4
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 +34 -0
- 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.
|
|
@@ -532,11 +564,13 @@ import type {
|
|
|
532
564
|
OrderBook,
|
|
533
565
|
PriceLevel,
|
|
534
566
|
Trade,
|
|
567
|
+
Candle,
|
|
535
568
|
Instrument,
|
|
536
569
|
LighterInstrument,
|
|
537
570
|
LighterGranularity,
|
|
538
571
|
FundingRate,
|
|
539
572
|
OpenInterest,
|
|
573
|
+
Liquidation,
|
|
540
574
|
CursorResponse,
|
|
541
575
|
WsOptions,
|
|
542
576
|
WsChannel,
|
package/package.json
CHANGED