# Independent verification of Diamond Hands Carry's Hyperliquid activity

Agent-readable instructions. No browser is required. Run every command in a new empty directory, using only this file.

- Status of the data: **TESTNET**
- Risk disclosure: https://perpbrain.com/legal/risk-disclosure
- Human/PDF guide: https://perpbrain.com/docs/downloads/how-to-verify-diamond-hands-carry.pdf
- Case study and files: https://perpbrain.com/case-studies/diamond-hands/
- Browser verifier (optional): https://perpbrain.com/verify/
- This file: https://perpbrain.com/verify-dh.md
- Short HTML page: https://perpbrain.com/verify-dh/

This check is for allocators and their auditors. It confirms three things about the Diamond Hands Carry vault, without trusting GVNR's numbers:

1. The funding the vault booked equals the funding Hyperliquid paid or charged for the same windows.
2. A BTC-perp position and fills exist on Hyperliquid for the vault address.
3. The published receipt has not been edited.

The BTC vaults that hold depositor bitcoin, and the USDC bridge that moves margin onto Hyperliquid, are reported by Diamond Hands directly. This check covers the Hyperliquid leg.

## How to read the figures (the receipt is updated weekly)

The files at the URLs below are replaced when a new receipt is published, currently each week. **Always read the expected totals, window times, transaction hashes and row counts from the `receipt.json` you just downloaded.** Do not treat the example figures in this file as fixed.

A check passes when all of the following hold for the files you downloaded:

- The verifier in Step 2 prints `{'status': 'VERIFIED', 'mismatches': []}`.
- `receipt.result.measured_total_usdc` equals `receipt.result.venue_total_usdc`.
- `receipt.result.status` is `RECONCILED` (or, if it is `DIFFERENCES`, `differing` is greater than 0 and those windows are the ones to raise).
- For a window you re-fetch yourself in Step 3, the sum of Hyperliquid `userFunding` USDC for that window equals that window's `venue_usdc` and `measured_usdc` on the receipt.
- The sample HyperEVM transaction in Step 4 exists, succeeded, and has the block number written on that window of the receipt.

### Current example (published 16 Nov 2026, times in Asia/Qatar)

These numbers describe the receipt that was live when this file was written. Use them only as a worked example, and prefer the values on the receipt you download.

- `kind`: `perpbrain.funding-recon-receipt`
- `label`: `TESTNET`
- `account`: `0x5310AE7e24835cC6f7740db18ebbF9f3aB422554` (the receipt may store this in lowercase)
- `coin`: `BTC`
- `network` (in `inputs.json`): `testnet`
- Window: 3 Nov 2026, 02:10:22 to 16 Nov 2026, 10:00:00 Asia/Qatar (`start_ms` 1793661022000, `end_ms` 1794812400066)
- `result.status`: `RECONCILED`
- Windows: 293 of 293 matched (`matched` 293, `differing` 0)
- `measured_total_usdc`: `2.097906`
- `venue_total_usdc`: `2.097906`
- Last window: `from_ms` 1794808515000, `to_ms` 1794812407000, `venue_usdc` `-0.688739`, `measured_usdc` `-0.688739`, two Hyperliquid rows (`-0.291923` and `-0.396816`)
- First window transaction: `0xf5e083c9b802ae3e5c52254bbd84ce0d6137990f2dbae65df5ee7720d09de7e6` at block `68590946`, booked `0.0048` USDC
- `inputs_sha256`: `a7ce8a80750d0d06e68e96df66cb989b9100f5c6347e65e38680f9f8d8d3b213`

## Step 1. Download the receipt

```bash
curl -fsSL -o receipt.json https://perpbrain.com/case-studies/diamond-hands/receipt.json
curl -fsSL -o inputs.json https://perpbrain.com/case-studies/diamond-hands/inputs.json
```

Optional daily running totals (use these for dates older than about seven days): https://perpbrain.com/case-studies/diamond-hands/daily-check.json

Print the fields you will check against:

```bash
python3 - << 'PY'
import json
from datetime import datetime, timezone, timedelta
r = json.load(open("receipt.json"))
qatar = timezone(timedelta(hours=3))
def ts(ms):
    return datetime.fromtimestamp(ms / 1000, tz=timezone.utc).astimezone(qatar).strftime("%Y-%m-%d %H:%M:%S Asia/Qatar")
res = r["result"]
wins = res["windows"]
print("kind", r["kind"])
print("label", r["label"])
print("account", r["account"])
print("coin", r.get("coin"))
print("window_ms", r["window"]["start_ms"], r["window"]["end_ms"])
print("window", ts(r["window"]["start_ms"]), "->", ts(r["window"]["end_ms"]))
print("status", res["status"])
print("matched", res["matched"], "differing", res["differing"], "windows", len(wins))
print("measured_total_usdc", res["measured_total_usdc"])
print("venue_total_usdc", res["venue_total_usdc"])
print("inputs_sha256", r["inputs_sha256"])
print("FIRST_WINDOW", json.dumps(wins[0], sort_keys=True))
print("LAST_WINDOW", json.dumps(wins[-1], sort_keys=True))
PY
```

Confirm `kind` is `perpbrain.funding-recon-receipt` and `label` is `TESTNET` (until a mainnet receipt is published). Confirm `measured_total_usdc` equals `venue_total_usdc`.

## Step 2. Verify the receipt (no browser)

Use the `perpbrain` command-line tool (0.1.4 or later). It reads the receipt's `kind`, re-runs the funding match from `inputs.json` in the same folder, and re-checks both hashes. Create a virtual environment first:

```bash
python3 -m venv .venv
. .venv/bin/activate
pip install -q "perpbrain>=0.1.4"
perpbrain verify-receipt receipt.json
```

Expected output: `VERIFIED` on the first line, then one summary line with the receipt's own figures. With the 16 Nov 2026 receipt it reads:

```
VERIFIED
funding reconciliation (TESTNET): RECONCILED, 293 of 293 windows match, measured 2.097906 USDC, venue 2.097906 USDC in windows
```

The exit code is 0 when verified and 1 otherwise. If the first line is not `VERIFIED`, the published files do not check out: the tool prints the fields that differ instead. Stop and report that output.

Equivalent library call, if you would rather not use the CLI (works with `perpbrain-read>=0.1.3`):

```bash
python -c "import json;from perpbrain_read.sim.funding_recon import verify_recon_receipt as v;print(v(json.load(open('receipt.json')),open('inputs.json','rb').read()))"
```

Expected: `{'status': 'VERIFIED', 'mismatches': []}`.

Node.js route: `npm i @perpbrain/sdk@">=0.1.4"`, then `node -e "import('@perpbrain/sdk').then(m=>console.log(m.verifyReceiptAt('receipt.json')))"` prints `{ status: 'VERIFIED', mismatches: [] }`.

Also confirm the inputs fingerprint matches `inputs_sha256` on the receipt:

```bash
python3 -c "import hashlib,json,pathlib; rec=json.load(open('receipt.json')); h=hashlib.sha256(pathlib.Path('inputs.json').read_bytes()).hexdigest(); print(h); print('MATCH' if h==rec['inputs_sha256'] else 'MISMATCH')"
```

Expected: the hex digest, then `MATCH`.

Note: `perpbrain` 0.1.3 and earlier only checked simulated trade receipts and print `kind mismatch` for this file. If you see that, upgrade with `pip install -U "perpbrain>=0.1.4"` or use the library call above.

Optional browser route: drop `receipt.json` and `inputs.json` onto https://perpbrain.com/verify/. The page should show `VERIFIED` and the same window counts and totals as the receipt.

## Step 3. Check Hyperliquid's own records

While `inputs.json` has `"network": "testnet"`, use `https://api.hyperliquid-testnet.xyz/info`. If a later receipt says `mainnet`, use `https://api.hyperliquid.xyz/info` instead. No API key is required.

Re-fetch funding for the last window on the receipt and compare the sum to that window's `venue_usdc` and `measured_usdc`:

```bash
python3 - << 'PY'
import json, urllib.request
from decimal import Decimal

receipt = json.load(open("receipt.json"))
inputs = json.load(open("inputs.json"))
account = receipt["account"]
win = receipt["result"]["windows"][-1]
from_ms, to_ms = win["from_ms"], win["to_ms"]
network = inputs.get("network", "testnet")
base = "https://api.hyperliquid.xyz/info" if network == "mainnet" else "https://api.hyperliquid-testnet.xyz/info"
payload = json.dumps({
    "type": "userFunding",
    "user": account,
    "startTime": from_ms,
    "endTime": to_ms,
}).encode()
req = urllib.request.Request(base, data=payload, headers={"Content-Type": "application/json"}, method="POST")
rows = json.loads(urllib.request.urlopen(req, timeout=30).read())

def usdc_of(row):
    delta = row.get("delta") or row
    coin = (delta.get("coin") or row.get("coin") or "")
    if coin != receipt.get("coin", "BTC"):
        return Decimal("0")
    # Venue window rule used by the receipt: start_ms < time <= end_ms
    t = row["time"]
    if not (from_ms < t <= to_ms):
        return Decimal("0")
    return Decimal(str(delta.get("usdc") or row.get("usdc") or "0"))

total = sum((usdc_of(row) for row in rows), Decimal("0"))
print("network", network)
print("account", account)
print("last_window_ms", from_ms, to_ms)
print("venue_rows_fetched", len(rows))
print("venue_sum_usdc", format(total, "f"))
print("receipt_venue_usdc", win["venue_usdc"])
print("receipt_measured_usdc", win["measured_usdc"])
print("MATCH" if total == Decimal(str(win["venue_usdc"])) == Decimal(str(win["measured_usdc"])) else "MISMATCH")
for row in rows:
    delta = row.get("delta") or row
    print(" row", row["time"], delta.get("coin"), delta.get("usdc") or row.get("usdc"))
PY
```

Current example (16 Nov 2026): the last window sums to `-0.688739` USDC, from two rows (`-0.291923` and `-0.396816`). Your output should match the last window on the receipt you downloaded.

Hyperliquid keeps hourly funding rows for about seven days, then rolls them into daily totals. If this re-fetch comes back empty or only as daily totals, say so in the report and fall back to the saved `inputs.json` plus `daily-check.json`. You can still complete Step 2 on an older receipt, because the inputs are saved with it.

Check that a BTC-perp position exists, and that fills exist in the receipt window:

```bash
python3 - << 'PY'
import json, urllib.request

receipt = json.load(open("receipt.json"))
inputs = json.load(open("inputs.json"))
account = receipt["account"]
coin = receipt.get("coin", "BTC")
network = inputs.get("network", "testnet")
base = "https://api.hyperliquid.xyz/info" if network == "mainnet" else "https://api.hyperliquid-testnet.xyz/info"

def post(payload):
    req = urllib.request.Request(
        base,
        data=json.dumps(payload).encode(),
        headers={"Content-Type": "application/json"},
        method="POST",
    )
    return json.loads(urllib.request.urlopen(req, timeout=30).read())

state = post({"type": "clearinghouseState", "user": account})
positions = state.get("assetPositions") or []
btc = None
for item in positions:
    pos = item.get("position") or item
    if pos.get("coin") == coin:
        btc = pos
        break
print("position_found", bool(btc))
if btc:
    print("coin", btc.get("coin"), "szi", btc.get("szi"), "entryPx", btc.get("entryPx"), "leverage", btc.get("leverage"))

fills = post({
    "type": "userFillsByTime",
    "user": account,
    "startTime": receipt["window"]["start_ms"],
    "endTime": receipt["window"]["end_ms"],
})
print("fills_in_window", len(fills))
for fill in fills[:10]:
    print(" fill", fill.get("time"), fill.get("coin"), fill.get("side"), fill.get("sz"), fill.get("px"))
if len(fills) > 10:
    print(" ...", len(fills) - 10, "more")
PY
```

Equivalent curl, if you prefer to inspect the raw JSON (replace the timestamps with the window you are checking; the values below are the current example):

```bash
curl -sS -X POST https://api.hyperliquid-testnet.xyz/info \
  -H 'Content-Type: application/json' \
  --data '{"type":"userFunding","user":"0x5310AE7e24835cC6f7740db18ebbF9f3aB422554","startTime":1794808515000,"endTime":1794812407000}'

curl -sS -X POST https://api.hyperliquid-testnet.xyz/info \
  -H 'Content-Type: application/json' \
  --data '{"type":"clearinghouseState","user":"0x5310AE7e24835cC6f7740db18ebbF9f3aB422554"}'

curl -sS -X POST https://api.hyperliquid-testnet.xyz/info \
  -H 'Content-Type: application/json' \
  --data '{"type":"userFillsByTime","user":"0x5310AE7e24835cC6f7740db18ebbF9f3aB422554","startTime":1793661022000,"endTime":1794812400066}'
```

A keeper gap is a window much longer than an hour that is still marked `MATCH`, because the next keeper call booked the whole gap in one go. In the 16 Nov 2026 receipt, 8 Nov 2026, 05:25–17:40 Asia/Qatar is a 12.25-hour window with 12 venue rows and a booked amount of `-0.410189` USDC, matching the venue. That is not a failure.

## Step 4. Check a HyperEVM transaction

The vault on HyperEVM testnet (chain 998) is `0x5310AE7e24835cC6f7740db18ebbF9f3aB422554`.

Take the first window (or any window) from `receipt.result.windows`. Confirm the transaction exists, succeeded, and is in the block written on that window. Send a User-Agent header; the explorer API may reject requests that omit one.

```bash
python3 - << 'PY'
import json, urllib.request

receipt = json.load(open("receipt.json"))
win = receipt["result"]["windows"][0]
tx = win["tx"]
url = f"https://testnet.hyperevm-explorer.xyz/api/v2/transactions/{tx}"
req = urllib.request.Request(url, headers={"User-Agent": "PerpBrain-verify-dh/1.0"})
try:
    data = json.loads(urllib.request.urlopen(req, timeout=30).read())
except Exception as exc:
    print("EXPLORER_ERROR", type(exc).__name__, exc)
    print("open_in_browser", f"https://testnet.hyperevm-explorer.xyz/tx/{tx}")
    raise SystemExit(1)
block = str(data.get("block_number") or data.get("blockNumber") or "")
status = data.get("status")
result = data.get("result")
print("tx", data.get("hash") or tx)
print("status", status)
print("result", result)
print("block", block)
print("receipt_block", win["block"])
print("receipt_measured_usdc", win["measured_usdc"])
ok = (status == "ok" and result == "success" and block == str(win["block"]))
print("MATCH" if ok else "MISMATCH")
print("explorer", f"https://testnet.hyperevm-explorer.xyz/tx/{tx}")
print("address", "https://testnet.hyperevm-explorer.xyz/address/0x5310AE7e24835cC6f7740db18ebbF9f3aB422554")
PY
```

Equivalent curl for the current example's first window:

```bash
curl -sS -A "PerpBrain-verify-dh/1.0" \
  "https://testnet.hyperevm-explorer.xyz/api/v2/transactions/0xf5e083c9b802ae3e5c52254bbd84ce0d6137990f2dbae65df5ee7720d09de7e6"
```

Current example: transaction `0xf5e083c9b802ae3e5c52254bbd84ce0d6137990f2dbae65df5ee7720d09de7e6`, `status` `ok`, `result` `success`, `block_number` `68590946`, booked `0.0048` USDC.

## Report-back template

Copy and fill this after you finish. Times should be in Asia/Qatar.

```
# Diamond Hands Carry Hyperliquid verification report

Date (Asia/Qatar):
Operator / agent:
Receipt URL: https://perpbrain.com/case-studies/diamond-hands/receipt.json
This instruction file: https://perpbrain.com/verify-dh.md

Receipt label:
Account:
Receipt window (as printed in Step 1, Asia/Qatar):
kind:

Step 2 verifier output:
Step 2 inputs_sha256: MATCH / MISMATCH

Booked total (measured_total_usdc):
Venue total (venue_total_usdc):
Windows matched / total:
Receipt result.status (RECONCILED / DIFFERENCES):
Verifier status (VERIFIED / MISMATCH):

Step 3 last window from_ms / to_ms:
Step 3 last window venue_usdc / measured_usdc:
Step 3 sum of userFunding USDC:
Step 3 last window: MATCH / MISMATCH
Position exists (yes / no); coin, size if present:
Fills in the receipt window (count):

Step 4 sample tx hash:
Step 4 explorer status / result / block:
Step 4 receipt block:
Step 4: MATCH / MISMATCH

Notes (keeper gaps, daily-total caveat, any mismatches):
```

## Contact

Questions about a receipt or this guide: info@perpbrain.com

Publisher: GVNR DAO LLC (Marshall Islands). This walk-through uses TESTNET data. Trading perps can lose money. Risk disclosure: https://perpbrain.com/legal/risk-disclosure
