# CoinGlass public-client reconstruction The local replay passes **249/249 paired visible-value checks**: 83 each for BTC 3D, 7D and 30D, Tier 1 with all leverage groups enabled. Captured on 2026-10-31 around 16:37 UTC. The original Binance model and its failed reference fits remain unchanged. ## What matches | Window | Candles | Server level segments | Displayed CLLD | Bullish / bearish | Visible checks | |---|---:|---:|---:|---:|---:| | 3D · 1m | 4,000 | 2,364 | −307 | 3 / 3 | 83 / 83 | | 7D · 3m | 3,360 | 2,034 | −104 | 3 / 3 | 83 / 83 | | 30D · 15m | 3,000 | 1,907 | −550 | 6 / 7 | 83 / 83 | Each comparison checks last price, final CLLD, one-hour CLLD change, two arrow counts, the four latest arrow directions and timestamps, ten key levels with price/distance/leverage/strength, and six zones with boundaries/distance/strength/width. Targets are parsed from the captured page's accessibility text. The verifier asserts the fixture's capture hash, evidence ID, selected range, UTC timezone and exact text-artifact hash before comparing results. These are rounded visible-value checks, not a full historical-series equality proof or a pixel-perfect recreation. The chart layout is our own. Filters beyond the checked default settings have source correspondence and unit tests, but are labelled a custom view rather than a verified snapshot. ## Where the calculations occur The [public CoinGlass page](https://www.coinglass.com/liquidation-levels?symbol=BTC) fetches `/api/liquidationLevels/v2` from `capi.coinglass.com`, using `symbol=Binance_BTCUSDT`, `limit=4000` and `range=3d`, `7d` or `30d`. The decoded response supplies OHLCV rows and already-generated level segments, including entry/end indices, prices, sizes, sides and leverage tiers. The server's rules for generating those segments were not recovered. The delivered browser code performs these downstream calculations: 1. A 520-row grid spans 0.88 × the window's lowest low to 1.12 × its highest high. Segment sizes use Float32 precision. 2. Active segments accumulate into price bins. The largest included active bin divided by 100 is the display unit. Tier and leverage filters change this unit. 3. Raw CLLD is the cumulative sum of long minus short segment sizes at their start indices, including later-swept segments. Display filters do not change that raw series. 4. The arrow threshold is the maximum of four times the median absolute three-hour CLLD difference and 10% of the full-window CLLD range. Arrows mark earlier extrema; both adjacent pivots are removed if less than three hours apart. They can change when the window or later data changes. 5. Zones are formed from smoothed active bins with peak, growth, distance and strength thresholds. Key levels use bin centers. `src/research/coinglass-client.js` is an independently written implementation. It does not load or execute CoinGlass JavaScript. No model training was required to reproduce these client calculations. ## Evidence Public source: [liquidation-levels client chunk](https://s3.coinglass.com/v1/cg/_next/static/chunks/pages/liquidation-levels-c1168ed5bc552858.js), SHA256 `39b0aa396e1422e93d824d7db8a5715f0387f4321e345d2d106339827357f700`. Shared response-codec source: [application chunk](https://s3.coinglass.com/v1/cg/_next/static/chunks/pages/_app-87451a9c0006d432.js), SHA256 `773acf88b22b5b60e45e47473783a4a72e9cb95bc35c731561d19bf7174e1542`. The final REA capture SHA256 is `0c00d5e0525ce555e441c3d94de9d49290b3406d23523abce82660c7f1e3a54d`; evidence ID `ev_f21db01f837f7aafcdfdddee89423ad2c2765beb237bc955a36dba7ed09df592`. Each `BTC-{range}.json` carries response-body, decoded-payload and decoder hashes. Each `verification-{range}.json` carries fixture and UI-text hashes, pairing assertions and every expected/actual value. Earlier snapshots are archived with `-capture1` and `-direct` suffixes. [REA](https://github.com/morluto/rea) 6.8.0 captured an anonymous temporary Chrome profile and exported loaded scripts. The profile was terminated afterward. Its static analysis worker could not compile a macOS helper because the Xcode licence was unaccepted; no licence was accepted or compiler configuration changed. Source inspection and independent review supplied the algorithm analysis instead. REA marks the broad capture incomplete because some unrelated network content was unavailable. The relevant market responses and paired UI text were retained. Its response-body API may use a follow-up load, so original wire-byte attribution is not proved. The successful visible-value comparison limits the practical impact for these recorded snapshots; it does not erase that provenance limitation. Raw captures and temporary codec metadata remain in the task's private scratch directory and are excluded from the distributable ZIP. Exported fixtures contain market data and provenance, without response header values, cookies or account credentials. The current candle may still be open, as on the reference chart. ## Reproduce `npm test` runs 78 tests. `npm run check` checks all source syntax. The browser replay reads only the bundled snapshots and works without network access to CoinGlass. For a fresh authorized anonymous capture, follow `REFRESH.md`. Import into a new directory with `scripts/import-coinglass-capture.mjs`; the decoder uses standard AES-ECB/PKCS7 and inflate without executing the target bundle. Verify against the same capture's accessibility text using: ```sh node scripts/verify-coinglass-replay.mjs SNAPSHOT_JSON UI_TEXT UNIQUE_REPORT_JSON REA_CAPTURE_JSON ``` No automatic polling or live CoinGlass integration is installed. A Binance-only model still lacks the server-generated level inputs. The recovered arrows describe retrospective changes; this work does not validate future trading performance.