---
title: "Funding Rate Arbitrage: Hyperliquid x Lighter | 0xArchive"
description: "Compare BTC funding rates across Hyperliquid and Lighter.xyz with an open-source notebook that normalizes rates and detects arbitrage windows."
canonical_url: "https://www.0xarchive.io/blog/funding-rate-arbitrage/"
markdown_url: "https://www.0xarchive.io/blog/funding-rate-arbitrage.md"
route: "/blog/funding-rate-arbitrage"
robots: "index, follow"
generated_from: "prerendered_html"
---

# Funding Rate Arbitrage: Hyperliquid x Lighter | 0xArchive
Compare BTC funding rates across Hyperliquid and Lighter.xyz with an open-source notebook that normalizes rates and detects arbitrage windows.
## Cross-Exchange Funding Rate Analysis

We built an open-source Jupyter notebook that compares BTC funding rates across Hyperliquid and Lighter.xyz using historical data from 0xArchive.

## What It Does

- Fetches funding rate snapshots from both exchanges via a single `oxarchive` Python SDK client
- Auto-detects rate conventions (HL hourly vs Lighter 8h) and normalizes to comparable 8-hour rates
- Generates 6 visualizations:

**Side-by-side funding rate comparison** - see how rates move across venues

**Spread analysis** with +/-2 sigma statistical threshold bands

**Annualized carry (APR)** with filled spread area

**Arbitrage opportunity window detection** with shaded regions

**Cumulative hypothetical P&L** from spread-harvesting

**Distribution analysis** with skew/kurtosis stats

## Example Output (7-day window)

9,925 HL + 38,040 Lighter snapshots, 110 aligned hours, 2 arb windows detected, 25 bps hypothetical P&L (13% annualized).

## Get Started

```
pip install -r requirements.txt
cp .env.example .env
jupyter notebook funding_rate_scanner.ipynb
```

Works with a free API key from [0xarchive.io/dashboard](https://www.0xarchive.io/dashboard/) (BTC, 30-day lookback).

## Links

- [GitHub Repository](https://github.com/0xArchiveIO/examples/tree/main/funding-rate-scanner)

This is our second example - showcasing the SDK's multi-exchange capability. More examples coming (OI divergence, market microstructure).
