vike

Recipe 65 of 65

Export a Hyperliquid wallet's fills, funding and ledger for taxes

Page /wallets/{address}/fills, /funding and /ledger with limit=5000 and nextCursor over the tax year and write each to CSV; the API keeps one year of each.

GET /v1/hyperliquid/wallets/{address}/fills, /funding and /ledger answer it together, page by page. They hold what a tax export needs for one wallet: /fills (every fill with price, size, fee and the realized PnL booked on it), /funding (every hourly funding payment) and /ledger (deposits, withdrawals, transfers, vault events). Each pages newest first, up to 5,000 rows per call, with nextCursor. Bound them with start and end. The full parameter lists are on Wallet fills, Wallet funding payments and Wallet ledger.

Quick answer

Start with one page of fills, then run the loop over all three routes.

cURL
# the newest fills of one wallet; repeat with /funding and /ledger
curl -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/hyperliquid/wallets/0x25773676902085225ae5751075e4161369334897/fills?limit=3"

The whole year, three CSV files.

Python
import csv
import os

import requests

H = {"X-API-Key": os.environ["VIKE_API_KEY"]}
WALLET = "0x25773676902085225ae5751075e4161369334897"
BASE = f"https://data.vike.io/v1/hyperliquid/wallets/{WALLET}"
WINDOW = {"start": "2026-01-01T00:00:00Z", "end": "2026-12-31T23:59:59Z"}

def rows(kind):
    params = {**WINDOW, "limit": 5000}
    while True:
        r = requests.get(f"{BASE}/{kind}", params=params, headers=H, timeout=60)
        r.raise_for_status()
        body = r.json()
        yield from body["items"]
        if not body["nextCursor"]:
            return
        params["cursor"] = body["nextCursor"]

for kind in ("fills", "funding", "ledger"):
    items = list(rows(kind))
    if not items:
        continue
    with open(f"{WALLET}-{kind}.csv", "w", newline="") as f:
        w = csv.DictWriter(f, fieldnames=list(items[0]), extrasaction="ignore")
        w.writeheader()
        w.writerows(items)
    print(kind, len(items))

Example response

Captured from the live API on 2026-10-24 at 17:17 UTC, one call per route with limit=3, trimmed to 2 rows each and shown side by side under fills, funding and ledger; the cursors are cut.

On a fill, size_usd and closed_pnl are USD and fee is in fee_token (negative is a rebate): the BTC sell earned a 0.115663 USDC maker rebate and booked 37.39 USD of realized PnL. A funding payment_usd is signed from the wallet's side: positive was received, negative paid. Ledger amount_usd is the event's value in USD.

Example response
{
  "fills": {
    "wallet": "0x25773676902085225ae5751075e4161369334897",
    "items": [
      {"ts": "2026-10-24T17:16:50.348000+00:00", "symbol": "#14850", "side": "buy", "direction": "buy", "size_token": 126.0, "price": 0.18189, "size_usd": 22.91814, "fee": 0.0, "fee_token": "USDC", "is_maker": false, "crossed": true, "closed_pnl": 0.0, "order_id": 584771737324, "trade_id": 658813508406390, "dex_name": "HL"},
      {"ts": "2026-10-24T17:15:21.287000+00:00", "symbol": "BTC", "side": "sell", "direction": "sell", "size_token": 0.14437, "price": 80116.0, "size_usd": 11566.34692, "fee": -0.115663, "fee_token": "USDC", "is_maker": true, "crossed": false, "closed_pnl": 37.39183, "order_id": 584770925919, "trade_id": 549548849720817, "dex_name": "HL"}
    ]
  },
  "funding": {
    "wallet": "0x25773676902085225ae5751075e4161369334897",
    "items": [
      {"ts": "2026-10-24T12:00:00+00:00", "symbol": "xyz:ZM", "payment_usd": 0.000474, "position_size": -4.656, "funding_rate": 1.0614e-06, "dex_name": "HL"},
      {"ts": "2026-10-24T12:00:00+00:00", "symbol": "xyz:ZHIPU", "payment_usd": 0.328896, "position_size": -835.201, "funding_rate": 6.25e-06, "dex_name": "HL"}
    ]
  },
  "ledger": {
    "wallet": "0x25773676902085225ae5751075e4161369334897",
    "items": [
      {"ts": "2026-10-24T12:03:36.201000+00:00", "event_type": "spotTransfer", "amount_usd": 3.290431, "fee": 0.0, "token": "USDC", "counterparty": "0xe11a405e62cff89a4148a6d5c345be8646705b8d", "hash": "0xb8046206c5056248b97e044741f68d02032700ec6008811a5bcd0d5984093c33"},
      {"ts": "2026-10-24T12:02:33.720000+00:00", "event_type": "spotTransfer", "amount_usd": 2.290327, "fee": 0.0, "token": "USDC", "counterparty": "0xe11a405e62cff89a4148a6d5c345be8646705b8d", "hash": "0x468de170efb53b3f4807044741f31d02013a00568ab85a11ea568cc3aeb91529"}
    ]
  }
}

Variations

One coin's fills. Add symbol.

cURL — one coin
# BTC fills of the wallet in the tax year, the largest page
curl -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/hyperliquid/wallets/0x25773676902085225ae5751075e4161369334897/fills?symbol=BTC&start=2026-01-01T00:00:00Z&end=2026-12-31T23:59:59Z&limit=5000"

Deposits and withdrawals only. event_type keeps one kind; run it again with deposit.

cURL — withdrawals
# withdrawals of the wallet in the tax year
curl -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/hyperliquid/wallets/0x25773676902085225ae5751075e4161369334897/ledger?event_type=withdraw&start=2026-01-01T00:00:00Z&end=2026-12-31T23:59:59Z&limit=5000"

Funding total per coin. Sum one page of payments by coin.

cURL — funding by coin
# net funding per coin over one page of payments
curl -s -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/hyperliquid/wallets/0x25773676902085225ae5751075e4161369334897/funding?start=2026-01-01T00:00:00Z&limit=5000" \
  | jq '.items | group_by(.symbol) | map({symbol: .[0].symbol, payment_usd: (map(.payment_usd) | add)})'

Before you rely on it

One year of history, so export before it ages out

Fills, funding and ledger events are each kept for one year, and fills start on 2026-01-01. Older rows are gone, so run the export within the year and keep the files. For a very active wallet, every fill of a day is also in the archive's daily Parquet file, from 2026-05-01.

Not a tax calculation

closed_pnl is the realized PnL the venue booked on each fill, not a cost-basis method of your jurisdiction. Fees can be in a token other than USDC, so group by fee_token before summing. Spot fills (@ symbols) and builder-dex fills sit in the same list; judge the dex by the symbol's prefix, since dex_name can read HL for a builder-dex row. A send in the ledger can be recorded one-sided.

Ask your agent

Connected to the Vike MCP server (https://vike.io/mcp) in Claude, ChatGPT or Cursor, ask it in plain words. The hl_wallet_activity tool answers with view: fills, funding or ledger, at 1 credit a call.

Ask your agent
List the funding payments of 0x25773676902085225ae5751075e4161369334897 on Hyperliquid in October 2026
Example response
{  "fills": {    "wallet": "0x25773676902085225ae5751075e4161369334897",    "items": [      {"ts": "2026-10-24T17:16:50.348000+00:00", "symbol": "#14850", "side": "buy", "direction": "buy", "size_token": 126.0, "price": 0.18189, "size_usd": 22.91814, "fee": 0.0, "fee_token": "USDC", "is_maker": false, "crossed": true, "closed_pnl": 0.0, "order_id": 584771737324, "trade_id": 658813508406390, "dex_name": "HL"},      {"ts": "2026-10-24T17:15:21.287000+00:00", "symbol": "BTC", "side": "sell", "direction": "sell", "size_token": 0.14437, "price": 80116.0, "size_usd": 11566.34692, "fee": -0.115663, "fee_token": "USDC", "is_maker": true, "crossed": false, "closed_pnl": 37.39183, "order_id": 584770925919, "trade_id": 549548849720817, "dex_name": "HL"}    ]  },  "funding": {    "wallet": "0x25773676902085225ae5751075e4161369334897",    "items": [      {"ts": "2026-10-24T12:00:00+00:00", "symbol": "xyz:ZM", "payment_usd": 0.000474, "position_size": -4.656, "funding_rate": 1.0614e-06, "dex_name": "HL"},      {"ts": "2026-10-24T12:00:00+00:00", "symbol": "xyz:ZHIPU", "payment_usd": 0.328896, "position_size": -835.201, "funding_rate": 6.25e-06, "dex_name": "HL"}    ]  },  "ledger": {    "wallet": "0x25773676902085225ae5751075e4161369334897",    "items": [      {"ts": "2026-10-24T12:03:36.201000+00:00", "event_type": "spotTransfer", "amount_usd": 3.290431, "fee": 0.0, "token": "USDC", "counterparty": "0xe11a405e62cff89a4148a6d5c345be8646705b8d", "hash": "0xb8046206c5056248b97e044741f68d02032700ec6008811a5bcd0d5984093c33"},      {"ts": "2026-10-24T12:02:33.720000+00:00", "event_type": "spotTransfer", "amount_usd": 2.290327, "fee": 0.0, "token": "USDC", "counterparty": "0xe11a405e62cff89a4148a6d5c345be8646705b8d", "hash": "0x468de170efb53b3f4807044741f31d02013a00568ab85a11ea568cc3aeb91529"}    ]  }}