Skip to content

Release v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 08 Jul 01:19

Changes

Added

  • hyperliquid::decode_l2_diff(std::string_view) — decodes the compact data.c binary payload from Hyperliquid's undocumented l2 WebSocket channel into a nlohmann::json diff object. The payload is standard base64 → raw deflate; decoding uses EVP_DecodeBlock (OpenSSL, already linked) and zlib inflate.
  • ZLIB added as an explicit CMake dependency (find_package(ZLIB REQUIRED) / ZLIB::ZLIB); propagated to installed consumers via find_dependency(ZLIB) in hyperliquid-config.cmake.

Changed

  • market_data_websocket example now connects to MAINNET_API_URL instead of TESTNET_API_URL.
  • Suppress ping message logging

Fixed

  • Duplicate wire subscribe when subscribe() races connection establishment: the subscriber thread and the on_connected() replay could both send the subscribe message. Wire sends are now gated by a lock-free connection-epoch CAS so exactly one send occurs per subscription per connection; the final unsubscribe releases the claim so a re-subscribe on the same connection sends again.

Tests

  • L2DiffDecoder.DecodesCompressedDiffPayload — round-trip decode of a captured mainnet l2 channel payload; asserts coin, timestamp, bid/ask levels, and removed-level arrays.
  • L2DiffDecoder.RejectsInvalidBase64 — invalid base64 characters throw std::invalid_argument.
  • L2DiffDecoder.RejectsInvalidDeflateData — valid base64 that is not raw deflate throws std::runtime_error.
  • L2DiffDecoder.RejectsNonJsonDeflatePayload — valid raw deflate that decompresses to non-JSON throws std::runtime_error.