Skip to content

Commit 807a812

Browse files
committed
docs
1 parent b85aa45 commit 807a812

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

DEPLOYMENT.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -464,16 +464,19 @@ GROUP BY c.symbol, i.name;
464464
"
465465
```
466466

467-
### Step 6.7: Backfill Funding Rates and Open Interest (Optional)
467+
### Step 6.7: Backfill Funding Rates (Optional)
468468

469-
After your collector is running and collecting real-time funding/OI data, you may want to backfill historical data. This provides historical context for funding rates and open interest trends.
469+
After your collector is running and collecting real-time funding/OI data, you may want to backfill historical funding rate data. This provides historical context for funding rate trends.
470470

471471
**Important Notes**:
472472
- ⚠️ All commands use `docker compose exec collector` - runs inside the Docker container
473473
- Funding rates update hourly on Hyperliquid (24 records/day)
474-
- Open Interest is backfilled alongside funding data
474+
- **API Limitation**: Historical endpoint ONLY provides `funding_rate` and `premium`
475+
- ❌ NO historical data for: `mark_price`, `oracle_price`, `mid_price`, `open_interest`, `next_funding_time`
476+
- ✅ Real-time collector captures ALL fields going forward
477+
- Safe to run - won't overwrite real-time data (uses COALESCE)
475478
- Uses minute-precision timestamps aligned with candle data
476-
- Safe to run multiple times (UPSERT prevents duplicates)
479+
- Safe to run multiple times (UPSERT with COALESCE preserves existing data)
477480

478481
#### Backfill 7 Days (Recommended Starting Point)
479482

@@ -483,8 +486,8 @@ docker compose exec collector python -m scripts.backfill_funding --coin=BTC --da
483486

484487
# Expected output:
485488
# - Funding rates: ~168 records (24 per day × 7 days)
486-
# - Open interest: ~168 records
487-
# - Both tables updated with minute-precision timestamps
489+
# - Only funding_rate and premium populated (API limitation)
490+
# - Other fields (mark_price, OI, etc.) remain NULL or preserve existing real-time data
488491
```
489492

490493
#### Backfill Specific Coins
@@ -589,9 +592,10 @@ docker compose exec collector python -m scripts.backfill_funding --coin=BTC --da
589592
```
590593

591594
**2. Data Retention**: Consider your storage needs
592-
- 7 days: ~168 records per coin per table (funding + OI)
593-
- 30 days: ~720 records per coin per table
594-
- 365 days: ~8,760 records per coin per table
595+
- 7 days: ~168 records per coin (24 per day)
596+
- 30 days: ~720 records per coin
597+
- 365 days: ~8,760 records per coin
598+
- **Note**: Backfill only populates funding_rate and premium (API limitation)
595599

596600
**3. Rate Limiting**: The backfill script respects Hyperliquid API limits
597601
- 7 days: <1 minute per coin
@@ -607,10 +611,11 @@ docker compose exec collector python -m scripts.backfill --coin=BTC --days=30
607611
docker compose exec collector python -m scripts.backfill_funding --coin=BTC --days=30
608612
```
609613

610-
**5. Data Consistency**: Funding/OI backfills use minute-precision timestamps
614+
**5. Data Consistency**: Funding backfills use minute-precision timestamps
611615
- Aligns with candle data: `2025-11-02 20:00:00+00`
612616
- Easy to JOIN: `ON f.time = c.time`
613617
- Consistent with 1-minute buffering strategy
618+
- **Real-time collector provides complete data** (all price fields + OI)
614619

615620
#### Common Issues
616621

0 commit comments

Comments
 (0)