Loops HouseVault Check

NEAR HACKATHON
Links
Team
1 member- JAOwner
Jaewon Lee
Overview
Vault Check is a public, keyless reserve check for NEAR Intents. For every fungible token it compares what intents.near owes all users (NEP-245 mt_supply) with what the token contract actually holds for intents.near (ft_balance_of / mt_balance_of). If the ledger exceeds the vault, money is leaking.
The 29 Sep - 1 Oct 2026 incident created $3.8M of unbacked USDT inside the ledger, and the team's post-mortem says this exact difference was not monitored at the time. Vault Check replays that incident from public archival chain state: the first unbacked unit appears at block 217,799,506 (29 Sep 16:14 UTC, the same minute the post-mortem gives), the $1,000 alarm fires at block 217,848,728, 31.5 hours before the team identified the problem, and the gap peaks at $3,837,149. Threshold crossings are located to the exact block by bisection, and the on-chain pause flag matches the post-mortem within a minute.
A naive ledger <= vault rule would already be red for 13 unrelated tokens two days before the attack, so the alarm is baseline-aware (ALARM when a gap grows by $1,000, or 1% of the ledger when no price is known) and a hand-checked registry explains standing gaps. Across 20 full scans of 717 fungible tokens, only the incident token alarms.
Everything is reproducible: Python standard library only, no keys, no indexer, no transactions. make reproduce rebuilds every number offline from committed, hash-checked snapshots in about a second; make test (21 tests) asserts that the README numbers equal the reproduction; make live-top runs the same check on the latest block through a free public RPC in about 30 seconds. Replay: https://lee2017-bit.github.io/near-vault-check/